apache打開Include conf/extra/httpd-vhosts.conf,就無法起動
XAMPP用於安裝部署PHP工程還是很方便的,不過今天碰到一個無法啓動apache服務器的問題。
XAMPP配置站點的文件爲:httpd-vhosts.conf,配置格式如下,
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "程序帶訪問也的路徑"
ServerName www.dev.com (自己命名)
ErrorLog "logs/dummy-host2.localhost-error_log"
CustomLog "D:/xampp_log/VendorPlatform.log" combined
<Directory "程序帶訪問也的路徑">
DirectoryIndex index.php index.htm index.shtml index.html (訪問頁的文件名)
Options Includes FollowSymLinks ExecCGI
AllowOverride All
Allow from all
</Directory>
</VirtualHost>
但是,我在本地配置了後總是訪問不了,
報如下錯誤:
[Apache] Error: Apache shutdown unexpectedly.
[Apache] This may be due to a blocked port, missing dependencies,
[Apache] improper privileges, a crash, or a shutdown by another method.
[Apache] Press the Logs button to view error logs and check
[Apache] the Windows Event Viewer for more clues
[Apache] If you need more help, copy and post this
[Apache] entire log window on the forums
根據網上查了下,還修改了端口。
修改端口的操作如下,
1、修改如下兩個端口
2、打開如下兩個配置文件,將裏面的1中原有端口全部修改爲1中修改後的端口
修改成功後,還是訪問不了配置的站點。於是又找到一個網上的解決辦法,將 CustomLog "D:/xampp_log/VendorPlatform.log" combined這一段全部刪掉,於是可以訪問了。