phpstudy 安装Apache SSL证书实现https连接

 时间:2024-11-13 23:03:08

1、首先申请免费的ssl证书,很多地方都可以申请。我是在腾讯云!如图

phpstudy 安装Apache SSL证书实现https连接

3、打开PHPstudy php扩展设置,在php_openssl上点击打钩。说明就打开了!如图

phpstudy 安装Apache SSL证书实现https连接phpstudy 安装Apache SSL证书实现https连接

5、如图在Apache/conf环境下新建箪滹埘麽vhostssl.conf文件;写入如下:Listen 443<VirtualHost *:443媪青怍牙> DocumentRoot "C:\myphp_www\PHPTutorial\WWW" ServerName www.test.com ServerAlias test.com SSLEngine on SSLProtocol TLSv1 TLSv1.1 TLSv1.2 SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5 SSLCertificateFile "C:\myphp_www\PHPTutorial\Apache\cert\2_www.test.com.crt" SSLCertificateKeyFile "C:\myphp_www\PHPTutorial\Apache\cert\3_www.test.com.key" SSLCertificateChainFile "C:\myphp_www\PHPTutorial\Apache\cert\1_root_bundle.crt"<Directory "C:\myphp_www\PHPTutorial\WWW"> Options +Indexes +FollowSymLinks +ExecCGI AllowOverride All Order allow,deny Allow from all Require all granted </Directory></VirtualHost>其中SSLCertificateFile 是指证书公钥SSLCertificateKeyFile 是指证书私钥SSLCertificateChainFile上面3个就是分别对应ssl证书放置的位置,请看下一步说明。DocumentRoot "C:\myphp_www\PHPTutorial\WWW"这是网站路径根据自己的,这是只是完成一半如果启动成功,那你就可以使用了 如果不成功请继续往下看

phpstudy 安装Apache SSL证书实现https连接phpstudy 安装Apache SSL证书实现https连接

8、细节配置;防火锤渭浮舟墙不要拦截443端口;最后在.htaccess里加入 实现http转跳到https上下列代码修改自己域名<IfModule mo颊俄岿髭d_rewrite.c>RewriteEngine OnRewriteBase /RewriteCond %{SERVER_PORT} 80RewriteRule ^(.*)$ https://www.chu.mn/$1 [R=301,L]</IfModule>

  • 如何在SSH框架中自动生成主键id值
  • 网站被采集了该怎么弄,能去投诉吗?
  • 巧用NTFS磁盘格式为文件加密
  • windows 7操作系统如何开启远程桌面?
  • Weblogic中间件巡检步骤
  • 热门搜索
    什么食物养胃 8月1日是什么星座 洋葱不能和什么一起吃 cad是什么意思 逆风如解意容易莫摧残什么意思 脚气用什么药最好 什么是形声字 夜间盗汗是什么原因 定增是什么意思 什么是音乐