User Tools

Site Tools


mod_proxy_ajp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
mod_proxy_ajp [2012/04/20 16:46]
k2patel created
mod_proxy_ajp [2012/04/20 16:56]
k2patel [My Configuration]
Line 4: Line 4:
 But we had some old services require it and we down to road for mod_proxy_ajp.\\ But we had some old services require it and we down to road for mod_proxy_ajp.\\
 alternatively you can choose [[http://​www.jboss.org/​mod_cluster | mod_cluster]].\\ alternatively you can choose [[http://​www.jboss.org/​mod_cluster | mod_cluster]].\\
 +
 +==== Documentation ====
 +[[http://​httpd.apache.org/​docs/​2.2/​mod/​mod_proxy_ajp.html | mod_proxy_ajp]]
 +
 +==== quick explanation / observation ====
 +This module does not monitor services.\\
 +But it does checking before service request if it fails it fall back to next node.\\
 +
 +=== = ===
 +
 +Sticky session can be used by setting variable name to stickysession there is many way to define it.\\
 +but result will be same.\\
 +
 +<code bash>
 +stickysession=JSESSIONID
 +</​code>​
 +
 +=== = ===
 +
 +Balancer Manager is a satus page just like info-page or status-page from mod_status.\\
 +
 +<code bash>
 +/​balancer-manager
 +</​code>​
 +
 +=== = ===
 +
 +If you receive error as shown below.
 +
 +<code error>
 +[error] (70014)End of file found: ajp_ilink_receive() can't receive header
 +[error] ajp_read_header:​ ajp_ilink_receive failed
 +[error] (120006)APR does not understand this error code: proxy: read response failed from (null) (localhost)
 +</​code>​
 +
 +Mostly likely you need to set packet size on jboss. **packetSize="​20000"​**
 +
 +<code xml | server.xml>​
 +  <​Connector port="​8009"​ address="​${jboss.bind.address}"​
 +         ​enableLookups="​false"​ redirectPort="​8443"​ debug="​0"​
 +         ​protocol="​AJP/​1.3"​ packetSize="​20000"/>​
 +</​code>​
 +
 +==== My Configuration ====
 +
 +<code httpd>
 +LoadModule proxy_ajp_module modules/​mod_proxy_ajp.so
 +
 +#
 +# When loaded, the mod_proxy_ajp module adds support for
 +# proxying to an AJP/1.3 backend server (such as Tomcat).
 +# To proxy to an AJP backend, use the "​ajp://"​ URI scheme;
 +# Tomcat is configured to listen on port 8009 for AJP requests
 +# by default.
 +#
 +
 +
 +# Uncomment the following lines to serve the ROOT webapp
 +# under the /tomcat/ location, and the jsp-examples webapp
 +# under the /examples/ location.
 +#
 +#ProxyPass /tomcat/ ajp://​localhost:​8009/​
 +#ProxyPass /examples/ ajp://​localhost:​8009/​jsp-examples/​
 +
 +
 +<​VirtualHost 10.0.1.5:​80>​
 +ServerName linux4
 +<Proxy balancer://​cluster>​
 +Order deny,allow
 +Allow from all
 +
 +BalancerMember ajp://​localhost:​8009/​Untitled1 route=node1
 +BalancerMember ajp://​localhost:​8010/​Untitled1 route=node2
 +
 + 
 +ProxySet maxattempts=1
 +ProxySet stickysession=JSESSIONID
 +ProxySet timeout=300
 +</​Proxy>​
 +
 +ProxyIOBufferSize 19000
 +LimitRequestFieldsize 18000
 +ProxyTimeout 300
 +ProxyStatus Full
 +
 +ProxyPass /Untitled1 balancer://​cluster/​
 +#​ProxyPassReverse /Untitled1 http://​linux4/​Untitled1
 +
 +<​Location /​balancer-manager>​
 +SetHandler balancer-manager
 +Order Deny,Allow
 +Deny from all
 +Allow from localhost
 +Allow from 10.0.0.0/4
 +</​Location>​
 +
 +</​VirtualHost>​
 +</​code>​
mod_proxy_ajp.txt ยท Last modified: 2020/08/10 02:35 (external edit)