logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Forwarding request to another apache server
Author
tuty_richard



Joined: 11 Feb 2009
Posts: 2

PostPosted: Thu 12 Feb '09 3:35    Post subject: Forwarding request to another apache server Reply with quote

I have my static IP set to my router. I am running two web servers. I am forwarding all my request on 80 port from the router to my server 1 its working fine. I need a help in setting up like this

I have domain say mydomain.com when ever I type mydomain.com in my browser it comes to my router then to my server 1 thats fine.

I have sub domain say mail.mydomain.com when ever I type mail.mydomain.com the router redirects to my webserver1. but what I need is my mail.mydomain has to be served by my server 2. How can I achieve this by using the apache running on my server 1.

Thanks
Richard
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Thu 12 Feb '09 9:16    Post subject: Reply with quote

if you mean two different machines both with Apache listening on port 80, then you need two WAN IPs and you do it at the DNS level.

site1.mydomain.com = xx.xx.xx.1 - > Server 1
site2.mydomain.com = xx.xx.xx.2 - > Server 2

For that you need a router that is capable of handling multiple WAN IPs or a switch and one router for each machine.
Back to top
tuty_richard



Joined: 11 Feb 2009
Posts: 2

PostPosted: Thu 12 Feb '09 12:04    Post subject: Reply with quote

I have only one static ip address and in dns server I have registered as mydomain.com to xxx.xxx.xxx.xxx and sub.mydomain.com to same ip address. I have Linksys WRT54g router when the request comes to port 80 it forwards the request to my server 1. But when the request comes from sub.mydomain.com it forwards the request to server 1 as its setuped in router. But from my apache running on server1 I need to redirect to to the server 2. This possible by setting the redirect rule in vertual host. But what my problem is when i redirect my sub.mydomain.com to server 2 it goes to server 2 and get the page. But when it rendering the browser the url changes to ip address of server. So I cant able to access my sub.mydomain.com other than my network.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Thu 12 Feb '09 18:53    Post subject: Reply with quote

ok,

you could run server 2 on another port, say 81 for example and have server 1 answer the initial request but then redirect the user to http://sub.domain.com:81

or other possibilities;

I think Wingate may do what you want, cannot remember

I think IP Tables in linux can do what you want, again, cannot remember. The latter two may require a third computer acting as the router.
Back to top


Reply to topic   Topic: Forwarding request to another apache server View previous topic :: View next topic
Post new topic   Forum Index -> Apache