libapache-mod-jk under sarge

Sarge installation. Apache is 1.3.x (packaged). JBoss is 3.2.7 with tomcat.

Aim: ajp13 working

For each (or at least several) virtual host under apache we have an equivalent webapp running under jboss. We'd like to use apache as the front end server.

So - here's an example app URL:

http://hostname:8080/app/

This should be accessable under

http://hostname/app/

mod_rewrite will be used to handle

http://hostname/ -> http://hostname/app/

since some things are apache only (awstats etc).

First - get libapache-mod-jk installed

apt-get install libapache-mod-jk

Then - to httpd.conf - near the end but before the include of conf.d add

<IfModule mod_jk.c>
JkWorkersFile /etc/libapache-mod-jk/workers.properties
</IfModule>

Finally - in the virtual host config for each virtual host (we use separate files under conf.d) add

# Set up the ajp13 link
JkMount /app/* local
JkMount /app local
# mod_rewrite required
RewriteEngine on
# Don't rewrite if app is already there - /app/app/app etc is not fun
RewriteCond %{REQUEST_URI} !^/app
# For any other paths that apache should handle directly e.g. awstats,
# webalizer, any php stuff add similar lines to this one here
RewriteCond %{REQUEST_URI} !^/log
# Then handle anything that should be sent to the ajp13 redirect
RewriteRule ^/(.*) http://hostname/app/$1 [R]

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <embed> <object> <strike> <caption>
  • Lines and paragraphs break automatically.
  • Replace [debbug:xxxxx] with a link to the relevant debian bug.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Insert Flickr images: [flickr-photo:id=230452326,size=s] or [flickr-photoset:id=72157594262419167,size=m].
  • You may link to Gallery2 items on this site using a special syntax.
  • Insert Google Map macro.
  • Images can be added to this post.
  • You can link nodes to other nodes using the following syntax:
    [node:node_id,param_1="val1",param_2="val2"]

More information about formatting options