1.下载SSL证书并上传到服务器
登录会员中心:https://ssle.cn
管理SSL证书 -> 订单详细 -> 下载SSL证书 -> 选择 [Apache] , 点击[下载SSL证书]
yourdomain.com.crt (服务器证书) yourdomain.com.key (私钥文件)如果为空请将生成CSR时保存的私钥内容粘贴在文件中 ca-bundle.crt (根证书链)
2. 先打开PHPStudy 的管理窗口, 点击 其他选项
, 打开配置文件
, vhosts-conf
3. 例如安装 demo.getssl.cn , 复制该站点的配置内容.
4. 建议将配置放在httpd.conf文件里面, vhosts.conf 添加站点配置文件会重写,导致配置丢失。
<VirtualHost *:80>
DocumentRoot "D:\phpStudy\WWW"
ServerName demo.getssl.cn
ServerAlias
<Directory "D:\phpStudy\WWW">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
#建议将下面SSL配置 放在 httpd.conf文件中
Listen 443
<VirtualHost *:443>
DocumentRoot "D:\phpStudy\WWW"
ServerName demo.ssle.cn
ServerAlias
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3
SSLCertificateFile d:/ssl/yourdomain.com.crt
SSLCertificateKeyFile d:/ssl/yourdomain.com.key
SSLCertificateChainFile d:/ssl/ca-bundle.crt
<Directory "D:\phpStudy\WWW">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
Was this helpful?
0 / 0