centOS7.4 https 部署

1.获取CA证书,获取 安全证书 和 key 文件,并将其放入 /etc/httpd/conf 下;

2.确保安装 openssl 插件,可用 openssl version 语句查看;

3.修改  /etc/httpd/conf.d 下的 ssl.conf,修改

加上 LoadModule ssl_module modules/mod_ssl.so
ServerName www.XXX.com:443
SSLCertificateFile /etc/httpd/conf/2_www.XXX.com.crt
SSLCertificateKeyFile /etc/httpd/conf/3_www.XXX.com.key
4.在 /etc/httpd/conf 下修改 httpd.conf,进行全站的 http 跳转 https;
RewriteEngine on

RewriteCond  %{HTTPS} !=on

RewriteRule  ^(.*) https://%{SERVER_NAME}$1 [L,R]
5.重启Apache。


猜你喜欢

转载自blog.csdn.net/zhoujian_1943/article/details/79696692