mod-proxy

Best practices for configuring Apache / Tomcat

We are currently using Apache 2.2.3 and Tomcat 5 (Embedded in JBoss 4.2.2) using mod_proxy_jk as the connector. Can someone shed some light on the the correct way to calculate / configure the values below (as well as anything else that may be relevant). Both Apache and Tomcat are running on separate machines and have copious amounts of...

Apache sockets not closing?

I have a web application written using CherryPy, which is run locally on 127.0.0.1:4321. We use mod-rewrite and mod-proxy to have Apache act as a reverse proxy; Apache also handles our SSL encryption and may eventually be used to transfer all of our static content. This all works just fine for small workloads. However, I recently used...

Bad Gateway 502 error with Apache mod_proxy and Tomcat

We're running a web app on Tomcat 6 and Apache mod_proxy 2.2.3. Seeing a lot of 502 errors like this: Bad Gateway! The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /the/page.do. Reason: Error reading from remote server If you think this is a ser...

How to confire Apache to work as proxy (load balancer) for j2ee server?

Hi, there. I have apache web server installed as frontend and I have j2ee SAP Netweaver Application Server installed in Intranet server. How can I configure apache to forward requests and response to/from j2ee app server. for example, external apache server's ip is 9.20.1.1:80. internal sap server's address is 192.168.0.1/sap/bc/gui/sap...

How do I send users to a different "site" in Apache while also using mod_proxy?

I have a web site that I administer that uses Apache 2.0 on the front with Tomcat 6 on the back-end (with mod_proxy proxying the connection between the two). I want to be able to use the same VirtualHost to also access the phpMyAdmin application running on the box. So, for example, www.mywebsite.com will pass all traffic to Tomcat, but ...

Using Apache proxy to foward traffic to tinyproxy

I need to find a way to proxy some traffic on port 80 to tinyproxy running on a separate port. We have a client working behind a very strict firewall with only port 80 open (and cannot get to sites like meebo.com, etc). I was hoping I could create a CNAME to our domain and a virtual host on apache, catch the request for that new CNAME an...

Apache2 Reverse Proxy to an end-point that requires BasicAuth but want to hide this from user

Basically my scenario is that I have an internal website that requires a SINGLE hard-coded username and password to access (and this can't be turned off, only changed). I am exposing this website through a reverse proxy for various reasons (hiding the port, simplifying url, simplifying NAT, etc). However, what I would like to do is be ...

RewriteRule, Proxy directive [P] - Is it possible to make request use actual proxy host?

Hello Everybody Does anyone know whether it is possible to make rewrite rules which use the proxying [P] directive, as shown below, to behave like ProxyPass used in conjunction with ProxyPreserveHost Off. In other words I want the server on mydomain.net to see a request for mydomain.net not mydomain.com. RewriteCond %{HTTP_HOST} ^myd...

Help me understand how to use ProxyPass

UPDATE: I added a revised question after playing around with it two answers below. Hi there, If you're reading this you're probably familiar with Apache's mod_proxy and its ProxyPass function. Like many others, I have the issue of having an application that I can access from outside our internal network, but that application itself acc...

Redirect URL path to forward to tomcat servlet using Apache/mod_proxy

I currently have a tomcat servlet 1 running under the ROOT: api1.myhost.com:8080/ I'm using mod_proxy and simply forwarding all requests from api1.myhost.com to this instance. This is working as of today. I now have installed a second servlet 2 which runs under the same instance of tomcat (same IP address): www.myhost.com:8080/servle...

Issues Setting up a reverse proxy in Apache

My roommate and I each have a separate webserver we are trying to set up. We are trying to use mod_proxy so that his server will forward requests to my machine (we have two seperate machines behind one router) based on the server name. I've given the basics of what we have in our apache config currently but we are getting a 403 Forbidden...

Setting up an Apache Proxy with Authentication

I need to set up a proxy with authentication to verify the behavior of an application that connects to the internet. I am trying to set-up an Apache installation with forward proxy and authentication, and even though I am close to make it work, I wonder if there is maybe a better way, as the configuration is fairly esoteric. How can Ap...

Risk of using Apache mod_proxy

I am now exploring to use Apache's mod_proxy's directive, eg ProxyPass, as part of solution for cross-domain scripting restriction (for html/ajax/flash code). However, I am afraid by enabling mod_proxy, I would risk having the server as open proxy. What's the risk, and how to minimize the risk, in short? Thanks. ...

mod_proxy time-outs (502) and failovers

Hi, so we're running a cluster of 2+ backend servers (happend to be JBoss servers) that are being load-balanced by an Apache 2.2. From time to time it can happen that the backend servers become unresponsive (meaning they'll wait ages to reply to a request, but don't close the connection immediately). This will naturally end up in a 502 ...

Mixing RewriteRule and ProxyPass in Apache

I was working on debugging an issue today related to mixing mod_proxy and mod_rewrite together and I ended up having to use balancer://mycluster in the RewriteRule in order to stop receiving a 404 error from Apache. I have two questions: 1) Is there any other way to get the rewritten URL to go through the balancer without adding balance...

Is there any mod_proxy equivalent for tomcat?

I'm trying to run modified JWChat (a simple javascript based jabber client) on tomcat 5.5. This application is based on ajax, and uses http binding in order to communicate with the jabber server (I'm using openfire). When running it on apache server, it requires redirecting of the requests to the http-bind using mod_proxy and it works. ...

How can I set up a reverse proxy with mod_proxy without redirecting?

How can I set up a reverse proxy with mod_proxy without redirecting to another server or IP? This will be a virtual host environment. The reason I want to do this is so that mod_proxy handles the communication with the client's browser thereby freeing up web server processes to serve the next request instead of feeding the client's brow...

Apache Config to send sub dirs to different servers - mod_proxy

We use Apache as a reverse proxy server. This has been working well, but I now need to have http://domain.com/sub1 proxy to serverA and http://domain.com/sub2 proxy to serverB. Is this possible? If so, what is the config for it? Here is my existing config: ... <VirtualHost 555.55.555.555:80> ServerName domain.com DocumentRoot c:/d...

Apache mod-proxy load balancer maintenance

I have mod-proxy and mod-proxy-balancer setup as a load balancing reverse proxy. Something like this: <Proxy balancer://example> BalancerMember http://hostname:8000 keepalive=on BalancerMember http://hostname:8001 keepalive=on </Proxy> ProxyPass / balancer://example/ ProxyPassReverse / balancer://example/ ProxyPreserveHost on P...

JkMount and ProxyPass

Hi, it's possible to convert a proxypass directive like this: ProxyPass /abc.html ajp://127.0.0.1:8009/eeff/tttt/abc.html using JkMount ? something like JkMount /abc.html ... or do I need to use mod_rewrite before the JkMount (used to balance the requests) ? Thank you ...