0

I have 3 vhosts on a server, I want one of them to have directory listing enabled. This is the configuration file for it:

<VirtualHost *:80>
        ServerName me
        ServerAdmin me
        DocumentRoot /var/www/test.host.net
        <Directory "/var/www/test.host.net">
                Options All +Indexes
                AllowOverride all
        </Directory>
        #<Directory /var/www/>
        #        Options +Indexes FollowSymLinks MultiViews
        #        AllowOverride all
        #        Order allow,deny
        #        allow from all
        #</Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                AddHandler cgi-script .cgi
                Order deny,allow
                Deny from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/errors_from_this_host.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel debug

        CustomLog ${APACHE_LOG_DIR}/access_to_this_host.log combined
</VirtualHost>

The file does have directory handling for /var/www/ but since it's commented out I believe it is disabled.

I have an .htaccess file in /var/www/test.host.net with Options +Indexes just in case.

Error log:

[error] [client dumb] Directory index forbidden by Options directive: /var/www/test.host.net/

Issue is occurring on Debian 7 Apache 2.2

All suggestions welcome.

6
  • What does All do on the Options line? Commented Feb 28, 2016 at 10:35
  • 1
    The apache2 manual says: Mixing Options with a + or - with those without is not valid syntax and will be rejected during server startup by the syntax check with an abort. Commented Feb 28, 2016 at 10:38
  • Where is it mixed in the configuration above? Restarting apache does not return any error messages at all.
    – nick064
    Commented Feb 28, 2016 at 11:26
  • Still, I'd guess it doesn't like Options All +Indexes; maybe split it into two lines Options All and Options +Indexes. Commented Feb 28, 2016 at 11:35
  • btw. the 2.2 documentation only says Mixing Options with a + or - with those without is not valid syntax and is likely to cause unexpected results. And further, it looks like All includes Indexes, so you don't need that one. Commented Feb 28, 2016 at 11:45

1 Answer 1

0

I found my answer.

Never, ever leave any files in your sites-enabled directory - I had an old vhost configuration file that was saved as host.bck, which for some reason was being read by Apache, and it executed the configuration in it for all vhosts... basically my configuration files weren't working at all up to when I found out this.

1
  • On Debian 8 (jessie) all Apache 2.4 configuration fragments must have .conf extension, exactly to combat this type of trouble. Commented Feb 29, 2016 at 9:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .