(2)SSL設定(これは、作成した証明書と鍵の場所をしてするのが、目的で下記のようにパスや名前を書き換えてること)

[root@centos certs]# vi /etc/httpd/conf.d/ssl.conf ← ApacheSSL設定ファイル編集

SSLCertificateFile /etc/pki/tls/certs/server.crt ← サーバー用証明書を指定

SSLCertificateKeyFile /etc/pki/tls/certs/server.key ← サーバー用秘密鍵を指定

# General setup for the virtual host, inherited from global configuration
#DocumentRoot "/var/www/html" ← #を削除(コメント解除)

DocumentRoot "/var/www/html"

作成に失敗した場合は、server.keyとserver.crtのみをroot権限で削除して作り直し。


■Apache設定反映


(1)Apache設定反映


[root@centos certs]# /etc/rc.d/init.d/httpd restart ← Apache再起動
[root@centos certs]# service httpd restart ←Apache 再起動(CentOS-6)
[root@centos certs]# systemctl restart httpd.service←Apache再起動(CentOS-7)
httpd を停止中: [ OK ]
httpd を起動中: [ OK ]

確認 ブラウザを使い、https:/IPアドレス/ で確認する。

アクセス制限