1、Listen :監(jiān)聽端口,默認(rèn)情況是80。
2、ServerAdmin :服務(wù)器管理員郵箱。
3、ServerName:服務(wù)名。
4、DocumentRoot:PHP網(wǎng)站的路徑。
5、
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
Apache訪問的每個目錄可設(shè)置相關(guān)的服務(wù)和特性是允許或(和)不允許。
一般修改為,否則可能會出現(xiàn)403頁面錯誤。
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
同時修改PHP的目錄:修改DocumentRoot和<Directory "D:/Program Files/xampp/htdocs">。修改為PHP的網(wǎng)站所在的目錄,如下所示:
查看問題的方法:
運行dos,輸入“cd /d F:/xampplite/apache/bin” ,進(jìn)入到xampp的bin目錄,輸入httpd.exe就可以查看錯誤。常見問題
1、ServerRoot沒配置好,可以使用絕對路徑
2、document沒配置好,網(wǎng)站路徑?jīng)]配置好
3、httpd-vhosts.conf沒配置好,配置參考如下
<VirtualHost *:80>
DocumentRoot "F:/test/public"
ServerName www.dlaipai.com
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,Allow
Allow from all
SetEnv APP_ENV dev
</Directory>
</VirtualHost>