Apache Permission in Windows 7

2

I installed Apache (version 2.2.25) on Windows 7 and changed the default folder from DocumentRoot to c:\tmp .

I made the following change in the file httpd.conf :

#DocumentRoot "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs"
DocumentRoot "C:/tmp"

After this change I restarted the computer and tried to access the folder through the browser.

  

Forbidden
  You do not have permission to access this server.

How do I solve this problem?

    
asked by anonymous 11.04.2014 / 01:03

1 answer

2

In the file httpd.conf look for the following entry:

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all          # linha padrão, geralmente causa do problema
</Directory>

Switch the line in question to:

Allow from all

This will make apache accessible to all machines on your network (and out if your router is doing port fowarding ). If you want to restrict local access only use:

Deny from all 
Allow from 127.0.0.1

Another important point is user permissions as per Bacco's comments. In addition to the permissions of the folder it is good to check the Log On user of the service at:

services.msc -> Apache -> (Duplo Clique) -> Aba Log On

By default this should be a local system user. In this case it is recommended that httd.conf contain the settings:

User daemon
Group daemon

P.S. Of course this is not the best setup in terms of security. It is recommended that you create a non-administrator dedicated server user (eg, apache ), grant that user privileges so that he can log in as a service and act as part of the operating system (in secpol.msc ) and grant access permissions conscious way only for the necessary folders.

Fonts :

11.04.2014 / 05:24