AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name

问题描述
今天在配置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
1
环境介绍
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>
———————
作者:toyuanx
来源:CSDN
原文:https://blog.csdn.net/sinat_31582009/article/details/75604925
版权声明:本文为博主原创文章,转载请附上博文链接!

Leave a Comment