Quote:
Originally Posted by firehak
I read up on mod_proxy and still couldn't figure it out
|
you can have 2 separate web servers on 1 WAN IP using a "reverse proxy" both apache and squid can do this. By the sounds of it you've had a go with apache, perhaps try squid.
I've just set up a squid reverse proxy on the recomendation of some of the linux guys at work using a page from
http://wiki.squid-cache.org/ConfigExamples such as
this
The way I did it was with 3 servers, all virtual, to simplify the config on each server. You could probably keep it fairly simple with having squid on one of the servers but on a separate nic ip. A few key points for the setup are
- The Wan IP port 80 forward to squid lan ip port 80
- which forwards to apache servers port 80
- squid machine resolves domain names to the lan ip addresses, set this in squid machine hosts file if your dns config doesn't allow this easy enough
some key squid.conf points are
- http_port 80 vhost
- change "http_access deny all" to "http_access allow all"
- cache_peer lan.ip.of.server1 parent 80 0 no-query originserver name=server_1
- cache_peer_domain server_1 www.example.com example.com
- cache_peer lan.ip.of.server2 parent 80 0 no-query originserver name=server_2
- cache_peer_domain server_2 download.example.com alias2.example.net
a search around the net will often turn up config lines such as
httpd_accel_host virtual
httpd_accel_port 80 (the web server port)
httpd_accel_single_host off (It should be disabled when we are going to the reverse proxy for multiple servers)
httpd_accel_uses_host_header on
these are deprecated, but unfortunately show up in search results still