2

I was playing with the apache configuration files after a system restore when I noticed something I have never really though about too much. Here are the first lines of the default /etc/apache2/sites-available/default:

DocumentRoot /var/www
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
 </Directory>

Since the root of a web server is usually /var/www, why is there the need to add a <Directory /> in here?

0

1 Answer 1

4

It could be that you somewhere in your configuration define a Directory outside of DocumentRoot (e.g. I store my static pages under DocumentRoot but have web-applications in a separate directory outside DocumentRoot). By having <Directory /> in your configuration you define a reasonable default that's valid for every directory not specified by an own <Directory>-stanza.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.