apache_1.3.20 のインストール
- apache のインストール
- 設定ファイルの変更
- 注意点
以前インストールされていた apache (ver. 1.3.9)
はdebianパッケージになっていた.
しかし debian が potato になり,
slink 版では最新版のパッケージはないため,
ソースからインストールした.
インストール作業
- 最新バージョン apache_1.3.20 を
http://httpd.apache.org/
よりダウンロード.
今回は自分のホームディレクトリにダウンロードした
- ホームディレクトリで圧縮ファイルを展開する.
orange:~$ tar zxvf apache_1.3.20.tar.gz
(一部抜粋)
apache_1.3.20/ABOUT_APACHE
apache_1.3.20/INSTALL
apache_1.3.20/Makefile.tmpl
apache_1.3.20/README
それによって apache_1.3.20 というディレクトリができる.
以下に展開されたファイルのうち大事そうなものを挙げるので
少し目を通しておくといいだろう.
- README.configure: 圧縮ファイルの展開から make install までの説明.
- Makefile.tmpl: Makefile を作るためのテンプレート
- configure: 環境設定用のシェルスクリプト
- src: Apache のソース本体の入ったディレクトリ
- INSTALL: インストールの方法
- conf: 設定ファイルの元の入ったディレクトリ
- apache_1.3.20 のディレクトリに移動して configure する.
configure スクリプトはシステムの OS や環境を自動的に判別して,
最適なコンパイル作業を行なえるようにするものである.
(Makefileを作る)
orange:~$ cd apache_1.3.20
orange:~/apache_1.3.20$ ./configure
(一部抜粋)
Configuring for Apache, Version 1.3.20
+ Warning: Configuring Apache with default settings.
+ This is probably not what you really want.
Creating Makefile
(*)デフォルトでは /usr/local/apache/ 以下にインストールするようになる.
インストールしたい場所を指定するには
orange:~/apache_1.3.20$ ./configure --prefix=[インストールするディレクトリ]
※ 今回は、インストールするディレクトリを /etc/apache にした.
また, 事前にインストールされる場所を知るには
orange:~/apache_1.3.20$ ./configure --show-layout
- make する.
make コマンドによって実際にコンパイルされる.
orange:~/apache_1.3.20$ make
===> src
make[1]: Entering directory `/home/hogehoge/apache_1.3.20'
make[2]: Entering directory `/home/hogehoge/apache_1.3.20/src'
===> src/regex
sh ./mkh -p regcomp.c >regcomp.ih
gcc -I. -I../os/unix -I../include -DLINUX=2 -DUSE_HSREGEX -DUSE_EXPAT -I../lib/expat-lite -DNO_DL_NEEDED `../apaci` -DPOSIX_MISTAKE -c regcomp.c -o regcomp.o
(後略)
- make install する.
適切な場所へインストールされる.
orange:~/apache_1.3.20# make install
make[1]: Entering directory `/home/hogehoge/apache_1.3.20'
===> [mktree: Creating Apache installation tree]
./src/helpers/mkdir.sh /etc/apache/bin
./src/helpers/mkdir.sh /etc/apache/bin
./src/helpers/mkdir.sh /etc/apache/libexec
(中略)
+------------------------------------------
| You now have successfully built and installed the
| Apache 1.3 HTTP server. To verify that Apache actually
| works correctly you now should first check the
| (initially created or preserved) configuration files
|
| /etc/apache/conf/httpd.conf
|
| and then you should be able to immediately fire up
| Apache the first time by running:
|
| /usr/local/apache/bin/apachectl start
|
| Thanks for using Apache. The Apache Group
| http://www.apache.org/
+------------------------------------------
以上でインストール終了.
設定ファイルは /etc/apache/httpd.conf
以前の設定ファイルは httpd.conf , srm.conf, access.conf に分けていたが,
apache_1.3.11 からは httpd.conf だけに統一されるようになった.
以下に主な変更箇所を示す.
### Section 1: Global Environment
- ServerRoot /etc/apache
(デフォルトでは"/etc/apache"となっているので""を削除する)
### Section 2: 'Main' server configuration
- User www-data
(デフォルトはnobody)
- Group www-data
(デフォルトはnogruops)
- ServerAdmin epwww@ep.sci.hokudai.ac.jp
- ServerName www.ep.sci.hokudai.ac.jp
- DocumentRoot "/home/kouhou/public_html"
- <Directory />
Options SymLinksIfOwnerMatch Indexes
AllowOverride FileInfo Indexes Limit AuthConfig
</Directory>
- <Directory /home/kouhou>
Options Indexes FollowSymLinks
AllowOverride None
order allow,deny
allow from all
</Directory>
- <Directory /home/*/public_html>
Options SymLinksIfOwnerMatch Indexes
AllowOverride FileInfo Indexes Limit AuthConfig
</Directory>
- <IfModule mod_dir.c>
DirectoryIndex index.html index.htm
</IfModule>
- AccessFileName .htaccess
<Files .htaccess>
order allow,deny
deny from all
</Files>
- #<IfModule mod_mime_magic.c>
# MIMEMagicFile /usr/local/apache/conf/magic
#</IfModule>
- HostnameLookups On
(Host名の逆引き)
- * ErrorLog /usr/local/apache/logs/error_log
→ ErrorLog /var/log/apache/error.log
- * CustomLog /usr/local/apache/logs/access_log common
→ CustomLog /var/log/apache/access.log common
- * #CustomLog /usr/local/apache/logs/referer_log referer
* #CustomLog /usr/local/apache/logs/agent_log agent
→ CustomLog /var/log/apache/referer_log referer
→ CustomLog /var/log/apache/agent_log agent
- * #CustomLog /usr/local/apache/logs/access_log combined
→ #CustomLog logs/access_log combined
<Directory /home/cgi-bin>
AllowOverride AuthConfig Limit
Options ExecCGI FollowSymLinks IncludesNoExec
</Directory>
- <Location /inex/cgi-bin>
AllowOverride AuthConfig Limit
Options ExecCGI FollowSymLinks IncludesNoExec
</Location>
-
pathの問題
今回の環境では /etc/apache/bin 以下にapacheのコマンド群が格納されているので、pathを通しておく.
bashは /etc/profile、cshは /etc/csh.login にPATH変数を記述する場所があるので追加する.
- logrotate
/var/log/apache 以下に log が溜まっていくが、そのままにしておくとファイルサイズが大きくなるので、logrotate でファイルを分割して圧縮する.
/etc/logrotate.conf を編集して圧縮オプションを追加する.(compressのコメントアウトを外す)
/etc/logrotate.d/ 以下に apache というファイルを置く. 編集内容はここを参照.
更新日 : 2001/08/31 (道政 広一)
作成日 : 2001/07/30
Copyright (C) 2000 epnetfan All rights reserved.