※RapidSSLは2015年に入って値上がりが激しく、下記は特に価格面で
大きくズレがあります。現在はCoreSSLにて取得するのが定番の様ですので
こちら
をご確認ください。
以下は備忘録として残しておきます。
■0■SSLBOX(http://www.sslbox.jp/)でのRapidSSL購入
1)https://secure.netowl.jp/netowl/ ←ネットオウルに入会
2)事前にポイントを購入しておく
今回は2年分:3,360 円→事前に3360ポイントの購入が必要(rapidssl.jpだと4,550円、1000円以上安い!)
3)[SSL証明書の取得]に進んでひとまずポイント消費して購入しておいてから、下記作業を進める。
※Rapid-SSLはメール認証なので、あらかじめドメイン管理者のメールアドレス(hostmaster@hogehoge.comなど)を用意しておくこと。
■1■作業ディレクトリに移動
cd /etc/httpd/conf/ssl/
■2■サーバーの秘密鍵作成
# 秘密鍵(1024bit-sslの受け付けは2012/09に終了しています。2048bitで。)
# ファイル名に年号をつけてるのは、今後更新の時に間違えない様にするため。
openssl genrsa -out ssl.hogehoge.com.2013.key 2048
chmod 400 ssl.hogehoge.com.2013.key
■3■CSR(証明書要求)作成:
# CSR
openssl req -new -key ssl.hogehoge.com.2013.key -out ssl.hogehoge.com.2013.csr -sha1
# ※-SHA1
# CSR作成時に使用する署名アルゴリズムを指定します。
# -MD5 :md5WithRSAEncryptionを使用します。
# -SHA1:sha1WithRSAEncryptionを使用します。
# 以下の問い合わせに回答する。
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
国別番号 C=JP
都道府県名 ST=Tokyo
市区町村郡名 L=Koutou-ku
組織名 O=hogehoge, Inc.
部門名 OU=system
コモンネーム CN=ssl.hogehoge.com
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
# string is too long, it needs to be less than 2 bytes long
# Country Name (2 letter code) [GB]:JP
# State or Province Name (full name) [Berkshire]:Tokyo
# Locality Name (eg, city) [Newbury]:Koutou-ku
# Organization Name (eg, company) [My Company Ltd]:hogehoge, Inc.
# Organizational Unit Name (eg, section) :system
# Common Name (eg, your name or your server's hostname) :ssl.hogehoge.com
# Email Address []:
# 内容を確認する
openssl req -in ssl.hogehoge.com.2013.csr -text
# 権限を所有者だけにしておく
chmod 400 ssl.hogehoge.com.2013.csr
■4■上記で作成したCSRを業者に提出し、CRTを受け取る。
1)hostmaster@hogehoge.comなどに届いた承認メールから、承認URL→承認を実施
2)承認後に完了メールが届くので、完了メール下端の
「SSLサーバー証明書」をドメイン名.crtとして保存
cd /etc/httpd/conf/ssl/
vi ssl.hogehoge.com.2013.crt
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
メールの下端の内容を貼り付ける
# -----BEGIN CERTIFICATE-----
# 〜
# -----END CERTIFICATE-----
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
# SSL証明書類の権限を変更
chmod 600 ssl.hogehoge.com.2013.crt
chmod 600 ssl.hogehoge.com.2013.key
cd /etc/httpd/conf/ssl/
# CSRの内容を確認
openssl req -text -noout -in ssl.hogehoge.com.2013.csr
# 証明書の内容を確認
openssl x509 -text -noout -in ssl.hogehoge.com.2013.crt
# 内容を比較して間違いがないことを確認しておく。
# 中間証明書を配置(クロスルート証明書を使用。Android2.2以前とかで証明書エラーが出るのを防ぐ)
cd /etc/httpd/conf/ssl
wget https://knowledge.rapidssl.com/library/VERISIGN/ALL_OTHER/RapidSSL%20Intermediate/RapidSSL_CA_bundle.pem
# 設定ファイルを修正
vi /etc/httpd/conf.d/ssl.conf
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
# Server Certificate:
SSLCertificateFile /etc/httpd/conf/ssl/ssl.hogehoge.com.2013.crt
# Server Private Key:
SSLCertificateKeyFile /etc/httpd/conf/ssl/ssl.hogehoge.com.2013.key
# Server Certificate Chain:
SSLCertificateChainFile /etc/httpd/conf/ssl/RapidSSL_CA_bundle.pem
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
# gracefulで反映
apachectl configtest
apachectl -k graceful
ps aux | grep http
以上。