Main Content
mod_proxy and mod_proxy_ajp - httpd Archive - Originally posted on "The Horse's Mouth" - 2008-08-22 07:17:29 - Graham Ellis
Under Apache httpd version 2.2, mod_proxy_ajp provides a neat way for you to forward requests to an appropriately configured Apache Tomcat server using the more terse ajp protocol rather than the verbose http . Here are some sample configuration lines from httpd.conf, forwarding requests under the /coffee directory via http and requests under /whiskey via ajp.
ProxyPass /coffee http://192.168.200.153:9082/latmjdemo
ProxyPassReverse /coffee http://192.168.200.153:9082/latmjdemo
ProxyPass /whiskey ajp://192.168.200.153:9009/latmjdemo
ProxyPassReverse /whiskey ajp://192.168.200.153:9009/latmjdemo
This is purely a demo - you probably wouldn't mix them in this way in real life.
mod_proxy_ajp provides a quick and easy alternative to mod_jk if you're running Apache httpd 2.2 (or later in due course), but the example above lacks the flexibility of worker pools and the like that mod_jk provide. To some extend mod_proxy_balancer can help mod_proxy_ajp, but I would expect both mod_jk and mod_proxy_ajp to both have their own proponents and optimum uses
Some other articles
A608 - Apache httpd mod_proxy Distributed, Balanced and Clustered Load Sharing - the difference How can I run multiple web servers behind a single IP address? Simplest ever proxy configuration? Distributing the server load - yet ensuring that each user return to the same system (Apache httpd and Tomcat) Load balancing with sticky sessions (httpd / Tomcat) Apache, Tomcat, mod_proxy Three recent questions on Tomcat Convertors Virtual hosting and mod_proxy forwarding of different domains (httpd) Forwarding session and cookie requests from httpd to Tomcat mod_proxy_ajp and mod_proxy_balancer examples This article Strange behaviour of web directory requests without a trailing slash Choosing between mod_proxy and mod_rewrite Sharing the load with Apache httpd and perhaps Tomcat Apache httpd and Apache Tomcat together tips Clustering, load balancing, mod_rewrite and mod_proxy Apache httpd to Tomcat - jk v proxy A603 - Further httpd Configuration Identifying and clearing denial of service attacks on your Apache server Helping search engines with appropriate 400 error codes Building up from a small PHP setup to an enterprise one Forwarding a whole domain, except for a few directories - Apache http server Parse error: parse error, unexpected T_STRING on brand new web site - why? Apache Internal Dummy Connection - what is it and what should I do with it? An image from a website that occasionally comes out as hyroglyphics Redirecting a page - silent, temporary or permanent? How did I do THAT? Monitoring and loading tools for testing Apache Tomcat Database connection Pooling, SSL, and command line deployment - httpd and Tomcat Moving a directory on your web site How to avoid duplicating web page maintainance mod_rewrite for newcomers mod_proxy_ajp and mod_proxy_balancer examples Pointing all the web pages in a directory at a database This article WEB-INF (Tomcat) and .htaccess (httpd) Configuring Apache httpd What to do if the Home Page is missing User and Group settings for Apache httpd web server Strange behaviour of web directory requests without a trailing slash Default file (MiMe types) for Apache httpd and Apache Tomcat Online hotel reservations - Melksham, Wiltshire (near Bath) Which modules are loaded in my Apache httpd Using a MySQL database to control mod_rewrite via PHP Load Balancing with Apache mod_jk (httpd/Tomcat) .php or .html extension? Morally Static Pages Compressing web pages sent out from server. Is it worth it? Simple but effective use of mod_rewrite (Apache httpd) Sharing the load with Apache httpd and perhaps Tomcat httpd.conf or .htaccess? Passing GET parameters through Apache mod_rewrite Clustering, load balancing, mod_rewrite and mod_proxy To list a directory under httpd on a web server, or not? Using different URLs to navigate around a single script An unhelpful error message from Apache httpd Denial of Service ''attack'' Apache httpd to Tomcat - jk v proxy 2006 - Making business a pleasure Apache httpd - serving web documents from different directories Separating 'per instance' data from binaries and web sites Spotting a denial of service attack