up vote 0 down vote favorite
share [g+] share [fb]
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>
<Directory /www/tomcat/webapps/ROOT/WEB-INF/cgi-bin>
    Options ExecCGI
</Directory>

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

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

link|improve this question

22% accept rate
feedback

1 Answer

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.

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

Your Answer

 
or
required, but never shown

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