Monday, 30 July 2007
mod_proxy_ajp: Simpler than mod_jk
« Getting mod_jk to work | Main | I-Phone: Do I want one »I happened to look in my /etc/httpd/conf/conf.d directory, and there by default is a file proxy_ajp.conf . Hmmm, what is this? Well it appears to be a simpler way of mapping a piece of the apache URL space onto tomcat's AJP connector. Instead of the previous posting, I reconfigured apache using proxy_ajp.conf like so:
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
ProxyPass /blog/ ajp://localhost:8009/blojsom/blog/spout/
<VirtualHost blog.bwtaylor.com:80>
ProxyPass /blojsom ajp://localhost:8009/blojsom
ProxyPass / ajp://localhost:8009/blojsom/blog/spout/
</VirtualHost>
I also went in to blojsom and changed the url properties accordingly. Note that stuff like CSS will be found under /blojsom, but the main blog can be hit directly at blog.bwtaylor.com . Or bwtaylor.com/blog . I still think mod_jk is "correct" in a few circumstances where it's fine grained controls might help. Under load, mod_jk is capable of just sending the servlets and JSP to tomcat, while serving the static content itself. However, for something like my blog, letting tomcat handle static doesn't create any problems. The above is pretty darn simple and very easy to understand, so I'm going with that.
Technorati Tags: tomcat apache mod_jk mod_proxy_ajp
[Trackback URL for this entry]
