By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

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

The possible solution to a access problem after installing apache.

Edited: 2013-05-11 07:34

After installing the Apache HTTP Server on a system, you may be getting a error related to .htaccess files, telling you that you don't have permission to access "/" on the server. I.e.

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

Fixing it using htaccess

The problem may be due to a missing DirectoryIndex deceleration in either your Apache configuration, or in a .htaccess file in the directory you are trying to view. It is normal that the index is called index.html, but if you have changed this, then you should list the new file name'(s) that apache should look for – this is done in the DirectoryIndex of a .htaccess file. I.e.

DirectoryIndex index.php index.html

One advantage of using htaccess can be that you won't have to restart your server for the changes to take effect, Apache will automatically look for htaccess files in directories – this can be a performance problem on high-traffic sites.

If you list multiple index files, apache will first check for the existence of the first. I.e. .php, then the .html one.

Fixing it using the Apache vhost configuration

If you are not using htaccess files, the next best thing to do can be to use the vhost configuration, here you can place the same decleration as we mentioned for the htaccess file. I.e.

DirectoryIndex index.php

It is also possible to list multiple index files in your vhost configuration.

See also

  1. Location of Apache configuration files
  2. .htaccess Tutorial