use mod_proxy, much easier, and in our tests has proven to scale better, and you will wanna look for a directive called ProxyHostPreserve so that request.getServerName returns the right name, then the IP address will be stored in x-forwarded-for header in the HTTP request.
Filip > Hello Everyone, > > I have successfully configured Apache to forward requests to my Tomcat > instance. But it does so...only for requests whose IP resolves to > 127.0.0.1 > > If I try to access a page through apache server (that's actually on > tomcat) > with the outside-facing-ip of my computer it fails. > > For example: > 1) URL: "http://12.34.56.78:666/blah/serveMe.html" FAILS with a > 404 (apache does not forward properly) > > 2) URL: "http://12.34.56.78:8080/blah/serveMe.html" SUCCEEDS > (tomcat seems to be ok when it gets the request directly, so it has to be > a > forwarding failure by apache in the previous case) > > 3) URL: "http://my.domain.com:666/blah/serveMe.html" SUCCEEDS (I have > " > my.domain.com" mapped to "127.0.0.1" in my windows' hosts file) > > 4) URL: "http://localhost:666/blah/serveMe.html" SUCCEEDS > > I think this happens because the 1st request (the one with the outside > facing ip) is not forwarded to Tomcat by apache. > a) The apache error logs show that Apache is trying to look for the page > in > the wrong place > b) The access logs ofcourse show a 404 because it can't find the page to > serve > > Now, I have read a few threads and been on a few forums and apparently my > worker.properties file is supposed to be as simple as this: > ------------------------ > worker.list=ajp13 > worker.ajp13.port=8009 > worker.ajp13.host=my.domain.com > worker.ajp13.type=ajp13 > ----------------------- > > I also tried putting my outside-facing-ip and localhost as values for " > worker.ajp13.host" but it didn't seem to make any difference at all. > > In that case I must ask all of you: > Question 1: How do I go about configuring apache to forward the > outside-facing-ip requests to Tomcat? If it is not done in > workers.properties...then where is it handled? > Question 2: Or am I wrong and it is actually handled by > workers.properties? > Even then, how? > > Thanks in advance to all those who answer and all those who take the time > to > read this. > > Cheers, > - Pulkit > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]