【解决】AH01909: www.example.com:443:0 server certificate does NOT include an ID....

问题描述

今天在配置apache虚拟地址时出现500错误,即绑定127.0.0.1的host后访问配置好的虚拟地址,浏览器返回500 Internal Server Error,打开apache的error.log查看错误日志,发现如下错误代码和描述:

[ssl:warn] [pid 29276:tid 292] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name

环境介绍

XAMPP,windows 7,火狐浏览器

解决方法

提示说服务器证书不包含与服务器名称匹配的ID,ssl警告,试着以管理员身份运行XAMPP Control Panel,再在浏览器中输入虚拟地址,回车,成功!

Tips

几条关于apache配置的小建议:
1、使用notepad++打开httpd.conf和heepd-vhosts.conf文件,免得用一次要去找一次文件。
2、httpd.conf需要添加的语句主要有:

#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other 
# <Directory> blocks below.
#
<Directory />
    AllowOverride ALL
    Require all granted
    Order Deny,Allow
    Allow from all 
</Directory>

3、在httpd-vhosts.conf中配置虚拟路径,需要添加的内容参照如下语句:

<VirtualHost *:80>
    DocumentRoot "E:/example/wwwroot"
    ServerName example.com
</VirtualHost>

4、不要忘了在根目录下添加.htaccess文件,如下语句可以隐藏index:

 <IfModule mod_rewrite.c>
     RewriteEngine on
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteRule ^(.*)$ /index.php/$1 [QSA,PT,L]
 </IfModule>
  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值