mod-proxy

Tomcat fails on first request in combination with jsvc

I have a web application where the first request may take a few seconds as some singletons are initialised. I've used the mod_proxy and jsvc construction mentioned in this question and described on this page to connect apache with tomcat (data is served via SSL) For the sample Tomcat application, everything works as it should. However,...

How to log the request mod_proxy makes through a reverse proxy

I'm can't figure out why I cannot get the reverse proxy for a particular (remote) website to work. (nb: the reverse proxy works for a number of other websites). I can access static files on that website through the proxy, but for some reason the homepage and other pages give a 404, "the page that you were looking for does not exist" Wh...

apache protocol redirect

Is it possible to have apache get a request like whateverProtocol://localhost and redirect it to http://localhost? Thanks in advance. Update: Thank you for the answers. Specifically, I am trying to redirect ldap : // localhost to http : // localhost -- and I believe ldap may be recognized by mod_rewrite. But no luck so far using Rewri...

web apps on localhost on different ports accessed via port 80

On my laptop, with Apache I have different web apps in various directories on my laptop, that I can start using simple webservers listening on different ports. For example ~/app1/./app.pl >> listening on http://localhost:3000/ ~/app2/./app.pl >> listening on http://localhost:3001/ ~/app3/./app.pl >> listening on http://localhost:3001...

Application error passthru when using apache mod_proxy

Heyas. I'm using mod_proxy with apache2 provide vhost ability to multiple servlet apps running on the local machine. It works fine, for the most part. Requests come into apache then are directed to the application bound on a port on localhost. The app receives the request and responds, which is delivered back to the client by apache....

Apache mod_rewrite and multiple domains

Hi, I'm trying to use mod_rewrite to map multiple domains to different servlets on one host. Example: www.dom1.com -> 192.168.1.n/dom1 www.dom2.com -> 192.168.1.n/dom2 ... I'm using the mod_rewrite and mod_proxy and VirtualHost directive but it seems that the reverse mapping via ProxyPassReverse doesn't work as I expected. Pr...

Tomcat cookies not working via my ProxyPass VirtualHost

Hi there. I'm having some issues with getting cookies to work when using a ProxyPass to redirect traffic on port 80 to a web-application hosted via Tomcat. My motivation for enabling cookies is to get rid of the "jsessionid=" parameter that is appended to the URLs. I've enabled cookies in my context.xml in META-INF/ for my web applica...

apache front end using mod_proxy_ajp to tomcat on different servers

Anyone knows the steps to run Apache on server A as front end and run mod_proxy_ajp to connect to tomcat instances on server B? I want to run apache on sever A to do name based vhost that connects to many tomcat servers. I can run mod_proxy_ajp, only if apache and tomcat are on the same server. What I've tried so far: In server A, run...

Apache mod_proxy and https

Can I use Apache mod_proxy to proxypass a http url to a https url? For example, proxypass /app/ to https://example.com:7777 ...

How to solve JavaScript origin problem with an application and static file server

In a system that I'm building I want to serve Static files (static HTML pages and a lot of images), and Dynamic XML generated by my servlet. The dynamic XML is generated from my database (through Hibernate) and I use Restlets to serve it in response to API calls. I want to create a static file server (e.g. Apache) so that this does n...

Apache, include correct "Server" header when proxying

I got the following section in mine httpd.conf <virtualhost *> ServerName my.domain.com ProxyRequests off ProxyPass / http://192.168.1.193/ ProxyPassReverse / http://my.domain.com </virtualhost> The problem is that apache replaces the "Server" header with it's own IP address. How do I force it to use "my.domain.com" in...

Running rails app, want to serve /blog from another server

Hi all, I'd like to server /blog from http://blog.domain.com. I'm using apache 2, rails 2.3, and passenger on ubuntu. I've tried this in the virtual host: <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /blog http://blog.domain.com/ ProxyPassReverse /blog http://blog.domain.com/ But it's not proxying, it's trying to...

mod_proxy_ajp and Location headers

Recently I had to install a Java application for a client using Tomcat6. The application needed to run from the root of their domain so I also installed apache2 and mod_proxy_ajp to set up a proxy to make this work. After a bit of massaging and googling to deal with Location Headers including the original path of the servlets rather tha...

Apache: how to setup in Apache/mod_proxy an upper bound on the number of concurrent forwarded requests?

I have a fairly standard setup where a front-end Apache server forwards requests to Tomcat through mod_proxy/AJP. How can I setup Apache/mod_proxy so it only forwards at most N (say, N=4) concurrent requests to Tomcat? Other concurrent requests coming into Apache should not be rejected, and should instead be queued to later be sent to To...

How do I enable sticky load balancing based on session identifiers using apache mod_proxy_balancer

Our proxy configuration (in httpd.conf) to send requests to 2 JBoss instances are given below is based on mod_proxy_balancer <Proxy balancer://mycluster> Allow from all BalancerMember http://192.168.1.2:9080 BalancerMember http://192.168.1.2:8080 </Proxy> ProxyPass /app balancer://mycluster/app ProxyPassReverse /app http://192.168.1.2...

Apache: ProxyPass max parameter has no effect

I am using the following Apache config to forward requests to a Tomcat server: ProxyPass /myapp ajp://localhost:8009/myapp max=2 This is a simplified config, but is enough to reproduce the issue, which is that the max parameter has no effect. If I through 10 concurrent requests to Apache, all 10 are forwarded to Tomcat at the same tim...

Apache stripping comments from html

I have a deployment where Apache forwards to Tomcat running on the same system. I'm running into a situation where Apache is stripping out comments in html returned by Tomcat. This is causing lines like the following to be removed causing the js to fail on IE: "<!--if IE><script language="javascript" type="text/javascript" src="/scripts...

Mapping domains in a forward proxy

I'm currently running apache on my local machine as a forward proxy server. The config is pretty simple: ProxyRequests On ProxyVia On <Proxy *> Order deny,allow Allow from all </Proxy> However, if a user uses my proxy, I'd like to be able to map certain domains (without touching my hosts file or DNS) to certain directories o...

Keep rails running under mod_proxy

I have a shared host using hostgator and I run my app using mod_proxy because FCGI doesn't really cut it. How can I ensure that if mongrel crashes or stops running that it will be restarted? ...

Adding decision logic to Apache's mod_proxy_balancer with Memcache

Hi, What I am trying to achieve is to have Apache's mod_proxy_balancer check if a request was already made using a Memcache store. Basically: Streaming media request comes in. Check if streaming media has already been served with Memcache. If so, can that streaming media server handle another request. If so send request to said streami...