WEBサイトドメイン | www.example.jp |
Apacheインストールフォルダ | /etc/httpd |
SSL用設定ファイル | /etc/httpd/conf.d/ssl.conf |
SSL証明書ファイル保存フォルダ | /etc/httpd/certs |
乱数ファイル | /etc/httpd/certs/rand.dat |
サーバ用秘密鍵 | www.example.jp.privkey.pem |
サービス起動用秘密鍵 | www.example.jp.privkey_nopwd.pem |
CSR(署名要求) | www.example.jp.csr.pem |
サーバ証明書 | www.example.jp.cert.pem |
中間CA証明書 | inca.pem |
# rpm -qi mod_ssl
# yum install mod_ssl
# mkdir /etc/httpd/certs
# openssl dgst -sha256 /usr/bin/* > /etc/httpd/certs/rand.dat
# mkdir /etc/httpd/certs/2016
# cd /etc/httpd/certs/2016
# mkdir /etc/httpd/certs/2020
# ln -s /etc/httpd/certs/2020 /etc/httpd/certs/latest
SSLCertificateFile | /etc/httpd/certs/latest/www.example.jp.full_cert.pem |
SSLCertificateKeyFile | /etc/httpd/certs/latest/www.example.jp.privkey_nopwd.pem |
# mkdir /etc/httpd/certs/2021
# rm /etc/httpd/certs/latest
# ln -s /etc/httpd/certs/2021 /etc/httpd/certs/latest
# openssl genrsa -des3 -out www.example.jp.privkey.pem -rand ../rand.dat 2048
Enter pass phrase for server.key : (パスフレーズ) Verifying pass phrase for server.key :(パスフレーズの再入力) |
# openssl req -new -key www.example.jp.privkey.pem -out www.example.jp.csr.pem
Enter pass phrase for server.key : (パスフレーズ) |
【国コード】 Country Name (2 letter code) [XX]:JP 【都道府県名】 State or Province Name (full name) []:Tokyo 【市区町村名】 Locality Name (eg, city) [Default City]:Minato-ku 【組織名称】 Organization Name (eg, company) [Default Company Ltd]:My Company Inc. 【所属名称】 Organizational Unit Name (eg, section) []:IT Group 【サーバ名(FQDN)】 Common Name (eg, your name or your server's hostname) []:www.example.jp 【管理者Email】 Email Address []: |
Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: |
# openssl req -text -noout -in www.example.jp.csr.pem
お申し込みをされたコモンネームに間違いがなければ、以下のURLにアクセス
して承認手続きをお願いいたします。
https://regist.globalsign.com/ra/dvApproval/dvApproval/DvApproval.do?r=9a85147d&e=6285680d402c58&c=ab59960b1547e1ec0245407cf2c32e77e10c12xx
-----BEGIN CERTIFICATE-----
MIIFFjCCA/6gAwIBAgIMf2FxwN92ZYmuI43xMA0GCSqGSIb3DQEBCwUAMGAxCzAJ
(・・・省略・・・)
QrqQPxfV2R4k1A==
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
MIIEYzCCA0ugAwIBAgILBAAAAAABRE7wPiAwDQYJKoZIhvcNAQELBQAwVzELMAkG
(・・・省略・・・)
EjxS1QSCVS1npd+3lXzuP8MIugS+wEY=
-----END CERTIFICATE-----
# cd /etc/httpd/certs
# openssl rsa -in www.example.jp.privkey.pem -out www.example.jp.privkey_nopwd.pem
Enter pass phrase for server.key : (パスフレーズ) |
# chmod -R 400 /etc/httpd/certs
# vi /etc/httpd/conf.d/ssl.conf
SSLCertificateFile | /etc/httpd/certs/2016/www.example.jp.cert.pem |
SSLCertificateKeyFile | /etc/httpd/certs/2016/www.example.jp.privkey_nopwd.pem |
SSLCertificateChainFile | /etc/httpd/certs/2016/inca.pem |
SSLCertificateFile | /etc/httpd/certs/2016/www.example.jp.cert.pem |
SSLCertificateKeyFile | /etc/httpd/certs/2016/www.example.jp.privkey_nopwd.pem |
# /usr/sbin/apachectl configtest
# systemctl restart httpd.service
# service httpd restart
openssl x509 -issuer -hash -noout -in (証明書ファイル)
openssl x509 -subject -hash -noout -in (中間証明書ファイル)
openssl x509 -noout -modulus -in (証明書ファイル)
openssl rsa -noout -modulus -in (秘密鍵ファイル)