中国站
帮助中心 > 安全 > SSL安全证书 > 证书安装 > phpStudy环境如何安装SSL证书?

phpStudy环境如何安装SSL证书?

第一步:修改apache目录下的httpd.conf配置文件

  1. #LoadModule ssl_module modules/mod_ssl.so删除行首的配置语句注释符号“#”
  2. 增加一条引用语句 Include conf/vhost-ssl.conf

第二步:
1、在conf文件夹中创建一个vhost-ssl.conf配置文件。

2、编辑vhost-ssl.conf文件,增加如下内容:

  1. Listen 443
  2. SSLEngine on
  3. SSLProtocol all -SSLv2 -SSLv3
  4. SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
  5. SSLCertificateFile D:\phpStudy\Apache\conf\ssl\www.22.cn.crt //服务器证书
  6. SSLCertificateKeyFile D:\phpStudy\Apache\conf\ssl\private.key //证书私钥
  7. SSLCertificateChainFile D:\phpStudy\Apache\conf\ssl\ca.crt //根证书
  8. DocumentRoot D:\phpStudy\WWW
  9. Options +Indexes +FollowSymLinks +ExecCGI
  10. AllowOverride All
  11. Order allow,deny
  12. Allow from all
  13. Require all granted

3.phpstudy配置指定路径访问https(仅供参考)。

  1. RewriteEngine on
  2. RewriteCond %{REQUEST_URI} /homework
  3. RewriteRule^(.*)?$ https://%{SERVER_NAME}$1[L,R]

4、保存退出,并重启Apache, 若有报错或者无法正常启动,请看错误日志。