2008年4月12日土曜日

やっと本題へ(Apache2のインストール)

色々設定やら開発環境の整備などありましたが、やっと本題の1つWebサーバーのApacheを導入します。
  • 事前準備
玄箱のWEB設定ツールが動いているので、そいつの使用ポートを80を8080に変更します。
# vi /etc/thttpd.conf
port=8080
# /etc/init.d/thttpd restart
以降、玄箱の設定(WEBツール)は http://kuro-box:8080/ となる。
  • Apacheのインストール
Apacheのソースコードは以下から入手。
http://www.meisei-u.ac.jp/mirror/apache/httpd/
今日もコンパイルする作業がはじまるお(AA略
$ tar xvfz httpd-2.0.61.tar.gz
$ cd httpd-2.0.61
$ ./configure --prefix=/opt/apache2
$ make
# make install
# strip -p /opt/apache2/bin/*
# strip -p /opt/apache2/lib/*

Apache起動と終了
# /opt/apache2/bin/apachectl start
# /opt/apache2/bin/apachectl stop
自動起動の設定
この設定をすると、玄箱を起動したときに自動でApacheも起動するようになります。
# cp /opt/apache2/bin/apachectl /etc/init.d/httpd
# chmod 755 /etc/init.d/httpd
# ln -s /etc/init.d/httpd /etc/rc.d/rc2.d/S25httpd
# ln -s /etc/init.d/httpd /etc/rc.d/rc0.d/K25httpd
# ln -s /etc/init.d/httpd /etc/rc.d/rc6.d/K25httpd
長くなりそうなので、Apacheの設定は次に。