LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache redirections (https://www.linuxquestions.org/questions/linux-server-73/apache-redirections-475025/)

spanishwasabi 08-18-2006 03:23 AM

Apache redirections
 
Hi,

My internal network is behind a NAT. I have a main machine (call it A) that I use as an Apache server on port 80 for several sites (say mysite1.com, mysite2.com). Because of the NAT, any request on port 80 will have to go to a single machine no matter the site requested.

I intend to distribute the charge and have one machine for each site (call it B and C). I'm using virtual machines, so it should not be a problem to find them :-)

I would like a way of redirecting the requests depending of the site. For example, if A receives a request for mysite1.com it will send it to machine B, and if A receives a request for mysite2.com it will send it to machine C. I hope I've not been too confusing...

Thanks a lot,

G

penguintutor 08-18-2006 05:41 AM

You can do this by configuring machine a as a reverse proxy to forward the requests on to the other servers.

Within each virtual host definition on machine a, you would add an entry
Code:

ProxyPass http://<server to redirect to>
This would then pass all requests for that virtual host to the new server.

spanishwasabi 08-18-2006 11:04 AM

Thanks, makes sense.

So if i understand you, machine A would only redirect the traffic with the Apache application.

Could it be used for a domain and subdomains? I would like to redirect *.mysite1.com to machine B with a single rule, not just www.mysite1.com (same for mysite2.com), as I have www.mysite1.com, photos.mysite1.com, blog.mysite1.com,...

And is it possible to do it with a more lightweight server than Apache? Seems a bit overkill for the task.

Thanks a lot!

G


All times are GMT -5. The time now is 02:15 AM.