4

I am currently getting a locally hosted website up and running, but have encountered problems in accessing it from the host computer and other computers, as well. I have already created exceptions in the firewall and forwarded port connections. I have created a .htaccess file with the proper code, and edited all other files to allow the connection. When I use the URL of the website on the local host, it works, which is to be expected. However, when I use my IP address on any computer, I receive the following error (the IP address was X-ed out by me for privacy):

Forbidden
You don't have permission to access / on this server.
Apache/2.4.9 (Win64) PHP/5.5.12 Server at XXX.XXX.X.XX Port 80

I have done more than enough research, and believe that Apache might not have permission to access the directory of the website. I am using a WAMP server that is updated completely as of 7/5/2015. Any help getting this site up and running would be appreciated. If you would like more information, just leave a comment and I will edit this post with whatever you need. Thanks!

2
  • Start by turning up the logging, and it should say which policy is preventing the access.
    – simpleuser
    Commented Jul 6, 2015 at 0:56
  • Since it otherwise works on the local host, check your Listen directive. Look for allow/deny directives that limit it to 127.0.0.1, especially on the Location directive for the root directory.
    – simpleuser
    Commented Jul 6, 2015 at 1:00

2 Answers 2

2

The usual reason I've seen for this problem is that you create the files so they are owned by you (the user that you are logged in as). You can access the files locally because you own them. When you try to access them remotely, they are accessed by user "apache" or whatever user your web server runs as. Change the permissions so that the web server can access the files.

2
  • Sorry, if this seems simple to you, but how does one do what you said on a Windows 8.1 computer?
    – Sam K
    Commented Jul 6, 2015 at 19:59
  • 1
    Task Manager has a user name column to tell you what the apache process runs as. File properties has a security tab which tells you the owner and allows you to edit permissions.
    – stark
    Commented Jul 7, 2015 at 17:03
1

Probably you have project moved from apache-2.2 to apache-2.4. Since v2.2 some changes have been introduced to the config files syntax, especially with access definitions. While apache before 2.4 have had the next syntax

Order allow,deny
Allow from all

the 2.4+ versions have the next syntax

Require all granted

Please read carefully notices about upgrading from 2.2 to 2.4

http://httpd.apache.org/docs/2.4/upgrading.html

2
  • Unfortunately, this is not the case. I had already done so, and it did not solve the problem. I appreciate your time, though!
    – Sam K
    Commented Jul 6, 2015 at 14:01
  • This was the case for me thank you!
    – BrianBlaze
    Commented Nov 29, 2023 at 17:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .