PDA

View Full Version : apache virtual hosting


soroccoheaven
25th November 2008, 16:47
I am trying to setup virtual hosting (name based on same system)but as i have set it up for SSL so i am not able to work it out.
what i am thinking now is, can i modify my hosts file and add an entry in it with the ip address and domain name for my other server so that whenever any request will come to this server it will be directed/resolved by hosts file and will forward it to second webserver.

as i have installed my webserver behind the adsl ..portfording done everything is working pretty well.now i want other domains on the same wan IP.will this work ?..
say my webserver1.com is running on 192.168.2.2 and now i have installed another webserver2.com with ip address 192.168.2.10 because my adsl modem is configured for 192.168.2.2 all the port 80 request will be forwarded to 192.168.2.2 , what i am thinking i will add entry for 192.168.2.10 for my second webserver2.com in hosts file.
will this work ?
or please advice how to eliminate ssl ?

falko
26th November 2008, 15:04
You can forward port 80 to just one web server, so this will not work. But you can set up Apache on 192.168.2.2 as a reverse-proxy for 192.168.2.10. This should give you the idea:
http://www.howtoforge.com/apache_reverse_proxy_ispconfig

soroccoheaven
1st December 2008, 06:49
thanks Falko,
i have gone through the tutorial and finally decided to eliminate SSL so that i will be able to configure apache for nam based virtual hosting.can you guide me how to eliminate SSL now ?

falko
2nd December 2008, 15:49
Comment out
Listen 443 in the Apache configuration and remove all SSL parts from your vhosts.

soroccoheaven
3rd December 2008, 09:35
Thanks falko, this has been implemented but dont know what's the problem, will try/check to do it again.