routing requests to internal computer
Hi
Not sure if this is the right place, but i'll explain my setup: I have two domains, domain1.com and domain2.com I have a linux machine for all php requests (domain1.com) 192.168.1.100 I have a windows machine for all asp requests (domain2.com) 192.168.1.200 if a request is made to domain1.com it routes to 192.168.1.100, yet if i a request is made to domain2.com it routes to 192.168.1.200. Currently all port 80 requests go to 192.168.1.100, i want this box (the linux one) to route the URL domain2.com to go to 192.168.1.100. How do i go about doing this, i've tried using apahces rewrite engine but it physically changed the IP to 192.168.1.200 which you or i cant connect to outside the internal LAN. I've tried configuring BIND but can't seem to get it to work, in fact i read somewhere that BIND doens't care about URLs so this wont work. Does anybody know how i can achieve this? Thanks Ant |
Quote:
domain1.com == 192.168.1.100 = linux/php domain2.com == 192.168.1.200 = windows/asp Quote:
Let me see if i understand ... If a request is made do domain1.com the linux box with 192.168.1.100 serves the request. And if a request is made to domain2.com the windows box with 192.168.1.200 should serve the requests. Well knowing that port 80 is redirected to 192.168.1.100 (linux box) you want the linux to route the requests for domain2.com to 192.168.1.100 (ITSELF?) or to 192.68.1.200 which is the windows box. So do you have any external IP's that are actually pointing to domain1.com and domain2.com? .. If yes why dont you redirect ports so all requests made to domain1.com are mapped to 192.168.1.100:80 while all requests made to domain2.com being mapped to 192.168.1.200:80. I dont really know all your configuration over there to give more specific hints and advices. Regards Andy |
Quote:
Quote:
Quote:
So on my firewall i have only port 80 open which points to 192.168.1.100 which is the linux box, which i want requests to domain2.com to point to 192.168.1.200 without changing any ports. Quote:
Ant |
Hi there
I think (hope) i understood your request. If im right you will need to make use of either mod_proxy or mod_rewrite in your apache on the linux box to redirect. Since your router forwards all requests on port 80 to the linux box on port 80 you need to setup a VirtualHost in apache on the linux box for the domain2.com. The thing would look like: For mod_rewrite Code:
<VirtualHost 192.168.1.100> Code:
<VirtualHost 192.168.1.100> Code:
<VirtualHost 192.168.1.100> Regards Andy |
Thanks for your help.
I have tried using mod_rewrite but it seems to want to route the request to 192.168.1.200, which i want, this works fine when i'm inside the LAN but it doesn't seem to work outside, it also seems to put 192.168.1.200 in the URL rather than domain2.com. I haven't looked at mod_proxy before, shall have a go... In the meantime here is a diagram of my setup. Hope it explains it slightly better. http://www.metasoma.com/temp/diagram.gif By the way, when i say i couldn't get it to work, all i'm getting displayed from entering domain2.com is the linuux apache test page, not the IIS page. Thanks for all your help! Ant |
You were right, i did just need to use the apache mod_rewrite. I can't believe it was that simple all along! I found this post that also helped me:
http://www.linuxquestions.org/questi...d.php?t=264864 Thanks for your help Ant |
Just a note for anyone who is attempting to achive the same as me:
I've noticed that if you use the mod_rewrite module it will forward the request to the windows box but only as an IP. Therefore if you want to set up multiple websites on the second machine they will not resolve to their domain name. If you use mod_proxy it will work with multiple websites, so use this instead. Thanks Ant |
All times are GMT -5. The time now is 04:52 PM. |