ubuntu - Apache two domains on two different ip addresses -
ubuntu - Apache two domains on two different ip addresses -
i trying setup 2 different domains on 2 different ip addresses: bbb.zzz.xxx.yyy & bbb.xxx.yyy.zzz . problem is, domain1 working fine. sec site (domain2) working when come in ip address in browser, shows content of domain1 when come in wwww.domain2.com . how should solve ? there module missing ? using different files in sites-available directory different domains.
<virtualhost bbb.zzz.xxx.yyy> # admin email, server name (domain name) , aliases serveradmin **********@gmail.com servername domain1.com serveralias www.domain1.com # index file , document root (where public files located) directoryindex index.php documentroot /home/apachewebsites/domain1/httpdocs # custom log file locations loglevel warn errorlog /home/apachewebsites/logs/error.log customlog /home/apachewebsites/logs/access.log combined <directory /home/apachewebsites/domain1/httpdocs/> options indexes followsymlinks multiviews allowoverride require granted allow </directory>
<virtualhost bbb.xxx.yyy.zzz> # admin email, server name (domain name) , aliases serveradmin ************@gmail.com servername domain2.com serveralias www.domain2.com # index file , document root (where public files located) directoryindex index.php documentroot /home/apachewebsites/domain2 # custom log file locations loglevel warn errorlog /home/apachewebsites/logs/error.log customlog /home/apachewebsites/logs/access.log combined <directory /home/apachewebsites/domain2/> options indexes followsymlinks multiviews allowoverride require granted allow </directory> </virtualhost>
your first snippet says
servername domain1.com serveralias www.domain2.com
change server alias www.domain1.com , should work.
apache ubuntu virtualhost
Comments
Post a Comment