# SOLVED Apache ( client denied by server configuration )

## lonebird

Please somebody help me! I noob here and this is my first Gentoo setup.

I am installed apache 2.2.8 and i cant to open any page - always happens error 403.

logs told: client denied by server configuration. I am just read thousands of posts here and tryed different solutions and it did not helped me.

Please look at my config files:

httpd.conf

```

ServerRoot "/usr/lib/apache2"

LoadModule actions_module modules/mod_actions.so

LoadModule alias_module modules/mod_alias.so

....(all nessesary modules)

LoadModule usertrack_module modules/mod_usertrack.so

LoadModule vhost_alias_module modules/mod_vhost_alias.so

User apache

Group apache

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

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

# vim: ts=4 filetype=apache

Listen                  *:80

ServerName              mysite

ServerAdmin             webmaster

ServerRoot              "/usr/lib/apache2"

LockFile                "/var/run/apache2.lock"

PidFile                 "/var/run/apache2.pid"

Timeout                 100

KeepAlive               On

MaxKeepAliveRequests    64

KeepAliveTimeout        15

<IfModule mod_mime.c>

TypesConfig /etc/mime.types

DefaultType text/plain

</IfModule>

<IfModule mod_mime_magic.c>

 MIMEMagicFile /etc/apache2/magic

</IfModule>

# =================================================

# Logs

# =================================================

LogLevel warn

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

CustomLog logs/access_log combined

ErrorLog logs/error_log

# =================================================

# Charset options

# =================================================

AddDefaultCharset WINDOWS-1251

```

00_default_vhost.conf

```

<IfDefine DEFAULT_VHOST>

NameVirtualHost *:80

<VirtualHost *:80>

ServerName  mysite.net

ServerAlias www.mysite.net

#Include /etc/apache2/vhosts.d/default_vhost.include

#<IfModule mpm_peruser_module>

#    ServerEnvironment apache apache

#</IfModule>

DocumentRoot "/home/webmaster/www/mysite.net"

ScriptAlias /cgi/ "/home/webmaster/cgi/"

#ScriptAlias /cgi-bin/ "/home/webmaster/cgi/"

ErrorLog /var/log/apache2/mysite.net_errors.log

CustomLog /var/log/apache2/mysite.net_custom.log combined

</VirtualHost>

</IfDefine>

```

```

# /etc/conf.d/apache2: config file for /etc/init.d/apache2

APACHE2_OPTS="-D USERDIR -D DEFAULT_VHOST -D SSL_DEFAULT_VHOST -D SSL -D INFO -D LANGUAGE -D PHP5"

KEEPENV="PATH"

```

default_vhost.include

```

DocumentRoot "/var/www/localhost/htdocs"

# This should be changed to whatever you set DocumentRoot to.

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

   Options Indexes FollowSymLinks

   AllowOverride All

   # Controls who can get stuff from this server.

   Order allow,deny

   Allow from all

</Directory>

<IfModule alias_module>

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

</IfModule>

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

   AllowOverride None

   Options None

   Order allow,deny

   Allow from all

</Directory>

```

All portages updated. I have installed all nesessary modules and libs + apache-tools same version. htaccess not using. I am reemerged it all several times. I did not changed any permissions in directorys. I lost for it more than 3 days and I really dunno what else I can do ..   :Sad:  Hope that you can help me. Thanks.Last edited by lonebird on Wed Feb 27, 2008 1:06 pm; edited 2 times in total

----------

## oldnavy23

 *Quote:*   

> <VirtualHost *:80>
> 
> ServerName  mysite.net
> 
> ServerAlias www.mysite.net

 

to me this looks incomplete 

mine looks like so 

<VirtualHost *:80>

    ServerAdmin me@mysite

   DocumentRoot /var/www/localhost/htdocs/squirrelmail

    ServerName mail.mysite.com

</VirtualHost>

and if you did /etc/init.d/apache start  is there any errors that come back or anything ?[/quote]

----------

## lonebird

oldnavy23 thanks, I am tryed your solution, but it did not resolve problem. May be I have something wrong with permissions for directories?

For files - 755, dir - 644. Owner - my user.

----------

## lonebird

is somebody here? please give me some solution ..

----------

## lonebird

I am trying to change directive:

```

<Directory "/home/webmaster/www/">

        AllowOverride None

        Order Deny,Allow

<Directory>

```

and

```

<directory "/home/webmaster/www/">

allow from all

<directory>

```

but it does not help me ..   :Sad: 

----------

## lonebird

my var/log/apache2

```

[Wed Feb 27 14:15:20 2008] [notice] Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.8g configured -- resuming normal operations

[Wed Feb 27 14:15:20 2008] [alert] (12)Cannot allocate memory: apr_thread_create: unable to create worker thread

[Wed Feb 27 14:15:20 2008] [alert] (12)Cannot allocate memory: apr_thread_create: unable to create worker thread

[Wed Feb 27 14:15:22 2008] [alert] No active workers found... Apache is exiting!

[Wed Feb 27 14:15:30 2008] [warn] pid file /var/run/apache2.pid overwritten -- Unclean shutdown of previous Apache run?

[Wed Feb 27 14:15:30 2008] [notice] Apache/2.2.8 (Unix) configured -- resuming normal operations

[Wed Feb 27 14:15:30 2008] [alert] (12)Cannot allocate memory: apr_thread_create: unable to create worker thread

[Wed Feb 27 14:15:34 2008] [error] [client 89.110.1.221] client denied by server configuration: /usr/htdocs

[Wed Feb 27 14:15:34 2008] [error] [client 89.110.1.221] client denied by server configuration: /usr/htdocs

[Wed Feb 27 14:15:35 2008] [alert] (12)Cannot allocate memory: apr_thread_create: unable to create worker thread

[Wed Feb 27 14:15:35 2008] [error] [client 89.110.1.221] client denied by server configuration: /usr/htdocs

[Wed Feb 27 14:15:35 2008] [error] [client 89.110.1.221] client denied by server configuration: /usr/htdocs

[Wed Feb 27 14:15:37 2008] [alert] (12)Cannot allocate memory: apr_thread_create: unable to create worker thread

[Wed Feb 27 14:15:39 2008] [alert] (12)Cannot allocate memory: apr_thread_create: unable to create worker thread

[Wed Feb 27 14:15:41 2008] [alert] (12)Cannot allocate memory: apr_thread_create: unable to create worker thread

[Wed Feb 27 14:15:43 2008] [alert] (12)Cannot allocate memory: apr_thread_create: unable to create worker thread

[Wed Feb 27 14:15:45 2008] [alert] (12)Cannot allocate memory: apr_thread_create: unable to create worker thread

[Wed Feb 27 14:15:47 2008] [alert] (12)Cannot allocate memory: apr_thread_create: unable to create worker thread

[Wed Feb 27 14:15:49 2008] [alert] (12)Cannot allocate memory: apr_thread_create: unable to create worker thread

```

----------

## lonebird

I have some mistakes in my vhosts.conf. Now I fixed it. Thanks.   :Very Happy: 

----------

