LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Apache Directory index forbidden (https://www.linuxquestions.org/questions/linux-newbie-8/apache-directory-index-forbidden-4175492597/)

lqmp 01-26-2014 03:53 AM

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?

bathory 01-26-2014 09:42 AM

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

lqmp 01-26-2014 10:03 AM

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/

lqmp 01-26-2014 10:05 AM

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. :)

mijohnst 07-28-2015 08:33 PM

Thank you! Solved my issue off this thread.


All times are GMT -5. The time now is 03:07 AM.