You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tapan Maheshwari <ta...@yahoo.com> on 2010/04/23 17:47:30 UTC

[users@httpd] Configuring Reverse proxy with Apache Http Server2.2

I have installed Apache HttpServer (v2.2) on WindowsXP machine and trying to configure Reverse-Proxy within Apache HTTPServer, which will act as a proxy to an J2EE ApplicationServer(Weblogic) running on a SEPARATE Machine.
The application is installed on J2EE Server (including images, html pages, css, javascript etc), there is no content on Apache http server.
I could open the home page by typing http://localhost:8080/ , which opens up the home page from the j2ee application server, however the issues is that if any link or button is clicked on the homepage then it redirects to the j2ee server and browser displays the URL/IP of J2ee server which it should not as this is proxied.
It appears that the ProxyHTMLURLMap directive is not working properly, it is not able to rewrite the URL of j2ee server with the url of proxy server, these URL's which points to the J2EE server are contained in the Javascript (.js) & .css files and are not rewritten by ProxyHTMLURLMap directive
Following are the contents of httpd.conf
LoadModule headers_module modules/mod_headers.soLoadFile "C:\softwares\apachehttp\bin\iconv.dll"LoadFile "C:\softwares\apachehttp\bin\zlib1.dll"LoadFile "C:\softwares\apachehttp\bin\libxml2.dll"LoadModule proxy_module modules/mod_proxy.soLoadModule proxy_http_module modules/mod_proxy_http.soLoadModule proxy_html_module modules/mod_proxy_html.soLoadModule xml2enc_module modules/mod_xml2enc.soLoadModule rewrite_module modules/mod_rewrite.soInclude "conf/extra/proxy_html.conf"ProxyRequests off

ProxyPass /myapp/ http://myserver.com:7001/myapp/ProxyHTMLURLMap http://myserver.com:7001/myapp /myapp<Location /myapp/> ProxyPassReverse http://myserver.com:7001/myapp/ SetOutputFilter proxy-html ProxyHTMLURLMap /            /myapp/ ProxyHTMLURLMap /myapp      /myapp</Location>

Please help
Thanks & RegardsTapan


      

Re: [users@httpd] Configuring Reverse proxy with Apache Http Server2.2

Posted by Nick Kew <ni...@webthing.com>.
On Fri, 23 Apr 2010 08:47:30 -0700 (PDT)
Tapan Maheshwari <ta...@yahoo.com> wrote:

> I could open the home page by typing http://localhost:8080/ , which opens up the home page from the j2ee application server,

Not with the configuration you posted, which only proxies URLs under /myapp/.

Once you've sorted out your basics, turn up error logging to see what's
happening.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Configuring Reverse proxy with Apache Http Server2.2

Posted by GB GB <gb...@gmail.com>.
My apache server is dated, but this is what I did in order to make it work

in ssl.conf

client-->apache reverse proxy-->backend http application server


<VirtualHost 10.6.3.103:443>
ServerName mydomain.com
ServerAlias mydomain
ProxyBadHeader Ignore
ProxyRequests Off
#ProxyPreserveHost On
RewriteEngine On
SSLProxyEngine on


ProxyPass /lsw http://10.6.2.5:8082/lsw
<Location /lsw>
        ProxyPassReverse  http://10.6.2.5:8082/lsw
        RequestHeader    unset  Accept-Encoding
</Location>



On Fri, Apr 23, 2010 at 11:47 AM, Tapan Maheshwari <ta...@yahoo.com> wrote:
>
> I have installed Apache HttpServer (v2.2) on WindowsXP machine and trying to configure Reverse-Proxy within Apache HTTPServer, which will act as a proxy to an J2EE ApplicationServer(Weblogic) running on a SEPARATE Machine.
> The application is installed on J2EE Server (including images, html pages, css, javascript etc), there is no content on Apache http server.
> I could open the home page by typing http://localhost:8080/ , which opens up the home page from the j2ee application server, however the issues is that if any link or button is clicked on the homepage then it redirects to the j2ee server and browser displays the URL/IP of J2ee server which it should not as this is proxied.
> It appears that the ProxyHTMLURLMap directive is not working properly, it is not able to rewrite the URL of j2ee server with the url of proxy server, these URL's which points to the J2EE server are contained in the Javascript (.js) & .css files and are not rewritten by ProxyHTMLURLMap directive
> Following are the contents of httpd.conf
> LoadModule headers_module modules/mod_headers.so
> LoadFile "C:\softwares\apachehttp\bin\iconv.dll"
> LoadFile "C:\softwares\apachehttp\bin\zlib1.dll"
> LoadFile "C:\softwares\apachehttp\bin\libxml2.dll"
> LoadModule proxy_module modules/mod_proxy.so
> LoadModule proxy_http_module modules/mod_proxy_http.so
> LoadModule proxy_html_module modules/mod_proxy_html.so
> LoadModule xml2enc_module modules/mod_xml2enc.so
> LoadModule rewrite_module modules/mod_rewrite.so
> Include "conf/extra/proxy_html.conf"
> ProxyRequests off
>
> ProxyPass /myapp/ http://myserver.com:7001/myapp/
> ProxyHTMLURLMap http://myserver.com:7001/myapp /myapp
> <Location /myapp/>
>  ProxyPassReverse http://myserver.com:7001/myapp/
>  SetOutputFilter proxy-html
>  ProxyHTMLURLMap /            /myapp/
>  ProxyHTMLURLMap /myapp      /myapp
> </Location>
>
> Please help
> Thanks & Regards
> Tapan

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org