Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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

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

share|improve this answer
    
apachectl restart did the trick. Wonder why graceful doesn't always work. –  Jakobud Dec 11 '09 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 '09 at 19:51
    
Thanks a bunch! –  Jakobud Dec 11 '09 at 20:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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