Forum Moderators: phranque

Message Too Old, No Replies

Vhost Directory directives in apache2.conf

proper placement of Directory directive in Vhost environment

         

krausdogs

3:23 pm on Feb 1, 2012 (gmt 0)

10+ Year Member



In an Ubuntu Apache2 virtual hosting environment I’m wanting to know if it is important that the Directory directive be placed in each vhost file sitting in the sites-available folder, Or can it simply be placed in the apache2.conf file.
The directive I'm referring to looks like:

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>


and is often place in the vhost file as such:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName site1.wise.bob.com
DocumentRoot /var/www/mydrupalsites
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/mydrupalsites>
...


If ok to have in apache.conf, at what location should it be placed? Above or below the following?

<VirtualHost *:80>
ServerName wise.bob.com
DocumentRoot /var/www/
DirectoryIndex index.html
</VirtualHost>


Here?

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/

Here? Does it matter?
Thanks