問題:今天配制一個測試機服務(wù)器 Apache2.4.9本地訪問正常但是在局域網(wǎng)或外網(wǎng)IP拒絕訪問
局域網(wǎng)瀏覽器報錯如下圖:
查看Apache報錯日志如下信息:
[Fri May 13 15:10:08.565138 2016] [authz_core:error] [pid 4964:tid 836] [client 192.168.0.200:53640] AH01630: client denied by server configuration: F:/wamp/www/test/
[Fri May 13 15:10:09.749206 2016] [authz_core:error] [pid 4964:tid 836] [client 192.168.0.200:53640] AH01630: client denied by server configuration: F:/wamp/www/test/
解決如下:
1、關(guān)閉防火墻(注:包括殺毒軟件,防火墻),當(dāng)然你也可以寫規(guī)則開放你服務(wù)器的端口
a、一般如果你的Apache是2.2版本以下的配制如下虛擬主機就可以解決此問題
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
ServerAdmin 826096331@qq.com
DocumentRoot "F:/wamp/www/test"
ServerName www.test.com
DirectoryIndex index.php index.html
ServerAlias test.com
ErrorLog "logs/test.bin-error_log"
CustomLog "logs/test.bin-access_log" common
b、如果你的Apache服務(wù)器是2.4.0以上的版本你還需要做第2步
2、 在虛擬主機配制文件中添加 Require all granted
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Require all granted
ServerAdmin 826096331@qq.com
DocumentRoot "F:/wamp/www/test"
ServerName www.test.com
DirectoryIndex index.php index.html
ServerAlias test.com
ErrorLog "logs/test.bin-error_log"
CustomLog "logs/test.bin-access_log" common
3、重啟你自己的Apache服務(wù)器生效