Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all

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

share|improve this question
The <Directory> directive (and <Files> as well), apply directives to parts of the file system. – Christopher Apr 18 '14 at 20:45
up vote 3 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.