Bug 663248

Summary: mod_proxy_ajp does not use connection pooling because of RewriteRule
Product: Red Hat Satellite 5 Reporter: Alan Evans <alanwevans>
Component: ServerAssignee: Jan Pazdziora <jpazdziora>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Korbel <mkorbel>
Severity: medium Docs Contact:
Priority: low    
Version: 540CC: cperry, gbock, jpazdziora, mkorbel, sean, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-01 21:53:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 924232    

Description Alan Evans 2010-12-15 06:16:35 UTC
In /etc/httpd/conf.d/zz-spacewalk-www.conf the use of RewriteRule prevents mod_proxy_ajp from pooling connections to tomcat.

Adding the following will cause mod_proxy_ajp to hold open connections to tomcat.

<Proxy ajp://localhost:8009>
  ProxySet min=1
</Proxy>

Additionally changing from RewriteRule to ProxyPass and ProxyPassReverse would enable connection pooling.

Not being certain what the best ProxyPass rule would be I have opted for the first method, setting the defaults for ajp://localhost:8009.

We have been using this configuration for 4-5 weeks now with no trouble but the performance of our Satellite server is greatly improved.

Could the Apache configuration be modified in later releases to either use ProxyPass or set defaults for the ajp://localhost:8009 connector?

Regards,
-Alan

Comment 1 Jan Pazdziora 2012-10-29 12:39:49 UTC
Applied to Spacewalk master, 7d9fbde0f16aa988a2b4194d4e028ef2e9a9d96e.

Comment 3 Martin Korbel 2013-09-26 05:33:58 UTC
VERIFIED   on spacewalk-config-2.1.1-1.el6sat (Sat5.6.0)
REPRODUCED on spacewalk-config-1.7.2-3.el6sat (Sat5.5.0)
FIXED      on spacewalk-config-1.8.5-1

> cat /etc/httpd/conf.d/zz-spacewalk-www.conf
Sat5.6.0:
...
# increase timeout on proxy requests
ProxyTimeout 210

<IfModule proxy_ajp_module>
<Proxy ajp://localhost:8009>
  ProxySet min=1
</Proxy>
RewriteRule ^/rhn(.*) ajp://localhost:8009/rhn$1 [P]
</IfModule>

RedirectMatch ^/renew/.* http://rhn.redhat.com
RedirectMatch ^/index\.html$ /rhn/Login.do
...


Sat5.5.0:
...
# increase timeout on proxy requests
ProxyTimeout 210

<IfModule proxy_ajp_module>
RewriteRule ^/rhn(.*) ajp://localhost:8009/rhn$1 [P]
RewriteRule ^(/.*\.(do|jsp)(\?.*)?)$ ajp://localhost:8009/$1 [P]
</IfModule>

RedirectMatch ^/renew/.* http://rhn.redhat.com
RedirectMatch ^/index\.html$ /rhn/Login.do
...

Comment 4 Clifford Perry 2013-10-01 21:53:03 UTC
Satellite 5.6 has been released. This bug was tracked under the release.  

This bug was either VERIFIED or RELEASE_PENDING (re-verified prior shortly
before release). 

Moving to CLOSED CURRENT_RELEASE. 

Text from Upgrade Erratum follows:

Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2013-1395.html