LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-26-2014, 03:53 AM   #1
lqmp
LQ Newbie
 
Registered: Nov 2013
Posts: 13

Rep: Reputation: Disabled
Apache Directory index forbidden


Hi all,

I'm having a problem with my Apache VirtualHosts... I can't get the Directory index to work.

The error is:
[Sun Jan 26 10:30:29 2014] [error] [client 192.168.0.1] Directory index forbidden by Options directive: /var/www/html/apache/

But when I check the configuration, it seems like everything is ok.

/etc/httpd/conf.d/vhost-apache.conf:
Code:
<VirtualHost *:80>
        ServerAdmin noc@xxx.com
        DocumentRoot /var/www/html/apache
        ServerName apache.xxx.xxx.com
        ErrorLog /var/log/httpd/apache.xxx.xxx.com-error_log
        CustomLog /var/log/httpd/apache.xxx.xxx.com-access_log common
</VirtualHost>

<Directory "/var/www/html/apache">
        IndexOptions FancyIndexing NameWidth=* FoldersFirst ScanHTMLTitles DescriptionWidth=*
        HeaderName HEADER.html
        ReadmeName README.html
        AllowOverride FileInfo Indexes
        Options +Indexes SymLinksIfOwnerMatch FollowSymLinks
        ErrorDocument 404 default
</Directory>
In the main httpd.conf is no entry available which says "-Indexes"..:
Code:
[root@xxx httpd]# grep -i "indexes" /etc/httpd/conf/httpd.conf
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    Options Indexes FollowSymLinks
#    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Options Indexes MultiViews FollowSymLinks
# server-generated indexes.  These are only displayed for FancyIndexed
# directory indexes.
Anybody with a clue on this one?
 
Old 01-26-2014, 09:42 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,761

Rep: Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587Reputation: 1587
Quote:
Options +Indexes SymLinksIfOwnerMatch FollowSymLinks
The above is not correct. If you use + for one option, you have to use + or - also for the others. Or use just:
Code:
Options Indexes SymLinksIfOwnerMatch FollowSymLinks
Regards
 
Old 01-26-2014, 10:03 AM   #3
lqmp
LQ Newbie
 
Registered: Nov 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Unfortunatly that does not solve the problem.

I removed the +, but I still get the same error:
Code:
[root@mirror apache]# grep -iR 'Indexes' /etc/httpd/*
/etc/httpd/conf/httpd.conf:#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
/etc/httpd/conf/httpd.conf:    Options Indexes FollowSymLinks
/etc/httpd/conf/httpd.conf:#    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
/etc/httpd/conf/httpd.conf:    Options Indexes MultiViews FollowSymLinks
/etc/httpd/conf/httpd.conf:# server-generated indexes.  These are only displayed for FancyIndexed
/etc/httpd/conf/httpd.conf:# directory indexes.
/etc/httpd/conf.d/welcome.conf:    Options -Indexes
/etc/httpd/conf.d/vhost-apache.conf:        AllowOverride FileInfo Indexes
/etc/httpd/conf.d/vhost-apache.conf:        Options Indexes SymLinksIfOwnerMatch FollowSymLinks
Code:
[Sun Jan 26 17:03:05 2014] [error] [client 192.168.0.1] Directory index forbidden by Options directive: /var/www/html/apache/
 
Old 01-26-2014, 10:05 AM   #4
lqmp
LQ Newbie
 
Registered: Nov 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
When I looked at my post above I saw the problem... I forgot to remove the welcome.conf...
Now, with the lines in welcome.conf commented everything works as it should be!

Thank you for pointing me in the right direction.
 
Old 07-28-2015, 08:33 PM   #5
mijohnst
Member
 
Registered: Nov 2003
Location: Huntsville, AL
Distribution: RHEL, Solaris, OSX, SuSE
Posts: 419

Rep: Reputation: 31
Thank you! Solved my issue off this thread.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
URGENT: Apache Server: Directory index forbidden by rule: /aa/www/default/docs/ rrose Linux - Software 1 03-10-2008 08:41 PM
Apache 2 Directory index forbidden by rule augustinemak Linux - Server 1 07-26-2007 06:03 AM
Apache - Directory index forbidden Phaethar Linux - Software 1 01-26-2006 07:49 AM
Virtual Hosts/Directory Index Forbidden by Rule Alan Powell Linux - Newbie 4 04-26-2004 06:35 AM


All times are GMT -5. The time now is 08:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration