Notice: get_settings の使用はバージョン 2.1 から非推奨になっています! 代わりに get_option() を使ってください。 in /home/araki/blog.ceed.jp/wp-includes/functions.php on line 3194
Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method adsensem::filter_ads() should not be called statically in /home/araki/blog.ceed.jp/wp-includes/plugin.php on line 192
Strict Standards: Non-static method adsensem::filter_ad_callback() should not be called statically in /home/araki/blog.ceed.jp/wp-content/plugins/adsense-manager/adsense-manager.php on line 198
Strict Standards: Non-static method adsensem::filter_ad_callback() should not be called statically in /home/araki/blog.ceed.jp/wp-content/plugins/adsense-manager/adsense-manager.php on line 201
Notice: Use of undefined constant user_level - assumed 'user_level' in /home/araki/blog.ceed.jp/wp-content/plugins/ultimate_ga_1.6.0/ultimate_ga_1.6.0.php on line 524
Notice: Array to string conversion in /home/araki/blog.ceed.jp/wp-content/plugins/ultimate_ga_1.6.0/ultimate_ga_1.6.0.php on line 701
開発用にSSL環境を作る必要にせまられ、オレオレ証明書でテスト環境を作ってみました。
Apache 2.0.63 + OpenSSL (2.2あたりとはconfファイルの配置に違いがあるようですが)
こちらのサイトを参考にさせていただきました。
まずは、OpenSSLを使ってオレオレ証明書を作ります。
今回はOpenSSL付属のApacheが入っていたのでそれを使います。(ない場合別途落としてきます)
OpenSSLはApacheディレクトリのなかのbinにあります。
##パスを通します > cd C:\Program Files (x86)\Apache Group\Apache2\conf > path %PATH%; C:\Program Files (x86)\Apache Group\Apache2\bin ## キーファイルの作成 > openssl genrsa -rand charset.conv -out server.key 1024 ## CSRの作成 > openssl req -new -key server.key -out server.csr -config ..\openssl.cnf ## 以下コマンドラインの対話 Country Name (2 letter code) [AU]:JP State or Province Name (full name) [Some-State]:kanagawa Locality Name (eg, city) []:kamakura Organization Name (eg, company) [Internet Widgits Pty Ltd]:ceed Organizational Unit Name (eg, section) []:ceed Common Name (eg, YOUR name) []:localhost Email Address []:test@localhost Please enter the following ‘extra’ attributes to be sent with your certificate request A challenge password []: An optional company name []: ## CRTファイルの作成 openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650 ##以上で、server.csr, server.crt, server.key が作成される
httpd.conf の編集
#モジュールの読み込み LoadModule ssl_module modules/mod_ssl.so
ssl.conf の編集
#SSLCertificateFile conf/ssl.crt/server-dsa.crt SSLCertificateFile conf/server.crt #SSLCertificateKeyFile conf/ssl.key/server-dsa.key SSLCertificateKeyFile conf/server.key DocumentRoot "/path/to/root" <Directory "/path/to/root"> SSLOptions +StdEnvVars </Directory>
レジストリの設定
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\services\Apache2
“C:\Program Files (x86)\Apache Group\Apache2\bin\Apache.exe” -k runservice
↓
“C:\Program Files (x86)\Apache Group\Apache2\bin\Apache.exe” -D SSL -k runservice
以上で設定は完了です。
サービスからApacheの再起動を行えばSSLが使えるようになるはずです。
もし正常に起動できない場合は、ポート443が塞がっていないか確認しましょう。(VPN ServerやSkypeなどが使用している場合があります)
コマンドラインから
netstat -ano
で確認できます。
0.0.0.0:443 になんらかの接続がある場合、そのPIDを調べて、該当するプロセスを終了します。
正常に起動すれば、SSLによって上記ポートがListenされます。