2019-04-19  66 views 评论

Centos7 Apache配置SSL证书

前言:SSL证书可以在赛门铁克官网免费申请一年,我为了方便直接在景安平台申请的免费证书(阿里等都可以免费申请到)。

1、已经申请就好的三个安全证书

blog.youshop.top.crt、blog.youshop.top.key、blog.youshop.top-ca-bundle.crt。
放入到对应项目的证书存放绝对路径下
2、yum install -y mod_ssl
3、在conf/httpd.conf 文件Listen 80  下面添加一行 Listen 443
4、在conf/httpd.conf文件末尾添加
# SSL Virtual hosts
Include conf/httpd-ssl.conf,并在对应的路径创建httpd-ssl.conf文件
5、在httpd-ssl.conf添加如下内容:
<VirtualHost 0.0.0.0:443>
DocumentRoot "/var/www/html/blog.youshop.top"
ServerName blog.youshop.top:443
SSLEngine on
SSLCertificateFile /var/www/html/blog.youshop.top/ssl/blog.youshop.top.crt
SSLCertificateKeyFile /var/www/html/blog.youshop.top/ssl/blog.youshop.top.key
SSLCACertificateFile /var/www/html/blog.youshop.top/ssl/blog.youshop.top-ca-bundle.crt
</VirtualHost>  
6、重启Apache服务器即可
systemctl restart httpd

给我留言

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

看不清?