さくらVPSにLAMP環境構築〜apache編

yumに頼らずやってみた際の自分用ログです。

apacheのインストール

参考)http://httpd.apache.org/download.cgi

$wget http://ftp.kddilabs.jp/infosystems/apache//httpd/httpd-2.2.21.tar.gz

$tar xzvf httpd-2.2.21.tar.gz

$cd httpd-2.2.21

$./configure

$make

#make install

起動

#/usr/local/apache2/bin/httpd

動作確認

ブラウザから http://(IPアドレス)を見てみます。

It works!

動いてます!

自動起動設定

#vi /etc/rc.d/init.d/httpd

内容はこちらを参考に

#!/bin/sh
#
# chkconfig: 35 85 15
# description: apache 2.2.21

apachectl="/usr/local/apache2/bin/apachectl"

case "$1" in
        start|stop|restart|fullstatus| \
        status|graceful|graceful-stop| \
        configtest|startssl)
            $apachectl $@
            ;;
        *)
            ;;
esac

権限を他のものと合わせる

#chmod 755 httpd

chkconfig に登録

#chkconfig –add httpd

サービス登録確認

#service httpd start

自動起動確認

#reboot

再度ブラウザで確認 http://(IPアドレス)

動作が確認できたら次はmysqlです。