vote up 0 vote down star

I have setup subdomains using Apache before and have never really ran into any big problems. But with this (I believe Centos) server that is one of my clients, I'm not understanding what I'm doing wrong. Here is the .conf that apache is loading:

Listen 80
NameVirtualHost *:80

<VirtualHost *:80>
    ServerName www.thedomain.com
    DocumentRoot /u1/thedomain.com/public
    RailsEnv production
</VirtualHost>

<VirtualHost *:80>
    ServerName subdomain.thedomain.com
    DocumentRoot /u1/subdomain.thedomain.com/public_html
</VirtualHost>

When I access either the primary or subdomain addresses, they both point to the primary www.thedomain.com content. Any thoughts?

UPDATE:

Yes I did a configtest and graceful after making the changes.

flag

75% accept rate

2 Answers

vote up 2 vote down check

Have you made sure to reload Apache after making the change?

Edit: Sometimes graceful doesn't perform properly, do an apachectl restart.

link|flag
apachectl restart did the trick. Wonder why graceful doesn't always work. – Jakobud Dec 11 at 19:48
1  
graceful sends SIGUSR1 to the apache processes, meaning they don't exit until current connections are closed. I believe if there are hung connections or ongoing ones it means that it could be some time until your new config takes effect. I could be wrong about this, but that was my understanding. – brent Dec 11 at 19:51
Thanks a bunch! – Jakobud Dec 11 at 20:01
vote up -1 vote down

Listen 80 ServerName www.mydomain.com:80 DocumentRoot "/www/tomcat/webapps" Options Indexes FollowSymLinks Order allow,deny Allow from all Options ExecCGI

NameVirtualHost *:80 ServerName blog.mydomain.com DocumentRoot /www/blog DirectoryIndex index.php index.html Options All AllowOverride All Allow from all

on ssl.conf I have: *Listen 443 *

Now if I access mydomain.com or blog.mydomain.com both are forwarded to /www/tomcat/webapps

any idea where I went wrong? I have source complied Apache2

Thanks, Anpl

link|flag

Your Answer

Get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.