天天看點

Apache2.4.9本地通路正常但是在區域網路或外網IP拒絕通路

問題:今天配制一個測試機伺服器 Apache2.4.9本地通路正常但是在區域網路或外網IP拒絕通路

區域網路浏覽器報錯如下圖:

Apache2.4.9本地通路正常但是在區域網路或外網IP拒絕通路

檢視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、關閉防火牆(注:包括防毒軟體,防火牆),當然你也可以寫規則開放你伺服器的端口

a、一般如果你的Apache是2.2版本以下的配制如下虛拟主機就可以解決此問題

<VirtualHost *:80>

    <Directory "F:/wamp/www/test">

        Options FollowSymLinks

        AllowOverride All

        Order allow,deny

        Allow from all

    </Directory>

    ServerAdmin [email protected]

    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

</VirtualHost>

b、如果你的Apache伺服器是2.4.0以上的版本你還需要做第2步

2、

在虛拟主機配制檔案中添加 Require all granted

        Require all granted

3、重新開機你自己的Apache伺服器生效

<a target="_blank" href="http://www.erdangjiade.com/source">http://www.erdangjiade.com/source</a>