1. 程式人生 > >【解決】AH01909: www.example.com:443:0 server certificate does NOT include an ID....

【解決】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>