aDoN
aDoN

Reputation: 1951

Apache2 -Indexes causes server to fail

I want to prevent Directory listing, in my /etc/apache2/apache2.conf I have this:

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

And I add the - before Indexes. When I restart the server I get an error in that line.

I have this version: Apache/2.4.10 and I have done this before for preventing directory listing without problems, but I don't know why is this happening now.

Upvotes: 0

Views: 132

Answers (1)

Barry Pollard
Barry Pollard

Reputation: 45970

From the documentation: https://httpd.apache.org/docs/2.4/mod/core.html#options

Note

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.

So instead of:

    Options -Indexes FollowSymLinks

You should use:

    Options -Indexes +FollowSymLinks

Upvotes: 1

Related Questions