1. Extract httpd-2.4.10-win64-VC11.zip from apachelounge or apachehaus 2. Extract tomcat (ie. apache-tomcat-7.0.57-windows-x64.zip) 3. Configure httpd: - enable mod_proxy - enable mod_proxy_ajp - configure connection to tomcat: ProxyPass / ajp://127.0.0.1:8009/ ProxyPassReverse / ajp://127.0.0.1:8009/ 4. Start tomcat. 5. Start httpd. 6. Open http://localhost/ by browser. 7. Observe number of TCP connections using: netstat -an when refreshing the page. Each new connection from httpd to tomcat creates new TCP connection (ie. 127.0.0.1:56233->127.0.0.1:8009). All of them have TIME_WAIT status and are destroyed by OS after 4 minutes (default value of TcpTimedWaitDelay on windows). In extreme, number of TCP connection will exceed windows limit (by default it's ~14K). I confirmed that by sending lots of request to apache one by one. I have check the same scenario using apache 2.2 on windows, and apache 2.4 on linux. It works it different way. Httpd creates few connections to tomcat and reuse them. They have ESTABLISHED status. Occurs on Windows 7 64bit, Windows Server 2008 R2 64bit.
trace?
Created attachment 32227 [details] trace8 log trace8 log file url attached. The log contains: - service startup - opening http://localhost/ by browser (9 connections was created) - pause - page refresh (F5), (9 new connections created) - shutdown
It seems like your proxy is hitting the "default worker" which is not reusable. It is kind of an internal concept to mod_proxy that bleeds out when you use anything more than the most basic ProxyPass (e.g. rewriterule [P]) [Tue Nov 25 16:22:49.359276 2014] [proxy:trace2] [pid 3336:tid 504] proxy_util.c(1937): [client ::1:51140] *: found reverse proxy worker for ajp://127.0.0.1/ http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#workers Are you sure the failing ones are mapped just by ProxyPass?
Created attachment 32228 [details] httpd.conf My problem came up with a more complicated configuration, but as you can see is also present when using almost default one. I have attached my httpd.conf to not have doubts. For comparison, I used httpd-2.2.29-win64.zip from apachelounge. Same configuration but no problem.
Do you need any additional information, or we can treat this problem as a bug?
Created attachment 32277 [details] Don't add default port (of any known scheme) to the name of proxy workers Since 8089 is default port for the AJP scheme, the canonicalization removes it from the URL, but the proxy worker name (URL) still contains it. Hence the failure to match the requested URL with the worker, and the use of the default worker (reverse proxy). Can you please try the attached patch? A workaround would be to not specify the port 8009 in the ProxyPass declaration: ProxyPass / ajp://127.0.0.1/ or ProxyPass / ajp://[::1]/
Not adding a standard port or adding a not-standard port works.
(In reply to Mario from comment #7) > Not adding a standard port or adding a not-standard port works. With (or without) the patch applied? (please don't change the status if you are are not the OP, it might work for you with the patch applied but nothing is commited in httpd yet).
Workaround works also for me (without default port of with not-standard). It will be hard to verify the patch for me, since this requires compiling apache on windows. I'll ask apachelounge for support.
Proposed for backport in r1644506.
Backported in 2.4.x in r1650655 Will be part of 2.4.11