Apache 2.4 subdomain setup fails

Posted by Grashopper on Server Fault See other posts from Server Fault or by Grashopper
Published on 2012-10-07T20:25:45Z Indexed on 2012/10/07 21:40 UTC
Read the original article Hit count: 105

Filed under:
|

I am struggling with this all the day, no answer i found here as well. Please advice how to setup proper a subdomain i need.

My Apache config has 2 domains configured (on same IP), for the domain2.com i need to setup a sub-domain. Here is what i have so far, but the subdomain keeps redirecting me to domain2.com (main site).

<VirtualHost 11.11.11.11:80>
ServerName domain1.com
ServerAlias domain1.com *.domain1.com
DocumentRoot "C:/wwwmap/domain1.com"
</VirtualHost>

<VirtualHost 11.11.11.11:80>
ServerName domain2.com
ServerAlias domain2.com *.domain2.com
DocumentRoot "C:/wwwmap/domain2.com"
</VirtualHost>

        <VirtualHost 46.4.24.4:80>
        ServerName projects.domain2.com
        DocumentRoot "C:/wwwmap/projects"
        </VirtualHost>

The DNS entry is: projects in CNAME domain2.com

Trying to remove ServerAlias domain2.com *.domain2.com worked so far, but then domain2.com is redirecting to domain1.com

What am i doing wrong?

© Server Fault or respective owner

Related posts about apache2

Related posts about subdomain