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.
Listen 80
ServerName www.mydomain.com:80
DocumentRoot "/www/tomcat/webapps"
<Directory "/www/tomcat/webapps">
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
<Directory /www/tomcat/webapps/ROOT/WEB-INF/cgi-bin>
    Options ExecCGI

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

on ssl.conf I have:

Listen 443
<VirtualHost _default_: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. Should I add a virtual for the mydomain.com too?

Thanks, Anpl

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You should not mix name-based virtual hosting with no virtual hosting at all. Create a VirtualHost for your standard domain (www.mydomain.com) and restart your Apache httpd after editing its configuration accordingly.

share|improve this answer
Hi, I created two separate VirtualHosts for the main domain and Blog. Now everything is working fine. Thanks for the support Thanks –  user37143 Mar 25 '10 at 6:27

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.