I have an Amazon ec2 m3 medium instance running AMI(RedHat based) Linux.
I am trying to host multiple domains on this instance by adding this at the end of httpd.conf:
<VirtualHost *:80> ServerAdmin email@example.com DocumentRoot /var/www/html/domain1 ServerName domain1.com ErrorLog logs/domain1.com_error_log CustomLog logs/domain1.com_access_log common </VirtualHost> <VirtualHost *:80> ServerAdmin firstname.lastname@example.org DocumentRoot /var/www/html/ ServerName domain2.com ErrorLog logs/domain2.com-error_log CustomLog logs/domain2.com-access_log common </VirtualHost>
Now here is my problem:
When I open domain1.com it opens just fine, but when I open the IP of server in the browser domain1.com opens.
Contents of domain1.com are stored in 192.168.1.1/domain1/ OR /var/www/html/domain1
The directory /var/www/html is supposed host domain2.com in future.
So when I open the IP, the contents of /var/www/html/ should be displayed. Instead, I see the Wordpress installation of /var/www/html/domain1/ I have also tried deleting the .htaccess file from each of the two directories.