Apache 2.2 client denied by server configuration

Setting up and starting apache 2.2 went smoothly. The first hiccup occured when a virtual host was added. The site cannot be browsed. The log file says:

client denied by server configuration

Kind of like the problem that I ran into with the 2.0.54 installation

(13)Permission denied: access to /index.php denied

I thought it would be a user/group problem. Apache 2 had a wierd group set by default (#-1). With 2.2 it’s not so wierd but a more orthodox ‘daemon’. Why it wasn’t set to nobody as it used to be with 1.3 is a mystery. Changing it to nobody didn’t solve the problem.

Digging deeper, I found the problem in is actually in the root directory configuration section. In 2.0 it’s

<Directory >
Options FollowSymLinks
AllowOverride None

In 2.20 it’s

Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all

The added bit of extra security in 2.20 causes the docroot for the vhost to be inaccessible. Just commenting out the access configuration stuff does the trick. A better solution is to add the following with the in the vhost block.

Order deny,allow
Deny from all
Dec 12th, 2005 | Posted in Apache
  1. Manuel
    Nov 11th, 2009 at 01:07 | #1

    I was looking for a solution for weeks…

  2. George
    Nov 12th, 2009 at 08:48 | #2

    Ditto! It was right there in front of me the whole time. Thanks for pointing it out!

  3. matt
    Nov 13th, 2009 at 19:36 | #3

    Thank You for this tip

  4. Dec 9th, 2009 at 04:32 | #4

    Great stuff, man. Always nice to see the work of a peer. You should add buttons to the bottom of your posts to digg, stumble, etc your content.-Tom

    • admin
      Dec 9th, 2009 at 14:17 | #5

      you can do that with the share this button

  5. santosh
    Jan 7th, 2010 at 20:35 | #6

    hi ,
    i am trying to restrict my website to domain i have written below code in access.conf of apache…

    Order deny,allow
    Deny from all
    Allow from ipmcghana.com

    but i am getting error in error log file ,
    client denied by server configuration: /forms/frmservlet

    what can be the problem
    please guide me ….
    thank you

  6. Mark
    Feb 14th, 2010 at 00:12 | #7

    I think there is a cut and paste error for the vhost example. In the vhost directory block use “Allow from all” rather than “Deny from all”:

    Order Deny,Allow
    Allow from all

  7. Al Cap
    Jul 2nd, 2010 at 08:36 | #8

    I have Apache 2.2 and I’m trying to block access to this ip address – How do I set up the httpd configuration? This is what I have now:

    # Possible values for the Options directive are “None”, “All”,
    # or any combination of:
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    # Note that “MultiViews” must be named *explicitly* — “Options All”
    # doesn’t give it to you.
    # The Options directive is both complicated and important. Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    Options Indexes FollowSymLinks

    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be “All”, “None”, or any combination of the keywords:
    # Options FileInfo AuthConfig Limit
    AllowOverride None

    # Controls who can get stuff from this server.
    Order allow,deny
    Allow from all

    • admin
      Jul 2nd, 2010 at 16:31 | #9

      Order allow, deny
      Allow from all
      Deny from

  8. eh
    Sep 2nd, 2010 at 08:11 | #10

    Right, but your post has Order reversed. Either that or it’s for an example not described.

  9. Lakshmi
    Oct 4th, 2010 at 18:06 | #11

    Thanku so much……..

  10. Mahi
    Nov 26th, 2010 at 23:01 | #12

    Thanks a lot

  11. Ben
    Feb 15th, 2011 at 23:35 | #13

    Add something like that with the path of the vhost

    Order allow,deny
    Allow from all

  12. KJ
    Mar 26th, 2011 at 15:28 | #14

    Thanks, you pulled me out of a deep ditch!

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>