3

I have three separate web servers with three different internal IP addresses on a network with only one public IP address. Each web server has security restrictions such that I cannot just run all of my websites on a single web server. All are running Apache.

I want to setup subdomains that allow me to access each of the different web servers remotely, all on port 80. E.g.,

site1.domain.com

site2.domain.com

site3.domain.com

Where all three of those domains resolve to my single public IP address, but some type of service examines the request to see which subdomain is being requested and pulls the data from the appropriate server.

Is this type of thing (1) possible and (2) easy to implement? I'm running Ubuntu Server 9.04.

1 Answer 1

5

This is called Reverse Proxy, you can redirect all trafic on port 80 to one Apache server, configure 3 vhost (1 per subdomain) and in the 2 vhost handling non local website use the Apache ProxyPass directive to tell apache to load content from another server.

nginx can also act as a reverse proxy. You can forward all request to nginx then nginx will load content on one the right server depending of the subdomain.

I would use the Apache proxypass feature, it's easier to setup from my point of view.
You can also start a 4th apache server that will only act as reverse proxy. In this case all of the 3 vhost will use proxypass to get content from the right server.

See http://www.raskas.be/blog/2006/04/21/reverse-proxy-of-virtual-hosts-with-apache-2/ for an example, you case is the same execpt that you have a third subdomain (so you need 1 more vhost).

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .