Find the answer to your Linux question:
Results 1 to 10 of 10
With an index file, all works fine. With no index, an error. [date] [error] [client ip] Directory index forbidden by rule: /var/www/html/ DocumentRoot "/var/www/html" <Directory /> Options Indexes FollowSymLinks AllowOverride ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Banned
    Join Date
    Dec 2002
    Location
    Texas
    Posts
    242

    Apache: Directory index forbidden by rule


    With an index file, all works fine. With no index, an error.

    [date] [error] [client ip] Directory index forbidden by rule: /var/www/html/

    DocumentRoot "/var/www/html"
    <Directory />
    Options Indexes FollowSymLinks
    AllowOverride All
    </Directory>
    <Directory "/var/www/html">
    Options Indexes Includes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    AccessFileName .htaccess

    There's only the php.conf in the conf.d directory and it's not related.

    I'm not sure why the heck I cannot get this Apache to list the files?
    I have not had this problem on any other system in the past so far.

  2. #2
    Banned
    Join Date
    Dec 2002
    Location
    Texas
    Posts
    242
    # cat /etc/redhat-release
    CentOS release 4.8 (Final)

    # httpd -v
    Server version: Apache/2.0.52
    Server built: Nov 12 2009 06:54:45

  3. #3
    Just Joined!
    Join Date
    Mar 2010
    Location
    Grand Rapids, MI
    Posts
    15
    What's your DirectoryIndex line look like?

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Mar 2010
    Posts
    4

    :)

    You would need to edit /etc/httpd/conf.d/welcome.conf and change this :

    <LocationMatch "^/+$">
    Options -Indexes
    ErrorDocument 403 /error/noindex.html
    </LocationMatch>

    You would need to modify the line Options -Indexes, changing it to Options +Indexes

    After this has been done, restart Apache. I hope this is helpful.

  6. #5
    Banned
    Join Date
    Dec 2002
    Location
    Texas
    Posts
    242
    Quote Originally Posted by STanner View Post
    What's your DirectoryIndex line look like?
    DirectoryIndex index.php index.html index.html.var

    Although my issue is directory listing when I do NOT have an index file.

  7. #6
    Banned
    Join Date
    Dec 2002
    Location
    Texas
    Posts
    242
    Quote Originally Posted by Valkyrka View Post
    You would need to edit /etc/httpd/conf.d/welcome.conf
    That was a good idea, but I've already removed that file
    while I was going through all the configs looking for any
    Options or AllowOverrides that I could find to change.

  8. #7
    Just Joined!
    Join Date
    Mar 2010
    Posts
    4

    .htaccess

    Can you try to place a .htaccess file in /var/www/html with the following rule :

    Options +Indexes

    Does this fix the issue ?

  9. #8
    Banned
    Join Date
    Dec 2002
    Location
    Texas
    Posts
    242
    Quote Originally Posted by Valkyrka View Post
    Can you try to place a .htaccess file in /var/www/html with the following rule :

    Options +Indexes

    Does this fix the issue ?
    Negative. That does not work. This is really weird.

  10. #9
    Just Joined!
    Join Date
    Feb 2009
    Posts
    54
    The original configs you posted should show directory listing. Therefore a dumb question - are you positive that the httpd binary you are running is using the httpd.conf that you are editing?

  11. #10
    Banned
    Join Date
    Dec 2002
    Location
    Texas
    Posts
    242
    Quote Originally Posted by druidmatrix View Post
    The original configs you posted should show directory listing. Therefore a dumb question - are you positive that the httpd binary you are running is using the httpd.conf that you are editing?
    Not a dumb question, but I'm sure httpd is using this httpd.conf.
    There's some Alias directory stuff that I'm using in there, too, so
    I know that it's using this httpd.conf file.

Posting Permissions

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