HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   Single IP multiple websites (http://www.howtoforge.com/forums/showthread.php?t=60873)

RioSif 9th March 2013 01:25

Single IP multiple websites
 
Hello,
I have one ip lets say 1.2.3.4 and lets say 3 websites example1.com, example2.com, example3.com.
Websites are created with this ip selected at the "IPv4-Address". DNS created. Websites working ok.
At /etc/httpd/conf/sites-enabled/ i have 000-apps.vhost, 000-ispconfig.conf, 900-example1.com.vhost, 900-example2.com.vhost, 900-example3.com.vhost .
As i checked when i try to access via the browser the ip 1.2.3.4 it goes to example1.com. I think because of alphabetic sorting. How can i make the ip redirects to example2.com or example3.com?

Thanks

PS: Centos 6.3, ISPconfig latest

falko 9th March 2013 17:52

You must use domains/hostnames in your browser, not IP addresses.

RioSif 9th March 2013 20:43

Yes, of course, you are right. That's the correct behavior but what if someone pings example3.com and finds it's ip address and then hits the ip address and sees example1.com instead of example3.com?
My question is is there a way to control via ispconfig or manually from the configuration of bind9 or httpd or it is just chosen randomly. I just want to know if there is a way. I know the right way to access a website.

Thanks

tahunasky 10th March 2013 12:45

Change the names of your vhost files:

902-example1.com.vhost, 900-example2.com.vhost, 901-example3.com.vhost

Apache will load the first one (900) and make it the default for the IP, then load 901, and 902, so if the IP is used it the web browser it will go to 900..

I myself usually put a _default.vhost file, to do this job.

You cant control this behavour using ISPConfig.

RioSif 10th March 2013 23:23

You are right, i thought of this cheat too. I was just looking for a more formal way.
Anyway, i'll do like that. Thank you!


All times are GMT +2. The time now is 18:32.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.