Apache is not serving up the correct page for a sub domain.
hello all.
I have a domain, dns hosted, and apache serving up pages. this all works fine, so far. i even have a cms running. my confusion starts when i try to host a different site under a subdomain, ie. sub.mydomain.com. i have two vhosts in apache. one is mydomain.com and the directory is /var/www/mydomain. my domain is a symlink to ~/www this has worked. but, when i try to add another vhost like webmail.mydomain.com, and i try to put the root directory in /var/www/webmail, it doesn't work. when i try to access webmail.mydomain.com, i just get the site on mydomain.com. I feel like i am just missing something really simple here, but i have tried searching around for solutions to no avail. here are the relevant parts of apache2.conf: Code:
<VirtualHost *> |
<directory> should have a trailing slash :
Code:
DocumentRoot "/var/www/mydomain" Code:
DocumentRoot "/var/www/webmail" Code:
SetEnv SITE_ROOT /var/www/webmail |
Thanks for the sugestions. I tried what you said, but it didn't seem to make any difference.
Is there anyway that this could be a dns problem? I have an A record that points mydomain.com to 71.my.ip.7 and I have a cname record that points *.mydomain.com to mydomain.com anyway the my apache2.conf file looks like this now: Code:
<VirtualHost *> |
What does the main httpd.conf Document root point to ? It should be pointing to the same place as the first virtual host. This may cause problems if it's pointing to /var/www
Also, all my virtual servers specify the port as in : Code:
<VirtualHost *:80> And I have the line : Code:
RewriteEngine on As for the DNS, it might be worth adding the webmail.domain.com as a separate A record instead of a cname. Point it at the ip address properly. Without that, all you are doing is aliasing webmail.domain.com to domain.com. It needs to be a separate entity. Unless you want to use apache rewriting to send anything with webmail in the address to the correct place. |
hmm. switching the order of the name and document root seemed to do something.
when I access the webmail.mydomain.com page i get the mydomain.com page sans the style sheet, not the index.html for the subdomain. I am using the drupal cms. could this be screwing things up? I did add an A record. my http.conf file is completely empty. here is my apache2 file in full. vhosts are at the bottom. Code:
# |
All times are GMT -5. The time now is 02:25 PM. |