Forbidden error when accessing wamp from local network

て烟熏妆下的殇ゞ 提交于 2019-12-11 10:27:42

问题


Okay now, this problem has been driving me crazy for a week! I hope we will find a solution together.

I am trying to configure my wamp server to run on a local network (be accessable from a local network). Specifically, I want to access a project saved in the /www folder from another computer using a local area connection. I am using Windows 7 for my wamp server. However, when I run "192.168.178.3:8080" from the other computer I get the following error:

Forbidden: You don't have permissions to access / on this server.

I am running wamp on port 8080 (port 80 is used by IIS);
My local IP address is 192.168.178.3

I'll try to explain the things I have done so far...

Changed the following in httpd.conf:

Listen 192.168.178.3:8080

<Directory />
  Options FollowSymLinks
  AllowOverride None
  Order deny,allow
  Allow from all
</Directory>

<Directory "c:/wamp/www/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
# Online --> Require all granted

#   onlineoffline tag - don't remove
Order Deny,Allow
Allow from all
Allow from 127.0.0.1

Require local

</Directory>

<Directory "c:/wamp/www/project">
   allow from all
</Directory>

<Directory "cgi-bin">
  AllowOverride None
  Options None
  Order allow,deny
  Allow from all
</Directory>

Also, I inserted the following lines in http-vhosts.conf:

<VirtualHost 192.168.178:8080>
    DocumentRoot "C:/wamp/www/project"
</VirtualHost>

I've restarted everything and put the server Online but still get the same error.

Any help or suggestion would be appreciated.

Thank you in advance!


回答1:


I actually managed to solve my problem.

The port 8080 seemed to be causing problems (weird right). So I reinstalled wamp and only made the following changes in the httpd.conf (using port 8070):

Listen 192.168.178.3:8070

<Directory "cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

Also, I had to add an exception of this port in the Kaspersky firewall, as well as configuring the router to forward the port. That solved it.



来源:https://stackoverflow.com/questions/15413967/forbidden-error-when-accessing-wamp-from-local-network

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!