Results 1 to 8 of 8
  1. #1
    Joined
    Dec 2003
    Location
    Orlando, FL
    Age
    40
    Posts
    3,062

    Permission Denied For Apache Directory (CENTOS)

    So I created a directory under my document root of Apache on CENTOS / RHEL server. Currently the document root is "/var/www/bugzilla".

    Now when point my browser to that machines IP, it loads the Bugzilla main page fine.This machine is a Bugzilla server I created for my dept. however they also require a phpbb3 forums on here. I can install that no problem with my eyes closed except I run into a small problem. Since my document root is not /var/www/ I then need to create a folder in the /var/www/bugzilla directory and when I mkdir in there, I get permission denied to access this on my web browser

    Code:
    [root@godzilla www]# ls -la
    total 3640
    drwxr-xr-x  7 root root      4096 Feb  8 13:52 .
    drwxr-xr-x 23 root root      4096 Feb  6 16:06 ..
    drwxr-x--- 14 root apache    4096 Feb 11 08:58 bugzilla
    drwxr-xr-x  2 root root      4096 Jan 11 08:22 cgi-bin
    drwxr-xr-x  3 root root      4096 Feb  5 15:57 error
    drwxr-xr-x  2 root root      4096 Jan 11 08:22 html
    drwxr-xr-x  3 root root      4096 Feb  8 13:11 icons
    -rw-r--r--  1 root root   1461327 Dec 13 09:00 phpBB-3.0.0.tar.bz2
    [root@godzilla www]# mkdir bugzilla/forums
    [root@godzilla www]# cd bugzilla
    [root@godzilla bugzilla]# ls -la
    Above you can see the directory that Apache is pointing to as the document root fine. I have no problems getting to the page via my browser but then when I create a sub-dir in that document root, I am unable to get to it via Firefox w/o a permissions denied error.

    Code:
    [root@godzilla www]# mkdir bugzilla/forums
    [root@godzilla www]# cd bugzilla
    [root@godzilla bugzilla]# ls -la
    total 1408
    drwxr-xr-x  2 root root    4096 Feb 11 08:59 forums
    I simply get:

    "Forbidden

    You don't have permission to access /forums/ on this server.
    Apache/2.2.3 (Red Hat) Server at 10.1.1.12 Port 80"


    Any thoughts? How can I perhaps place the forums directory in /var/www/html/ and have people go to http://10.1.1.100/forums andhave that point to /var/www/html/forums w/o editing the document root from /var/www/bugzilla?
    ./

  2. #2
    Joined
    Jan 2003
    Location
    Sweden
    Posts
    1,618

    Re: Permission Denied For Apache Directory (CENTOS)

    Give the 'apache' group a share (pun intended) of the 'forums' folder?

  3. #3
    Joined
    Dec 2003
    Location
    Orlando, FL
    Age
    40
    Posts
    3,062

    Re: Permission Denied For Apache Directory (CENTOS)

    So just do the following?

    Code:
    [root@godzilla bugzilla]# chown root:apache forums/
    [root@godzilla bugzilla]# ls -l
    drwxr-xr-x  2 root apache  4096 Feb 11 08:59 forums
    I reloaded Apache / HTTPD and still the same error.
    Last edited by Carlwill; 02-11-2008 at 12:04 PM.
    ./

  4. #4
    Joined
    Sep 2008
    Posts
    1

    Re: Permission Denied For Apache Directory (CENTOS)

    Are you sure bugzilla folder permissions are OK? Can you access any other folder within it?

  5. #5
    Joined
    Dec 2000
    Location
    Out there, just read my posts
    Posts
    5,473

    Re: Permission Denied For Apache Directory (CENTOS)

    hmmmm..on my Cent0S 5.2 Apache server I have root root with drwxr-xr-x on html (doc root) as below, not root apache as your doc root is.

    Code:
    drwxr-xr-x  8 root      root 4096 Mar 16 23:15 .
    drwxr-xr-x 29 root      root 4096 Aug  6 14:31 ..
    drwxr-xr-x  2 root      root 4096 Jan 15  2008 cgi-bin
    drwxr-xr-x  3 root      root 4096 Jan 17  2008 error
    drwxr-xr-x  2 root      root 4096 Aug 10 12:55 html
    drwxr-xr-x  3 root      root 4096 Jul  3 23:30 icons
    drwxr-xr-x 14 root      root 4096 Jan 17  2008 manual
    drwxr-xr-x  2 webalizer root 4096 Sep  2 04:02 usage
    Last edited by Jackal; 09-07-2008 at 09:12 AM.

  6. #6
    Joined
    Dec 2000
    Location
    Out there, just read my posts
    Posts
    5,473

    Re: Permission Denied For Apache Directory (CENTOS)

    and then I did this:

    Code:
    [root@thebeast www]# cd html
    [root@thebeast html]# mkdir test
    [root@thebeast html]# ls
    index.php  test
    [root@thebeast html]# ls -la
    total 24
    drwxr-xr-x 3 root root 4096 Sep  7 06:57 .
    drwxr-xr-x 8 root root 4096 Mar 16 23:15 ..
    -rw-r--r-- 1 root root  121 Mar 16 23:16 index.php
    drwxr-xr-x 2 root root 4096 Sep  7 06:57 test
    [root@thebeast html]#
    and I get this in the browser:

    Index of /test
    [ICO] Name Last modified Size Description
    [DIR] Parent Directory -
    Apache/2.2.3 (CentOS) Server at localhost Port 443

  7. #7
    Joined
    Dec 2000
    Location
    Out there, just read my posts
    Posts
    5,473

    Re: Permission Denied For Apache Directory (CENTOS)

    I'm just guessing, but if you changed the doc root in httpd.conf, and then did a chown on that folder - Apache (user) doesn't have the ability to grant the webuser sufficient privileges to browse.

  8. #8
    Joined
    Dec 2000
    Location
    Out there, just read my posts
    Posts
    5,473

    Re: Permission Denied For Apache Directory (CENTOS)

    well that's interesting, I changed the document root in httpd.conf, created the new directory (as root), restarted httpd, pulled up the Apache "welcome page", created a subdirectory, and got 404 forbidden, copied my index.php from the old doc root, to that new directory that would not allow listing, and that page pulled up just fine.



    edit: Ahhhh Haaa!

    There are two places to change in httpd.conf for the document root:

    Code:
    DocumentRoot "/var/www/html"
    
    #
    # Each directory to which Apache has access can be configured with respect
    # to which services and features are allowed and/or disabled in that
    # directory (and its subdirectories).
    #
    # First, we configure the "default" to be a very restrictive set of
    # features.
    #
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    
    #
    # Note that from this point forward you must specifically allow
    # particular features to be enabled - so if something's not working as
    # you might expect, make sure that you have specifically enabled it
    # below.
    #
    
    #
    # This should be changed to whatever you set DocumentRoot to.
    #
    <Directory "/var/www/html">
    
    changing that second line, and restarting httpd, allowed me to browse that directory. Hope that helps!!
    Last edited by Jackal; 09-07-2008 at 10:00 AM. Reason: Ahhh haaa

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •