Forum Moderators: phranque

Message Too Old, No Replies

Apache as a proxy

how configure apache to act as a proxy?

         

fjoc7

8:43 am on Mar 9, 2005 (gmt 0)

10+ Year Member



I have a an Apache in a server and I have a another web application in another server, but I want apache to be the one to serve the pages. So I need apacher recevie the request ask to the other server y receive the pages and server, but the client navigator, mustn´t change the url is visiting. I have been try almost a week and nothing. Any idea?
I tryed things like that:

RewriteRule ^/(.*) [ohter.server.my...] [PT]

ProxyRequests On
ProxyPass / [ohter.server.my...]
ProxyPassReverse / [ohter.server.my...]

this proxy option gives me a 500 error ¿?
if I comment ProxyPassReverse the requesta pass, but the URL change ...

many thanks to anyone that thinks about it...

regards

laurajbryson

2:10 pm on Mar 10, 2005 (gmt 0)

10+ Year Member



We have this working for our Apache servers, both front end and back end, using the ProxyPass modules. We don't use the rewriterule at all, ProxyPass 'rewrites' the urls.

I hate to state the obvious, but sometimes these things are not as obvious as they seem, so i'll start at the beginning according to what we did.

Make sure that you have the proxy modules turned on:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so

Then we configured these proxy settings as recommended on Apache's site (http://httpd.apache.org/docs-2.0/mod/mod_proxy.html#proxyrequests)

ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all

</Proxy>

Then we put the ProxyPass lines in like you have them. It may just be that you need to turn ProxyRequests to off instead of on.

Hope this helps.

fjoc7

4:02 pm on Mar 10, 2005 (gmt 0)

10+ Year Member



Hi,
thanks for your information. But you are speaking about apache 2, and I´m still working with apache 1.3.19.5.

Any other idea?

regards

laurajbryson

4:20 pm on Mar 10, 2005 (gmt 0)

10+ Year Member



Yes, we're using Apache 2. But it looks like Apache recommends ProxyRequests be turned off in version 1 too [httpd.apache.org...]

bcc1234

4:22 pm on Mar 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might want to use mod_rewrite's P flag, which uses the proxy module on the inside.

And yes, you should disable proxy pass for all url's.