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 -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: Beginner prblms configuring reverse proxy using _proxy_html
Author
srasane



Joined: 15 Jan 2008
Posts: 3

PostPosted: Tue 15 Jan '08 1:11    Post subject: Beginner prblms configuring reverse proxy using _proxy_html Reply with quote

Hi,

I have searched this user group for a simple sample that involves proxying an entire internal website using mod_proxy and mod_proxy_html, but did not find anything. I might just be dumb and the first to not be succesful in doing everything from the help page: http://apache.webthing.com/mod_proxy_html/config.html

Look I simply want to know how to achieve the following:
Objective: test mod_proxy to reverse proxying as it says it does
test: on local install of apache (httpd-2.2.8-win32-x86-ssl) and mod_proxy_html (mod_proxy_html-3.0.0-w32) to proxy www.google.com.au.

e.g. client calls up: http://localhost:8080/google -> brings up www.google.com.au and user can surf google through this portal


Result: Even without mod_proxy_html, the above works with simply mod_proxy_http etc.
ProxyPass /google/ http://www.google.com.au/
ProxyPassReverse /google/ http://www.google.com.au/

Issue (HELP!!):

The above does not rewrite links. I tried using mod_proxy_html like following:
Attempt 1:
ProxyHTMLURLMap http://www.google.com.au http://localhost:8080/google/
- With the above, the page loads, but the links are still not correct. for eg. the image does not load and it points to "http://localhost:8080/intl/en_au/images/logo.gif"

Attempt 2:
Not sure why the following ends up with "unable to load page" on browser and the url in browser changes to http://www.localhost.com:8080/google/

<Location /google/>
ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap /google /
RequestHeader unset Accept-Encoding
</Location>

Please help

Regards,
srasane
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Tue 15 Jan '08 10:52    Post subject: Reply with quote

a working example

Code:

ProxyPass /google http://www.google.com.au/
ProxyPassReverse /google http://www.google.com.au/
ProxyHTMLURLMap http://www.google.com.au/ /google

<Location /google>
ProxyPassReverse /
   SetOutputFilter    proxy-html
   ProxyHTMLURLMap    /   /google/
   ProxyHTMLURLMap    /google   /google
   RequestHeader     unset   Accept-Encoding
</Location>
Back to top
srasane



Joined: 15 Jan 2008
Posts: 3

PostPosted: Thu 17 Jan '08 4:52    Post subject: that did not work Reply with quote

Hi James Blond,

Thanks for the response.
I copied your settings in to my httpd.conf and tried with no success.

In fact as before http://localhost:8080/google did not load google.
when i commented your Location section, I got it to work but still without the google image coming through. I spent a day trying to work out why that would be, but i cannot figure out. on command line :
D:\Apache2\bin>httpd -t -D DUMP_MODULES
Loaded Modules:
core_module (static)
win32_module (static)
mpm_winnt_module (static)
http_module (static)
so_module (static)
actions_module (shared)
alias_module (shared)
asis_module (shared)
auth_basic_module (shared)
authn_default_module (shared)
authn_file_module (shared)
authz_default_module (shared)
authz_groupfile_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
cache_module (shared)
cgi_module (shared)
deflate_module (shared)
dir_module (shared)
disk_cache_module (shared)
env_module (shared)
headers_module (shared)
include_module (shared)
isapi_module (shared)
log_config_module (shared)
mem_cache_module (shared)
mime_module (shared)
negotiation_module (shared)
proxy_module (shared)
proxy_ajp_module (shared)
proxy_balancer_module (shared)
proxy_connect_module (shared)
proxy_ftp_module (shared)
proxy_http_module (shared)
proxy_html_module (shared)
rewrite_module (shared)
setenvif_module (shared)
Syntax OK

There are no specific logs from this module despite setting "LogLevel info" and "ProxyHTMLLogVerbose On"

Please help.

Regards,
srasane
Back to top
srasane



Joined: 15 Jan 2008
Posts: 3

PostPosted: Thu 17 Jan '08 7:33    Post subject: It works Reply with quote

All I had to do was use the settings you gave with a forward slash at the end of each "/google", like below and it works as expected :-)


Code:
ProxyPass /google/ http://www.google.com.au/
ProxyPassReverse /google/ http://www.google.com/

ProxyHTMLURLMap http://www.google.com /google/

<Location /google/>
                ProxyPassReverse /
   SetOutputFilter  proxy-html
   ProxyHTMLURLMap / /google/
   ProxyHTMLURLMap  /google/ /google/     
        RequestHeader    unset  Accept-Encoding
</Location>



Thanks for your help,
srasane
Back to top


Reply to topic   Topic: Beginner prblms configuring reverse proxy using _proxy_html View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules