Apacheへのmod_sslの設定あまりお勧めではないが、 通称「オレオレ証明書」でSSLを使った暗号化通信ができるようにする。 サーバの秘密鍵の作成適当なパスフレーズを入力して、秘密鍵を作成する。 # cd /etc/pki/tls/certs # make server.key あと、このままだとサーバの再起動時に、パスフレーズの入力が必要になる。 そこで、次のようにして、パスフレーズを入力しなくてもいいようにする。 # openssl rsa -in server.key -out server.key サーバ用証明書の作成ここで「オレオレ証明書」を作成する(汗) # make server.crt umask 77 ; \ /usr/bin/openssl req -utf8 -new -key server.key -x509 -days 365 -out server.crt -set_serial 0 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) [GB]:JP State or Province Name (full name) [Berkshire]:Hyogo Locality Name (eg, city) [Newbury]:Kakogawa Organization Name (eg, company) [My Company Ltd]:Hoge Ltd Organizational Unit Name (eg, section) []: Common Name (eg, your name or your server's hostname) []:hogehoge.hoge.ac.jp Email Address []:webmaster@hogehoge.hoge.ac.jp SSLの設定設定ファイルに、作成した秘密鍵と証明書を設定する。 # vi /etc/httpd/conf.d/ssl.conf 内容は次のとおり。 DocumentRoot "/var/www/html" ←コメントを削除 ... SSLCertificateFile /etc/pki/tls/certs/server.crt SSLCertificateKeyFile /etc/pki/tls/certs/server.key サーバを再起動設定を反映させるため、サーバを再起動する。 # service httpd restart 参考 |