# [Solved] Apache - client denied by server configuration

## Frustie

Morning,

Im really puzzled here, so ill try to be as informous as i possibly can  :Smile: 

Last night after some upgrading i noticed that apache was blocking every site i had.

The first error was that i received a page forbidden :

```
Forbidden

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

-------------------------------------------------------------
```

The error in error_log is :

```
[Wed Sep 05 09:32:53 2007] [error] [client xx.xxx.xx.x] client denied by server configuration: /sites/xxxxxx.xxx/HTML/
```

After browsing around i noticed that i had to add a directory statement to every vhost.d/<name>.conf which i did :

```
<VirtualHost xxx.xxx.xxx.xxx>

ServerName xxxx.xxx

ServerAlias *.xxxx.xxx

DocumentRoot /sites/xxxx.xxx/HTML

CustomLog /sites/stats.grmbl.nl/logs/xxxx.xxx.access.rlog combined

RewriteEngine on

RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)

RewriteRule .* - [F] Microsoft Internet Information Services (IIS)

<directory /sites/xxxx.xxx/HTML>

         Options -Indexes

          AllowOverride None

          Order allow,deny

          Allow from all

</directory>

</VirtualHost>
```

My site came back online, but now it didnt ask me for my credentials, nor does it seem to use rewriting on url's

My httpd.conf

```
ServerRoot "/usr/lib/apache2"

Listen 80

LoadModule actions_module modules/mod_actions.so

LoadModule alias_module modules/mod_alias.so

LoadModule auth_basic_module modules/mod_auth_basic.so

LoadModule auth_digest_module modules/mod_auth_digest.so

LoadModule authn_anon_module modules/mod_authn_anon.so

LoadModule authn_dbd_module modules/mod_authn_dbd.so

LoadModule authn_dbm_module modules/mod_authn_dbm.so

LoadModule authn_default_module modules/mod_authn_default.so

LoadModule authn_file_module modules/mod_authn_file.so

LoadModule authz_dbm_module modules/mod_authz_dbm.so

LoadModule authz_default_module modules/mod_authz_default.so

LoadModule authz_groupfile_module modules/mod_authz_groupfile.so

LoadModule authz_host_module modules/mod_authz_host.so

LoadModule authz_owner_module modules/mod_authz_owner.so

LoadModule authz_user_module modules/mod_authz_user.so

LoadModule autoindex_module modules/mod_autoindex.so

LoadModule cache_module modules/mod_cache.so

LoadModule cgi_module modules/mod_cgi.so

LoadModule cgid_module modules/mod_cgid.so

LoadModule dav_module modules/mod_dav.so

LoadModule dav_fs_module modules/mod_dav_fs.so

LoadModule dav_lock_module modules/mod_dav_lock.so

LoadModule dbd_module modules/mod_dbd.so

LoadModule deflate_module modules/mod_deflate.so

LoadModule dir_module modules/mod_dir.so

LoadModule disk_cache_module modules/mod_disk_cache.so

LoadModule env_module modules/mod_env.so

LoadModule expires_module modules/mod_expires.so

LoadModule ext_filter_module modules/mod_ext_filter.so

LoadModule file_cache_module modules/mod_file_cache.so

LoadModule filter_module modules/mod_filter.so

LoadModule headers_module modules/mod_headers.so

LoadModule ident_module modules/mod_ident.so

LoadModule imagemap_module modules/mod_imagemap.so

LoadModule include_module modules/mod_include.so

<IfDefine INFO>

LoadModule info_module modules/mod_info.so

</IfDefine>

LoadModule log_config_module modules/mod_log_config.so

LoadModule logio_module modules/mod_logio.so

LoadModule mem_cache_module modules/mod_mem_cache.so

LoadModule mime_module modules/mod_mime.so

LoadModule mime_magic_module modules/mod_mime_magic.so

LoadModule negotiation_module modules/mod_negotiation.so

<IfDefine PROXY>

LoadModule proxy_module modules/mod_proxy.so

</IfDefine>

<IfDefine PROXY>

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

</IfDefine>

<IfDefine PROXY>

LoadModule proxy_balancer_module modules/mod_proxy_balancer.so

</IfDefine>

<IfDefine PROXY>

LoadModule proxy_connect_module modules/mod_proxy_connect.so

</IfDefine>

<IfDefine PROXY>

LoadModule proxy_http_module modules/mod_proxy_http.so

</IfDefine>

LoadModule rewrite_module modules/mod_rewrite.so

LoadModule setenvif_module modules/mod_setenvif.so

LoadModule speling_module modules/mod_speling.so

<IfDefine INFO>

LoadModule status_module modules/mod_status.so

</IfDefine>

LoadModule unique_id_module modules/mod_unique_id.so

<IfDefine USERDIR>

LoadModule userdir_module modules/mod_userdir.so

</IfDefine>

LoadModule usertrack_module modules/mod_usertrack.so

LoadModule vhost_alias_module modules/mod_vhost_alias.so

<IfDefine SSL>

LoadModule ssl_module modules/mod_ssl.so

</IfDefine>

User apache

Group apache

ServerAdmin root@localhost

DocumentRoot "/var/www/localhost/htdocs"

<Directory />

    Options FollowSymLinks -Indexes ExecCGI

    AllowOverride All

</Directory>

<Directory "/var/www/localhost/htdocs">

        Options -Indexes FollowSymLinks

        AllowOverride All

        Order allow,deny

</Directory>

<IfModule dir_module>

        DirectoryIndex index.html index.html.var index.htm index.pl index.php index.cgi

</IfModule>

<FilesMatch "^\.ht">

        Order allow,deny

        Deny from all

</FilesMatch>

ErrorLog /var/log/apache2/error_log

LogLevel warn

<IfModule log_config_module>

        LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

        LogFormat "%h %l %u %t \"%r\" %>s %b" common

        LogFormat "%{Referer}i -> %U" referer

        LogFormat "%{User-Agent}i" agent

        LogFormat "%v %h %l %u %t \"%r\" %>s %b %T" script

        LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i VLOG=${VLOG}e" vhost

        <IfModule logio_module>

                LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

        </IfModule>

        CustomLog /var/log/apache2/access_log common

</IfModule>

<IfModule alias_module>

        ScriptAlias /cgi-bin/ "/var/www/localhost/cgi-bin/"

</IfModule>

<IfModule cgid_module>

</IfModule>

<Directory "/var/www/localhost/cgi-bin">

        AllowOverride None

        Options None

        Order allow,deny

        Allow from all

</Directory>

DefaultType text/plain

<IfModule mime_module>

        TypesConfig /etc/mime.types

        AddType application/x-compress .Z

        AddType application/x-gzip .gz .tgz

        AddHandler type-map var

</IfModule>

<IfModule mime_magic_module>

        MIMEMagicFile /etc/apache2/magic

</IfModule>

Include /etc/apache2/modules.d/*.conf

Include /etc/apache2/vhosts.d/*.conf

```

