CentOS7にapacheとmod_sslでSSL設定をする方法

2017年12月2日

1.秘密鍵の作成
# mkdir /usr/local/data/info
# cd /usr/local/data/info
# openssl genrsa -des3 -out sample_server.key 2048
//中略
# chmod 400 sample_server.key

2.CSR証明要求書作成
# openssl req -new -sha256 -key sample_server.key -out sample_server.csr
//中略
# chmod 400 sample_server.csr

3.SSL証明書作成
# openssl x509 -in sample_server.csr -out sample_server.crt -req -signkey sample_server.key -sha256 -days 3650
# chmod 400 sample_server.crt

4.apacheの設定
# cd /etc/httpd/conf.d
# cp -p ssl.conf ssl.conf_yyyymmdd
# vim ssl.conf

設定内容
SSLCertificateFile /usr/local/data/info/sample_server.crt
SSLCertificateKeyFile /usr/local/data/info/sample_server.key

apacheを再起動
# systemctl restart httpd

Apache

Posted by arkgame