サーバー移行のさいの作業ログです。
いちいち作業ログとかをとっていない、いい加減なクセを少しでも治していこうと思い、ちょっと頑張ってみる・・・
こんなんじゃ、エンジニア失格だよね・・・
まあ、とりあえず今回はRedHat Enterprise4にApache2 + mod_sslの導入です。基本、他のディストリビューションでも問題ないはず。 後々mongrelも使うので、mod_proxyもとりあえず組み込む。
httpd-2.2.4.tar.gzをwgetで取ってくる。作業ディレクトリは、/usr/local/srcを使用した。
アーカイブを展開し、その中に移動。
./configure –enable-proxy –enable-proxy-balancer –enable-ssl -with-included-apr
make
make install
openssl genrsa -des3 -rand /var/log/messages -out raw-hide.jp.pem 1024
#ここでパスフレーズを入力
openssl req -new -key raw-hide.jp.pem -out raw-hide.jp.csr
==== 入力画面 ====
Using configuration from /etc/ssl/openssl.cnf
Enter PEM pass phrase:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [AU]:JP
State or Province Name (full name) [Some-State]:Tokyo
Locality Name (eg, city) []:Shunjuku-ku
Organization Name (eg, company) [Internet Widgits Pty Ltd]:RAWHIDE.CO.,LTD
Organizational Unit Name (eg, section) []:#部署名
Common Name (eg, YOUR name) []:#ホスト名(FQDN)
Email Address []:#窓口メールアドレス
Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
==== ここまで ====
openssl x509 -req -in raw-hide.jp.csr -signkey raw-hide.jp.pem -out raw-hide.jp.crt
#作成したキーファイルを一箇所にまとめる。 .pemが秘密キーで、.crtが公開キー。
mkdir /usr/local/apache2/ssl
mv raw-hide.jp.* /usr/local/apache2/ssl/
# パスフレーズをはずしたバージョンのキーファイルの作成。このファイルををhttpd.confから指定してあげると、起動時にパスワードを聞かれないので楽。
openssl rsa -in raw-hide.jp.pem -out raw-hide.jp.nopassword.pem
# 設定ファイルの編集
vi /usr/local/apache2/conf/extra/httpd-ssl.conf
==== ここから ====
SSLCertificateFile /usr/local/apache2/ssl/raw-hide.jp.crt
SSLCertificateKeyFile /usr/local/apache2/ssl/raw-hide.jp.nopassword.pem
==== ここまで ====
/usr/local/apache2/bin/apachectl configtest
service httpd restart
これで443番が開いていればとりあえずは、OKです。

