配了https之后页面打开就下载源文件问题解决,及阿里云免费http申请

Apache配了https之后页面打开就下载源文件,原因是没有打开对443端口的监听 。

要会看errorlog 。

这个是免费https证书,在阿里云申请的,感谢阿里云。

 

 

注意: 如果是 无域名管理权限有服务器管理权限。选 可TXT文本进行上传验证

 

下一步,下载一个文件放到服务器上对应的目录 ,点【验证】

如果是在windows下,直接创建.well-known有难度,可以在命令行里创建

 把文件下载下来放好后,点【验证】:

验证通过之后,点【提交审核】

还有一个步骤,

 

 

过一会,收到阿里云短信通知,可以下载证书了

下载一个压缩包,里面是这样的: 

 

可以把这3个证书文件放到apache根目录下的cert目录

 

然后到apache下增加conf配置文件 

<VirtualHost *:443>
SSLEngine on
    SSLCertificateFile "cert/3768708_your.com_public.crt"
    SSLCertificateKeyFile "cert/3768708_your.com.key"
    SSLCertificateChainFile "cert/3768708_your.com_chain.crt"
    SSLProtocol all -SSLv2 -SSLv3  
    SSLCipherSuite HIGH:!RC4:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!EXP:+MEDIUM   
    SSLHonorCipherOrder on

    DocumentRoot "D:/php_projects/psi"
    ServerName your.com
    ServerAlias 
    FcgidInitialEnv PHPRC "D:/phpstudy_pro/Extensions/php/php7.3.4nts"
    AddHandler fcgid-script .php
    FcgidWrapper "D:/phpstudy_pro/Extensions/php/php7.3.4nts/php-cgi.exe" .php
  <Directory "D:/php_projects/psi">
      Options FollowSymLinks ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
      Require all granted
	  DirectoryIndex index.php index.html error/index.html
  </Directory>
  ErrorDocument 400 /error/400.html
  ErrorDocument 403 /error/403.html
  ErrorDocument 404 /error/404.html
  ErrorDocument 500 /error/500.html
  ErrorDocument 501 /error/501.html
  ErrorDocument 502 /error/502.html
  ErrorDocument 503 /error/503.html
  ErrorDocument 504 /error/504.html
  ErrorDocument 505 /error/505.html
  ErrorDocument 506 /error/506.html
  ErrorDocument 507 /error/507.html
  ErrorDocument 510 /error/510.html
</VirtualHost>

这个版本的apache居然搞了个Listen.conf,要在这里加上Listen 443

注意: 如果之前没有开启443端口监听,那么重启apache服务器之后还是无法打开网页,会下载源代码,要清空浏览器缓存才行

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值