up vote 0 down vote favorite
share [g+] share [fb]

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                                                                 
</Directory>                                                                                                                                                                        
</VirtualHost>   

<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                                                                 
</Directory>                                                                                                                                                                                       
</VirtualHost>
link|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
feedback

1 Answer

up vote 0 down vote accepted

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

See http://httpd.apache.org/docs/1.3/vhosts/name-based.html

link|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
feedback

Your Answer

 
or
required, but never shown

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