I need to run 2 application in one webserver (apache), currently i am running one without any issues when i try to configure vhost (virtual host) to run my 2nd application it always defaults to first one or (what is mentioned under document root in httpd conf file) it does not pick from vhost conf file which has document root set for both application differently. Can some one send me sample of httpd & vhost config which as similar setup I need to use Ip based virtual host setting. I dont want to change my host file setup i need to set this up in my production system and i already registered the name in DNS for the host i am configuring.
as per above configuration when I type www.website1.com , the home page(index.html) from htdocs should be served.
when I type www.website2.com home page (index.html) from website2 folder present under C:/Apache2.2.17/website2 should be displayed.
But index.html of website1 is always displayed even when I type www.website2.com
If I change the document root setup in httpd.conf to DocumentRoot "C:/Apache2.2.17/website2", when I type www,website1.com
I am getting website2.com hompe page
What is wrong in above configuration. My DNS configuration is done corerctly when i type www.website2.com
i can see IP as 126.96.36.199 in browser status bar, for website1.com i see 188.8.131.52.
I'm not familiar with Apache Httpd set-up, but one thing I'd change is to make sure your '/' and '\' are consistent. Since you are not using spaces in your directory paths you should be able to use '\' safely. To also identify the root cause of the problem a little easier, I'd recommend having website one as separate from the default, e.g. Have:
Httpd.conf - setup
My httpd-vhosts.conf -Setup
This might help identify a problem where the DocumentRoot isn't being overridden as you'd expect.