# apache: client denied by server configuration: /var/www

## brianahr

I set up apache, with /var/www/localhost/htdocs as the document root. It is chrooted into /var/www/localhost. Apache works fine to access /index.html on the server (which is physically /var/www/localhost/htdocs/index.html) but doesnt like accessing /misc/ on the server - id like to have Indexes enabled for that directory. The following appears in the apache error log every time someone tries to make a request to /misc/. However, note that even though these errors occur in the logs, /misc/ is still viewable via http. (ie, it works as required, but how do i eliminate these errors?)

```
[Fri Jun 16 14:23:12 2006] [error] [client 192.168.1.101] client denied by server configuration: /var/www, referer: http://192.168.1.100:8000/misc/

[Fri Jun 16 14:23:12 2006] [error] [client 192.168.1.101] client denied by server configuration: /var/www, referer: http://192.168.1.100:8000/misc/

[Fri Jun 16 14:23:12 2006] [error] [client 192.168.1.101] client denied by server configuration: /var/www, referer: http://192.168.1.100:8000/misc/

[Fri Jun 16 14:23:12 2006] [error] [client 192.168.1.101] client denied by server configuration: /var/www, referer: http://192.168.1.100:8000/misc/

```

heres the relevant sections of httpd.conf

```
DocumentRoot "/htdocs"

....

....

<Directory />

        Options -All -Multiviews FollowSymLinks

    AllowOverride Limit AuthConfig FileInfo Options

        <IfModule mod_access.c>

          Order deny,allow

          Deny from all

        </IfModule>

</Directory>

<Directory /htdocs>

        Options -MultiViews SymLinksIfOwnerMatch -Indexes

    AllowOverride Indexes FileInfo AuthConfig Limit Options

        <Limit GET POST OPTIONS>

    Order allow,deny

    Allow from all

        </Limit>

        <LimitExcept GET POST OPTIONS>

        Order deny,allow

        Deny from all

        </LimitExcept>

</Directory>

```

and /var/www/localhost/htdocs/misc/.htaccess

```
Options +Indexes
```

----------

## bunder

folder permissions?  do this to your htdocs dir:

chown root:apache htdocs

chmod -R a-rwx htdocs # clears all permissions

chmod -R u+rwx htdocs # re-establishes root permissions (although root can do anything anyways)

chmod -R g+rx htdocs # so files are readable by apache

chmod g+s htdocs # this is the real important one, as it will ensure anything written in the directory from now on will always be readable by apache unless denied by .htaccess

----------

## dev-urandom

What is the directory block for /var/www ? Are you sure that you have an 

```
Allow from all
```

defined for it?

----------

