Forum Moderators: phranque

Message Too Old, No Replies

Apache distributing incoming requests on LAN

.. could rewrite module work for me?

         

Sarvesh Nagpal

7:17 pm on Mar 29, 2005 (gmt 0)

10+ Year Member



Hi,

I try to explain my situation below:

Here's my setup:
1) One main windows server with APACHE connected to internet.
2) Two other servers (one 2K3 and one Linux) connected to main server (windows+apache) via LAN.

Two other servers (in point 2) are connected to internet but using Internet Connection Sharing of Windows. So they do not have live IP address of their own.

Here's my requirement:
1) I will use this setup mainly for development purposes. I need to access three machines from internet but they share same internet address with DIFFERENT Host Names. Before I confuse you, let me write IP addresses.

Three machines have:
One Public IP: xyz.xyz.xyz.xyz
And individual LAN IP's:
(Windows+Apache): 192.168.0.1
WIN2K3: 192.168.0.2
Linux: 192.168.0.3

Now I know that using Virtual Hosts I can configure various domains on same server. But is there a way if I configure three domains for same public IP address to be internally forwarded to specified machine on LAN?

Main Server will receive all requests and should forward it to other machines if host name criteria is matched.

I can configure three servers using inbuilt Windows Firewall to forward separate ports to separate machines. Like 80 port for main server then 81 for other server and 82 for another.

Now that I hope I have explained my situation (Thanks though for being patient enough to read this) could you please suggest a solution? Would rewrite module of apache help me?

jdMorgan

9:49 pm on Mar 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sarvesh,

You can do this directly without mod_rewrite. See Apache mod_proxy [httpd.apache.org].

Jim

Sarvesh Nagpal

3:45 pm on Apr 4, 2005 (gmt 0)

10+ Year Member



Thanks jdMorgan,

Your solution worked like a charm. Just for future reference I am including detailed instructions below:

----------
#First enable mod_proxy module:

LoadModule proxy_module modules/mod_proxy.so
AddModule mod_proxy.c

#Then declaring virtual hosts for each individual hostname:

NameVirtualHost xyz.xyz.xyz.xyz:80

<VirtualHost your.hostname.com>
ServerAdmin s@rvesh.com
ServerName your.hostname.com
ProxyRequests On
ProxyPass / http:*/192.168.0.3/
ProxyPassReverse / http:*/192.168.0.3/
</VirtualHost>

# And similar to your.hostname.com, we can declare more host names if we want.
----------