Apache2.2.6のインストール

Apache2.2.6のインストールについての備忘録

まずは公式サイト(もしくはミラーサイト)からhttpd-2.2.6.tar.bz2をダウンロード。それを展開したら、あとは下記の通り。

$ tar zxvf httpd-2.2.6.tar.bz2
$ ./configure --enable-so --enable-ssl --enable-shared --enable-headers --enable-vhost-alias
$ make
$su
# make install

デフォルトの状態では、「/usr/local/apache2」にインストールされます。

設定ファイルは「/usr/local/apache2/conf/httpd.conf」です。最近のapacheは基本設定以外は別ファイルになっていって、httpd.confで必要なファイルをincludeするようになっています。例えば、userdirや仮想ホストの設定をする場合は、「/usr/local/apache2/conf/extra」にある「httpd-userdir.conf」「httpd-vhosts.conf」を修正してから、httpd.confの下の方にある

# User home directories
#Include conf/extra/httpd-userdir.conf
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

のIncludeの前のコメントをはずします。

起動・停止はそれぞれ

/usr/local/apache2/bin/apachectl start ← 起動
/usr/local/apache2/bin/apachectl stop ← 停止

です。

毎回手動でやるのもなんなので、起動スクリプトを作ってしまったほうが楽です。「/usr/local/apache2/bin/apachectl」を以下のように修正。

# one is reported. Run "apachectl help" for usage info
#
ARGV="$@"
# chkconfig: -85 15   ← 追加
# description: httpd   ← 追加

修正が終わったら、

# cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd
# chkconfig -add httpd

で終了です。

タイトルとURLをコピーしました