Apache2 Manage Server default

Posted by Jaime E. Valdez on Server Fault See other posts from Server Fault or by Jaime E. Valdez
Published on 2012-03-30T21:32:45Z Indexed on 2012/03/31 17:33 UTC
Read the original article Hit count: 362

Filed under:
|

I'm trying to setup two domains correctly. I have some issues I hope you can help me. Site one's conf:

<VirtualHost myipaddress:80>
    ServerName www.domain1.com
    ServerAdmin [email protected]
    DocumentRoot /home/domain1/public_html
</VirtualHost>

My other domain conf is:

<VirtualHost myipaddress:80>
    ServerName www.domain2.com
    ServerAlias *.domain2.com domain2.com
    ServerAdmin [email protected]
    DocumentRoot /home/domain2/public_html
</VirtualHost>

The default site is disabled. The problem is that when accessing "domain2.com" from my browser, it always redirects to "www.domain1.com". It only works when I excplicitly access "www.domain2.com". I have also other domains like "domain1.net", "domain1.info" pointing to my server but at this moment are not configured either setup on Apache yet I can access from browser and always accessing to "www.domain1.com".

By the way is there any possible configuration over Apache to handle IP only, I mean if I type "http://myipaddress/" I get the "www.domain1.com"... Arrgh.

© Server Fault or respective owner

Related posts about apache2

Related posts about vhost