Apacheはやはり新しいほうがいいのではないかとのことから
yumではなくソースからインストールした。
1.OpneSSLのインストール確認
OpenSSLを使う場合、Apacheの前にインストールしておく必要があるようなので、インストール確認を行なう。
rpm -qa | grep openssl #0.9.8が入っているようでした。
2.ソースのダウンロード
http://www.ring.gr.jp/archives/net/apache/httpd/
ここからhttpd-2.2.15.tar.gzをダウンロード
3.ソースの解凍
tar xvfz /usr/loca/src/httpd-2.2.15.tar.gz
4.configureオプションの設定
./configure –enable-modules=ssl –with-ssl=/usr/bin/openssl --enable-so --enable-rewrite=shared
5.コンパイル
make
6.インストール
make install
7.mod_sslの確認
/usr/local/apache2/bin/httpd -l #mod_ssl.cがあることを確認
8.apacheの起動
まずhttp://localhost/ がエラーになることを確認。次に
/usr/local/apache2/bin/apachectl start
をしてhttp://localhost/ アクセスすると「ItWorks!」と表示されることを確認。
9.パスの登録
apachectl start/stop で起動/停止できるようにパスを通しておく。
vi /etc/profile #profileファイルを開く
export PATH=$PATH:/usr/local/apache2/bin/ #apachectlのパスを追加
10.サービス登録
cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd #apachectlをhttpdとして起動フォルダにコピー
vi /etc/rc.d/init.d/httpd #httpdを開く
#chkconfig:35 92 10
#description:apache2.2.15
を追記
chkconfig --add httpd #httpdをサービスに登録
chkconfig --levels 35 httpd on #httpdのランレベルを35に
chkconfig --list httpd #httpdがランレベル35で登録されているを確認
再起動して自動起動するかどうかを確認⇒OK!