Apache2: second virtual host resolves to first virtual host's index.html
I've Googled this thing for days and can find many instances of others having this same problem, but cannot find a solution that works for me. The solutions always say to set up my virtual servers like I have them below. I have two domains with DNS resolving to the same IP address of my LAMP server. Here is the configuration from sites-enabled:
Code:
<VirtualHost *>
DocumentRoot /website_one
<Directory "/website_one">
allow from all
Options +Indexes
</Directory>
ServerName website_one.com
</VirtualHost>
<VirtualHost *>
DocumentRoot /var/www/wordpress
<Directory "/var/www/wordpress">
allow from all
Options +Indexes
</Directory>
ServerName website_two.com
ServerAlias website_two.com
</VirtualHost>
Also in sites-enabled is file 000-default:
Code:
NameVirtualHost 123.456.789.100:80
I have tried using "123.456.789.100:80" in the VirtualHost field of both instead of '*' but that gives me "server not found" on each.
With the above configuration, website_one works perfectly. When I try to reach the second, doing in Firefox: "http://website_two.com" it should show me website_two which is wordpress. It doesn't. Rather, it takes me to the same webpage as website_one. I know wordpress is working because up till now, I've always accessed it as a page from website_one but now I want it to give it its own domain.
Why am I getting website_one's index.html when trying to reach website_two instead of website_two's index.php for wordpress? This is my first attempt at setting up virtual hosts with Apache so be gentle with me... ;)
Any help or insight appreciated. :)