Server Environment: Ubuntu 12.04 | Apache 2.2
I have disabled the default vhost configuration using a2dissite default and deleted the default file from sites-available and sites-enabled. I have 3 domains pointed at the VPS at DigitalOcean and I've added CNAME records for www linked to domain.com. (with the trailing dot).
Theis is the current setup:
- domain1.com : http://pastie.org/9457734
- domain2.com : http://pastie.org/9457732
- domain3.com : No vhost defined, but pointed at VPS
Navigating to domain1.com serves the intended DocumentRoot, so does domain2.com. However, navigating to www.domain1.com serves the DocumentRoot of domain2.com (this is the problem). This doesn't seem to happen with www.domain2.com which serves the correct path. domain3.com which has no vhost created also mysteriously serves the content from domain2.com
If I delete the www CNAME records, the links with www do not work after DNS propagation. I have seen suggestions to add a ServerAlias directive in the vhost files. When I add such directives, Apache errors out with the following:
"ScriptAlias takes two arguments, a fakename and a realname"
How can I solve this problem?
wwwequivalent works, but www .hrsys.com.ng (actual domain masked) points to arc's DocumentRoot. Do you understand me?httpd.conffile there is empty (0 bytes).<VirtualHost *:80>by<VirtualHost xx.xx.xx.xx:80>(where xx is the ip address) for each domain ?