[Gllug] Apache V hosts

Luke Hopkins streaklug at streaknet.co.uk
Tue Oct 7 10:33:34 UTC 2003


I need to add some apache vhosts who all read from the same directory
(database connections are dependand on the subdomain).

I currently have:
<VirtualHost *>
    ServerAdmin luke at domain.com
    DocumentRoot /home/sites/home/web
    ServerName sub1.domain.com
</VirtualHost>
<VirtualHost *>
    ServerAdmin luke at domain.com
    DocumentRoot /home/sites/home/web
    ServerName sub2.domain.com
</VirtualHost>

<VirtualHost *>
    ServerAdmin luke at domain.com
    DocumentRoot /home/sites/home/web
    ServerName sub3.domain.com
</VirtualHost>

What happens when I browse to say sub3.domain.com is the servername (php
$SERVER_NAME) is sub1.domain.com because that's at the top of the list. 
Any ideas how I get it to return the correct subdomain without having to
use different directories (and preferably avoiding rewrites)?

Cheers
Luke


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list