apache subdomain configuration

Posted by terrid25 on Server Fault See other posts from Server Fault or by terrid25
Published on 2011-11-25T09:12:43Z Indexed on 2011/11/25 9:52 UTC
Read the original article Hit count: 143

Filed under:
|
|
|

I seem to be having a small problem with setting up a subdomain in apache under CentOS.

I have the following:

<VirtualHost *:80>
  ServerName www.domain.co.uk
  ServerAlias domain.co.uk dev.domain.co.uk
   DocumentRoot "/var/www/html/domain/web"
   DirectoryIndex index.php
   Alias /sf /var/www/html/symfony14/web/sf

 <Directory "/var/www/html/domain/web">
   AllowOverride All
   Allow from All
 </Directory>
</VirtualHost>

<Directory "/var/www/html/symfony14/web/sf">
 AllowOverride All
 Allow from All
</Directory>
<VirtualHost *:80>
  ServerName test.domain.co.uk
  DocumentRoot "/var/www/html/domain_test/web"
  DirectoryIndex index.php
  Alias /sf /var/www/html/symfony14/web/sf

  <Directory "/var/www/html/domain_test/web">
   AllowOverride All
   Allow from All
  </Directory>
</VirtualHost>

So going to www.domain.co.uk and domain.co.uk display the contents from /var/www/html/domain, but going to test.domain.co.uk also displays the same folder contents.

Is this because of the ServerAlias ?

Thanks

© Server Fault or respective owner

Related posts about apache2

Related posts about centos