centos7.9+php+apache 配置阿里云ssl

 

1、前往阿里云官网申请免费证书选择

 

2、证书存放在/etc/cert

 

3、httpd.cof 配置ssl

<VirtualHost _default_:443>
	ServerName  域名
	DocumentRoot  网站根目录
	SSLEngine on
	SSLProtocol all -SSLv2 -SSLv3
	SSLCipherSuite HIGH:!RC4:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!EXP:+MEDIUM
	SSLHonorCipherOrder on
	SSLCertificateFile /etc/httpd/cert/crt
	SSLCertificateKeyFile /etc/httpd/cert/key
	SSLCertificateChainFile /etc/httpd/cert/chain.crt
<Directory "网站根目录">
    AllowOverride All
    # Allow open access:
    Require all granted
</Directory>
</VirtualHost>

4、http重定向https (httpd.conf末尾 )

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 

posted @ 2023-08-28 21:23  iwen1992  阅读(30)  评论(0编辑  收藏  举报