详细信息 您现在的位置是:首页 > 常见问题

配置ssl之phpstudy(liunx )版本

来源: 发布时间:2020-07-08 1365 人已围观

摘要微信、公众号开发越来越受到关注,因此配置ssl实现https访问成为很多服务器需要实现的。

最近做了一小程序项目,需要用到https访问。linux服务器小白一名,用phpstudy的linux版本。集成环境安装不再叙述,直接进入主题


1、申请ssl证书,现在腾讯云、阿里云都有免费一年的可以使用。可登录查看,申请并下载ssl证书。

2、将证书放在apache的conf目录下(我安装PHP5.5 apache 的目录是/phpstudy/server/httpd/conf)。

3、编辑Apache根目录下 conf/httpd.conf 文件,找到

#LoadModule ssl_module modules/mod_ssl.so

#Include conf/extra/httpd-ssl.conf

去掉前面的#号注释;


4、编辑Apache根目录下 conf/extra/httpd-ssl.conf 文件,修改如下内容:

Listen 443

SSLEngine on

SSLProtocol all -SSLv2 -SSLv3

SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5 

SSLCertificateFile /phpstudy/server/httpd/conf/2_www.123.net.crt

SSLCertificateKeyFile /phpstudy/server/httpd/conf/3_www.123.net.key

SSLCertificateChainFile /phpstudy/server/httpd/conf/1_root_bundle.crt

ServerName www.123.net

DocumentRoot  "/phpstudy/www/www.123.net/" 

Options +Indexes +FollowSymLinks +ExecCGI

AllowOverride All

Order allow,deny

Allow from all

Require all granted


5、phpstudy restart 重启PHPstudy 可以访问https


站点信息

  • 电话:15226178738
  • QQ:1697915848
  • 邮箱:1697915848@qq.com