阿里云lamp环境下https配置,欢迎留言交流
一:去设置域名并下载阿里云的密钥文件


二:在apache根目录中新建一个cert文件将解压过的秘钥文件放入其中 参考路径为 /usr/local/httpd/cert 如果所示

三:打开Apache/conf/httpd.conf,在httpd.conf文件中找到以下参数并进行配置。
#LoadModule ssl_module modules/mod_ssl.so #删除行首的配置语句注释符号“#”加载mod_ssl.so模块启用SSL服务,Apache默认是不启用该模块的。如果找不到该配置,请重新编译mod_ssl模块。#Include conf/extra/httpd-ssl.conf 删除行首的配置语句注释符号“#”。然后开启443端口

四:配置vhosts.conf文件注意秘钥文件路径
以下为httpd-vhosts.conf 配置,最后重启apache
<VirtualHost *:443>
DocumentRoot "这里改为你项目的绝对路径"
ServerName 这里改为你要配置的域名
ServerAlias 这里改为你要配置的域名
SSLEngine on
SSLProtocol TLSv1 TLSv1.1 TLSv1.2
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
SSLCertificateFile "这里改为你公钥的绝对路径"
SSLCertificateKeyFile "这里改为你私钥的绝对路径"
SSLCertificateChainFile "这里改为你证书链的绝对路径"
<Directory "这里改为你项目的绝对路径">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>

浙公网安备 33010602011771号