Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two subdomains, each register with my dns registrar to point to my VPS ip address. Pinging both resolve fine. I have two Virtual Host configurations for two sites but the problem is that both subdomains redirect to the same page. I am confused and must be missing something within Apache which is causing this strange occurrence.

My DNS settings are set to A records to the ip of my VPS. Is this correct? I dont believe I need CNAMEs.

<VirtualHost *>   

ServerName phpmyadmin.<mydomain>.com             

DocumentRoot "/srv/www/phpmyadmin"                                                                                                                                    

<Directory "/srv/www/phpmyadmin">                                                                   
allow from all                                                                                      
Options +Indexes +Includes +ExecCGI                                                                 

<VirtualHost *>                                                                                     
ServerName panel.<mydomain>.com                                                                        
DocumentRoot "/srv/www/repo_project"               

WSGIScriptAlias / /srv/www/repo_project/django.wsgi     

<Directory "/srv/www/repo_project">              

allow from all                                                                                      
Options +Indexes +Includes +ExecCGI                                                                 
share|improve this question
Sorry for ask but: you reload apache afther the changes you made? Also, are you sure apache is reading this file? – HD. Aug 21 '09 at 15:58
Yes and its driving me mad. /etc/inid.d/apache2 restart – Mark Stahler Aug 21 '09 at 15:59
You say both subdomains redirect to the same page. Is this page the same as one of the two above or is a completely different page? – HD. Aug 21 '09 at 16:02
Both redirect to my index page for PhpMyAdmin which is installed under one of the VirtualHost root directories. – Mark Stahler Aug 21 '09 at 16:05
up vote 0 down vote accepted

Did you declare NameVirtualHost * just above these Virtual Host declarations?


share|improve this answer
This was it. I dont understand this REQUIRED directive is not in Debians apache.conf when it already has entries in /etc/apache2/sites-enabled. Thanks, Devin (Ill search for you on Stack overflow to upvote you there, Im too new here :) – Mark Stahler Aug 21 '09 at 16:11

Your Answer


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.