Running version :  Apache/2.2.4 (Unix) DAV/2 PHP/5.2.3-pl3-gentoo

If you need any more information, please, feel free to ask  :Smile: Last edited by Frustie on Wed Sep 05, 2007 9:50 am; edited 1 time in total

----------

## Rob1n

 *Frustie wrote:*   

> My site came back online, but now it didnt ask me for my credentials, nor does it seem to use rewriting on url's

 

I don't see any reason why it would ask for credentials - there's no authentication settings in the files you've posted at all.  As for the rewriting, how are you testing this?

----------

## Frustie

ah, sorry, i guess i was still sleepy, in the HTML dir i have a .htaccess file

```
AuthUserFile /sites/xxxx.xxx/.htpasswd

AuthGroupFile /dev/null

AuthName 'Admin only'

AuthType Basic

<limit GET>

require user xxxx

</Limit>
```

and it just isnt loaded , as for the rewriting, im using wordpress which uses this to make url's all fancy

----------

## Rob1n

 *Frustie wrote:*   

> ah, sorry, i guess i was still sleepy, in the HTML dir i have a .htaccess file

 

And in the config you have the line:

 *Quote:*   

> AllowOverride None

 

which will prevent any .htaccess options from being read.  You need to use:

```
AllowOverride All
```

 *Quote:*   

> as for the rewriting, im using wordpress which uses this to make url's all fancy

 

The only rewriting I can see in the posted config is denying any TRACE/TRACK requests.

----------

## Moreaulf

You stated this in your VirtualHost config:

```
<directory /sites/xxxx.xxx/HTML>

         Options -Indexes

          AllowOverride None

          Order allow,deny

          Allow from all

</directory>
```

Your AllowOverride None would make your .htaccess useless, so if it's in the /sites/xxxx.xxx/HTML Directory you should allow .htaccess files and the credentials popup should be back.

/Thomas

----------

## Frustie

thanks, after adjusting the vhost.d/<name>.conf to read 

```
<VirtualHost xxx.xx.xx.xx>

ServerName xxxx.xxx

ServerAlias *.xxxx.xxx

DocumentRoot /sites/xxxx.xxx/HTML

CustomLog /sites/stats.grmbl.nl/logs/xxxx.xxx.access.rlog combined

RewriteEngine on

RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)

RewriteRule .* - [F] Microsoft Internet Information Services (IIS)

<directory /sites/xxxx.xxx/HTML>

         Options -Indexes

          AllowOverride All

          Order allow,deny

          Allow from all

</directory>

</VirtualHost>
```

the .htaccess works  :Smile: 

as for the wordpress thingy, ill have to look into that seperatly, every other site works now so i think the problem exists elsewhere

thanks for helping  :Smile: 

Riccardo

----------

