Skip to content

mod_rewrite and redirecting to mod_jk URLs

December 18, 2008

I was setting up a tomcat server for a company which was trying to host various softwares (jira, confluence wiki, alfresco) on a single tomcat so none of these apps where in the root context of tomcat rather in “/jira”, “/wiki” etc. My setup is using a front end apache httpd 2.2 on ubuntu box with mod_jk. Here is my config to preserve none-root context for these apps and still use vhost domains to reach each of these apps (e.g

<VirtualHost x.y.z.w:80>
        DocumentRoot /

        ErrorLog /var/log/apache2/jira-error.log
        LogLevel warn
        CustomLog /var/log/apache2/jira-access.log combined

        RewriteEngine on
        RewriteLog /var/log/apache2/jira-rewrite.log
        RewriteLogLevel 3
        RewriteRule "^/(.[^jira])*$" "/jira/$1" [PT]

        # JK
        JkMount /* jira

This redirects “; to “; and tomcat remains happy :)

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

<span>%d</span> bloggers like this: