|
Connecting Apache and Helma via mod_jk (AJP13) A how-to guide for configuring Helma's built-in Jetty AJP13 support. The following instructions guide you through the work necessary to access Helma through an Apache web server via the Tomcat AJP13 protocol. With the integration of Jetty this task has become much easier than it used to be. It is no longer necessary to install the full Apache Tomcat package. It is possible however to run both Tomcat and Helma/Jetty behind the same Apache server - configuration may even become easier if you already have mod_jk installed!
Note that for now you need the trailing slashes! Check out the mod_rewrite section below for how to create nicer URLs. Nicer URLs with Apache mod_rewritemod_rewrite is an Apache module for rewriting URLs of incoming requests before they're being served. You can see from the documentation that mod_rewrite is incredibly flexible and powerful. Below is a simple example of how mod_rewrite can be used to rearrange the URL space of a Helma application served by Apache.<VirtualHost 10.0.0.2:80> ... # mount Helma application at /gong JkMount /gong/* helma # activate the rewrite module RewriteEngine on # pass through requests to /images and /static directories RewriteRule ^/images(.*) /images$1 [L] RewriteRule ^/static(.*) /static$1 [L] # pass through requests ending with *.html RewriteRule ^/(.*\.html)$ /$1 [L] # everything else is handled by our gong application RewriteRule ^/(.*) /gong/$1 [L,PT] </VirtualHost>You'll have to change the baseUri property in apps/gong/app.properties to "/" in order to make Helma generate correct URLs. Note the [L] and [L,PT] at the end of the RewriteRules. L stands for "last" and means that no more RewriteRules will be evuated if the current pattern matches. PT stands for "pass-through" and makes sure the request is passed to the mod_jk module, which will eventually serve the request. If mod_rewrite does not work in combination with mod_jk, make sure you loaded mod_jk before mod_rewrite (see notes above).
... comment
jonno,
Saturday, 21. January 2006, 08:13
Thank you!
Thank you, thank you, thank you for such great documentation. I'm not actually using Helma at all, but Google led me here after an hour of tearing my hair out and trying to integrate Apache and Tomcat using mod_rewrite and mod_jk. Everything was in place except for the mod_jk/mod_rewrite ordering in LoadModule/AddModule directives. Since I'm no expert on Apache internals it would have taken me ages to work this out.
Jon ... link ... comment |
navigation
Download
Community
Weblog
Mailing Lists
IRC Channel
Documentation
Introductions
Tools
Reference
Project
Roadmap
Bug Reporting
Source
Wiki
Tags
Updates
Related Projects
search
|
||||