3

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?

1 Answer 1

5

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .