Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect to another apache server on an INTERNAL IP address

Status
Not open for further replies.

jimbobiv

IS-IT--Management
Nov 18, 2004
16
GB
I wish to redirect a URL say to an internal ip address which has the SAME eternal IP address...

eg/

Server -> IP =80.11.10.9 or something, internal ip 192.168.0.1

Other machine -> connects to the internet through the server, but is running an apache server also. Reason for this is that we only have one internet connection so can only ever have one external ip.. internal ip is 192.168.0.2

Can i redirect all traffic going to to 192.168.0.2 so that it is visible on an externally connected client, and so that the 192.168.0.2's apache host settings are used.

If this makes little, i'll say what i mean, say 192.168.0.1 has #LoadModule cern_meta_module modules/mod_cern_meta.so so its NOT loading that, and 192.168.0.2 has LoadModule cern_meta_module modules/mod_cern_meta.so so it is loading that, i want the module loaded and available for use etc etc.

Any ideas, if this isnt making full sense, im happy with sum1 to make a stab in the dark, anything would help cos i dont fully understand why i cant use the proxy 'something' syntax, tried it doesnt work ;o)

James
 
OK I have a question on a similar vein...

I have two servers one running red hat (call it sr one running mandrake (don't ask...) (call it sr2)

sr1 serves all my web pages but I want sr2 to serve one particular page.

sr1 runs dns and http does sr2 also have to run dns, no right?

When a request for comes in I would like sr1 to forward the request to sr2

sr1 has an internal ip address of 192.168.1.102 and sr2 is 192.168.1.103

Thanks for your consideration.
 
Use ProxyPass and ProxyPassReverse to match the URI and pass the request to the backend server.

The user will ask for the page from SR1, SR1 will request it from SR2 and SR2 will return it to SR1 which then returns it to the user. The user never leaves SR1.

 
Hmmmm I am still experiencing some difficulty here...
Back to my original post...
sr1 hands off the request to sr2 and returns index.html no problem but won't open files located in directory /images nor is the file forum.html returned (in same directory as index.html) when requested.

I get the following errors...

Proxy Error
The proxy server could not handle the request GET /images/pbgb_orange.jpg.

Reason: Host not found

And...

Proxy Error
The proxy server could not handle the request GET /forum.html.

Reason: Host not found

Do I need to specify the full location in my html for example instead of img src="images/pbgb_orange.jpg" instead do I need to do img src="or a href="
Thanks again for your time!
 
sorry everyone I found my error...

Siberian said to do the following...

<VirtualHost 10.0.0.20:80>
ServerName ProxyPass / ProxyPassReverse / </VirtualHost>

I did this...

<VirtualHost 192.168.1.xxx>
ServerName ProxyPass / ProxyPassReverse / </VirtualHost>

Yup I forgot the / at the end of my internal addresses.
One should always think before speaking, I have learned a valuable lesson!

Thanks again!
 
Hehe, you all had the same problem as me, you should have just read my solution! lol
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top