# apache forbidden error

## matttah

I have "Alias /name /var/www/locahost/name/web" in my vhost default config, then i also have <Directory /var/www/locahost/name/web/>Allow from all AllowOverride All</Directory> but i'm getting a permission denied when i go to http://server/name.

"client denied by server configuration : /var/www/locahost".  Any ideas on how to go about fixing this?

Daum

----------

## Justmyself

If you are sure it's not modsecurity, you can search in 00_default_vhost.conf.

And look to VirtualHost

And in default_vhost.include you have to add FollowSymLinks between Directory  /Directory

----------

## thecooptoo

permissions (user and group) of the directory to are trying to access ?

----------

## reup

I just encounter the issue and as I was lucky to find a solution, I will tell you what did it for me :

/etc/apache2/modules.d/00_default_settings.conf has the config for the default host and some setting was preventing the access

I just rename the file and restarted apache

now, I am sure that there is a better solution than that (opening the file and changing the offending option) but I am very tired of this battle with all the apache's option, so I hope that some guru will explain a bit more here

reup

----------

## tgR10

i got couple of www on my servers and i'm doing it like taht

im making new vhost.conf file (/etc/apache2/vhost.d/).. then i put osmething like this in it

```
<VirtualHost *:80>

    ServerName my.web.adres.com

    ServerAlias http://my.web.adres.com

    ServerAlias www.my.web.adres.com

    ServerAlias http://www.my.web.adres.com

    DocumentRoot "/path/to/web/page"

    <Directory "/path/to/web/page/">

        Options Indexes FollowSymLinks

        AllowOverride All

        Order allow,deny

        Allow from all

    </Directory>

        ErrorLog /var/log/apache2/error-webpagename.log

        CustomLog /var/log/apache2/access-webpagename.log combined

</VirtualHost>
```

and i think this is the simplest way to do it

you can do it mroe secure like -Indexes etc ...

i'm doing each host in seperate file so it's easier to me to find problems :)

then i just run /etc/init.d/apache2 reload

----------

## jmz2

 *tgR10 wrote:*   

> 
> 
> ```
> <VirtualHost *:80>
> 
> ...

 

http:// doesn't belong to ServerAlias. ServerAlias is just a domain name.

----------

