使用WampServer 3.0

在server上安装了WampServer

发现本地使用良好,但是无法从别的PC访问。

原因有二:

 

1.现象:输入连接无反应

   原因:server本身用了80端口,所有WampServer我就设置了8080

    结果8080需要添加到防火墙的。InboundRules-> add port.

 

修改后现象:

Forbidden

You don't have permission to access /Shaodan on this server.


Apache/2.4.23 (Win32) PHP/5.6.25 Server at xxxx Port 8080
 

2. 现象:输入连接有反应了但是返回错误403 Forbidden

    原因:处于安全考虑,Apache默认拦截所有非local的访问,需要在配置中打开。

            Google后,的如下方法:

<Directory "c:/wamp/www/">
    Options Indexes FollowSymLinks
    AllowOverride all
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

replace to
AllowOverride All
Order allow,deny
Allow from all

            修改了半天"E:\wamp\bin\apache\apache2.4.23\conf\httpd.conf"发现无效。

            原来,先版本3.0以后的设置移动到virtual里了。

            需要修改 "E:\wamp\bin\apache\apache2.4.23\conf\extra\httpd-vhosts.conf" 这个文件才有效。

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot D:/wamp/www
    <Directory  "D:/wamp/www/">
        Options +Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require local
    </Directory>
</VirtualHost>

Amend it to

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot D:/wamp/www
    <Directory  "D:/wamp/www/">
        Options +Indexes +FollowSymLinks +MultiViews
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

特此Mark一下,虽然问题很小白。

最终解决问题的链接:

http://stackoverflow.com/questions/23382627/wamp-cannot-access-on-local-network-403-forbidden

 

posted @ 2016-11-07 19:41  No5Meters  阅读(632)  评论(0编辑  收藏  举报