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 bunch of URLs which all point to the same directory on the server in apache's conf files. The basic structure is like this:

<VirtualHost *:80>
  ServerName mysite.com
  ServerAlias www.mysite.com
  DocumentRoot /var/www/thesite

  <Directory /var/www/thesite>
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    allow from all
  </Directory>
</VirtualHost>

Now, each one is essentially identical, just changing the SeverName and ServerAlias directives.

Is it permissible to move the <Directory> directive to the top, outside of the <VirtualHost>? And, while I'm at is, is there any reason I can't list a dozen sites as SeverAlias even if they're completely different?

share|improve this question

1 Answer 1

Is it permissible to move the directive to the top, outside of the <VirtualHost>

Yes, but it'd be more logical to leave it where it is.

is there any reason I can't list a dozen sites as SeverAlias

ServerAlias www.mysite.com anotherdomain.com yetanotherdomain.com

is valid, but the site returned will be the one at /var/www/thesite.

share|improve this answer

Your Answer

 
discard

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.