Friday, March 18, 2016

linux - Wordpress Opening From Wrong Directory

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:




ServerAdmin email@gmail.com
DocumentRoot /var/www/html/domain1
ServerName domain1.com
ErrorLog logs/domain1.com_error_log
CustomLog logs/domain1.com_access_log common



ServerAdmin email@gmail.com
DocumentRoot /var/www/html/
ServerName domain2.com
ErrorLog logs/domain2.com-error_log
CustomLog logs/domain2.com-access_log common



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.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...