i've two virtualhost subdomains indicate different sites however, if i load both subdomains within the browser, i recieve both of them pointing to same directory. here's my vhost.conf
<VirtualHost *:80> ServerAdmin email@example.com ServerName subdomain1.domain.com ServerAlias *.domain.com #Indexes + Directory Root. DirectoryIndex index.php DocumentRoot /subomain1/path/to/directory/trunk #Logfiles ErrorLog /subomain1/path/to/directory/trunk/error.log CustomLog /subomain1/path/to/directory/trunk//access.log combined </VirtualHost> <VirtualHost *:443> ServerAdmin firstname.lastname@example.org ServerName subdomain1.domain.com ServerAlias *.subdomain.com DirectoryIndex index.php DocumentRoot /subomain1/path/to/directory/trunk SSLEngine On SSLCertificateFile /ssl/certs/subdomain1.crt SSLCertificateKeyFile /ssl/private/subdomain1.key SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown </VirtualHost> <VirtualHost *:80> ServerAdmin email@example.com ServerName subdomain2.domain.com ServerAlias *.domain.com #Indexes + Directory Root. DirectoryIndex index.php DocumentRoot /subomain2/path/to/directory/trunk #Logfiles ErrorLog /subomain2/path/to/directory/trunk/error.log CustomLog /subomain2/path/to/directory/trunk//access.log combined </VirtualHost> <VirtualHost *:443> ServerAdmin firstname.lastname@example.org ServerName subdomain2.domain.com ServerAlias *.subdomain.com DirectoryIndex index.php DocumentRoot /subomain2/path/to/directory/trunk SSLEngine On SSLCertificateFile /ssl/certs/subdomain2.crt SSLCertificateKeyFile /ssl/private/subdomain2.key SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown </VirtualHost>
i've attempted google however no solutions appears to assist.
i am using ubuntu server
thank you ahead of time
I believe its because youre using ServerAlias *.domain.com on virtual hosts
because the ServerAlias directive signifies the listed names are also names which individuals may use to determine that same site:
then demands for those hosts within the subdomain.com domain is going to be offered through the subdomain1.domain.com virtual host.
this may help http://httpd.apache.org/docs/2.0/vhosts/name-based.html
have no idea should you ever solved this, however i was getting exactly the same problem also it switched out i didn't remember to alter the httpd.conf file such as this:
Open the “httpd.conf” and uncomment line #461 (approximately) which reads “Include /private/etc/apache2/extra/httpd-vhosts.conf”, then save.
obtained from this tutorial that is priceless: http://kevchapman.co.uk/development/setting-up-apache-on-snow-leopard/