Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a question regarding the config files in /etc/apache/sites-available.

For example I have a site configured in there like this:

<VirtualHost *:80>
    DocumentRoot /usr/share/agendav/web/public
    ServerName agendav.mysite.tld

    # Logfiles:
    CustomLog /var/log/apache2/access_agendav.log combined
    ErrorLog /var/log/apache2/error_agendav.log
    LogLevel warn

    <Directory /usr/share/agendav>
            Options Indexes
            DirectoryIndex index.php
            php_flag magic_quotes_gpc Off
            php_flag magic_quotes_runtime Off
    </Directory>

</VirtualHost>

<VirtualHost *:443>
    DocumentRoot /usr/share/agendav/web/public
    ServerName agendav.mysite.tld
    SSLEngine on
    SSLCertificateFile /etc/apache2/ssl/apache.crt
    SSLCertificateKeyFile /etc/apache2/ssl/apache.key

    # Logfiles:
    CustomLog /var/log/apache2/access_agendav_ssl.log combined
    ErrorLog /var/log/apache2/error_agendav_ssl.log
    LogLevel warn

    <Directory /usr/share/agendav>
            Options Indexes
            DirectoryIndex index.php
            php_flag magic_quotes_gpc Off
            php_flag magic_quotes_runtime Off
    </Directory>

</VirtualHost>

As you see the Directory directive is redundant in both http and https part of the site. Is it valid to move the Directory directive at the beginnung so it is valid for both blocks or do I have to keep it in there twice?

Thanks!

share|improve this question
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.