Google
Tech-Bits: Configuring and setting ProxyHTMLURLMap for Reverse Proxy with Apache2.2 on WindowsXP

Saturday, March 26, 2005

Configuring and setting ProxyHTMLURLMap for Reverse Proxy with Apache2.2 on WindowsXP

ProxyHTMLURLMap - it rewrites links in the served webpages from the server which is being proxied.
But For enabling ProxyHTMLURLMap we need mod_proxy_html.so in your modules directory.

Steps:
download the package http://www.apachelounge.com/download/mods/mod_proxy_html-3.1.2-w32.zip
The install-help is in the readme.txt available in the zip, and I have detailed it here.

1. Create folder .../apache2/modules/mod_proxy_html
and copy mod_proxy_html.so

2. Install the Visual C++ 2008 Redistributable Package
Download, it from:
www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en

3. A couple of pre-requisite dll's are needed on Windows.

4. Get the following from ftp://ftp.zlatkovic.com/libxml/
- libxml*.zip
- zlib*.zip
- iconv*.zip

5. Unpack the zip to extract the following files to the mod_proxy_html folder created above.
- iconv.dll
- zlib.dll
- libxml2.dll

6. Add to your httpd.conf
LoadModule headers_module modules/mod_headers.so
LoadFile modules/mod_proxy_html/iconv.dll
LoadFile modules/mod_proxy_html/iconv.dll
LoadFile modules/mod_proxy_html/iconv.dll
LoadModule proxy_html_module modules/mod_proxy_html.so

Now you're ready to work with Html re-writes.

An example configuration along with proxy pass is:


ServerName externaldns.com
ProxyRequests Off
ProxyPreserveHost Off

Order deny,allow
Allow from all

ProxyPass /uk http://internal-server:8080/UK/
ProxyPass /us http://internal-server:8080/NA/
ProxyHTMLURLMap http://internal-server:8080/UK
ProxyHTMLURLMap http://internal-server:8080/NA

ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /uk
ProxyHTMLURLMap /uk /uk
RequestHeader unset Accept-Encoding



ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /na
ProxyHTMLURLMap /na /na
RequestHeader unset Accept-Encoding



0 Comments:

Post a Comment

<< Home