Help - Search - Members - Calendar
Full Version: Subdomain problem
The Planet Forums > Operating Systems > Red Hat Linux
BahBah
The subdomain works. But when running it it seems to disable the 2nd VirtualHost entry.

The first entry in httpd.conf is for the subdomain, The second for the main site.

If I leave my httpd.conf like that the subdomain works. But I cannot access my site using www.


In httpd.conf I have:


DocumentRoot /site1/home/mydomain/public_html/forums
ServerName forum.mydomain.com
ServerAlias forum.mydomain.com

Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all





ServerName mydomain.com
DocumentRoot /site1/home/mydomain/public_html
ServerAlias mydomain.com www.mydomain.com mydomain.net www.mydomain.net
CustomLog logs/mydomain.com combined


and in my dns I have this line for the subdomain:

forum.mydomain.com. 14400 IN A xxx.xxx.xxx.xxx


Can anyone see the problem here ?
jaume
See this virtualhost:


ServerName www.mydomain.com
DocumentRoot /site1/home/mydomain/public_html
ServerAlias mydomain.com mydomain.net www.mydomain.net
CustomLog logs/mydomain.com combined


Change to:


ServerName mydomain.com
DocumentRoot /site1/home/mydomain/public_html
ServerAlias www.mydomain.com mydomain.net www.mydomain.net
CustomLog logs/mydomain.com combined
BahBah
Thanks Jaume I've just updated my first post (was editting it when u replied) any ideas on that level ?
jaume
have you changed the ServerName and ServerAlias for the virtualhost i tell you?
BahBah
Yes
BahBah
This site is an IP based site (on RHEL3 plain)

I get this error when restarting httpd:

[Thu Jun 17 10:40:49 2004] [warn] VirtualHost xxx.xxx.xxx.xxx:80 overlaps with VirtualHost xxx.xxx.xxx.xxx, the first has precedence, perhaps you need a NameVirtualHost directive
BahBah
Well adding the NameVirtualHost directive fixed the whole problem along with your fix jaume!

Thanks for your help icon_smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.