(SSL证书)apache添加https

来源:互联网 发布:php教程视频教程全集 编辑:程序博客网 时间:2024/05/18 03:39

注意 服务器要打开443端口

1.申请证书,这里使用的腾讯云的SSL免费证书(阿里也有免费的)


2.打开php.ini扩展。

extension=php_openssl.dll


3.打开httpd.conf扩展

Include conf/extra/httpd-ssl.conf


4.把下好的证书复制到

\Apache\conf\ssl


5.编辑http-ssl.conf文件(位置:Apache\conf\extra)

删除里http-ssl.conf的内容

键入代码

SSLStrictSNIVHostCheck offSSLCipherSuite AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULLSSLProtocol all -SSLv2 -SSLv3<VirtualHost *:443>    DocumentRoot "C:\project\https" #项目地址    ServerName www.scenewood.top    #域名    ServerAlias scenewood.top       #域名  <Directory "C:\project\https">    #项目地址      Options FollowSymLinks ExecCGI      AllowOverride All      Order allow,deny      Allow from all      Require all granted  </Directory>SSLEngine onSSLCertificateFile "C:\phpstudy\Apache\conf\ssl\scenewood\2_scenewood.top.crt"     #证书 2_域名_crtSSLCertificateKeyFile "C:\phpstudy\Apache\conf\ssl\scenewood\3_scenewood.top.key"  #证书 3_域名_keySSLCertificateChainFile "C:\phpstudy\Apache\conf\ssl\scenewood\1_root_bundle.crt"  #证书 1_root_bundle.crt</VirtualHost>


6.重启apache



原创粉丝点击