Linux Manju

November 19, 2009

Tomcat Name Based Virtual Hosting How to

Filed under: Uncategorized — Tags: , , , , — linuxmanju @ 1:13 am

Confluence :- A feature rich Wiki/ Document Management system from atlassian

Jira:- An Excellent Bug/ Issue Tracking system.

Challenge is to run Both with a single instance of tomcat

Tomcat Name Based Virtual Hosting How to ( For Yellow.ec2.example.com Jira along with Confluence )

Intended Audience:- Sysadmin

Goal:- Is to achive Confluence and Jira parallelly in the same system

Pre-Requisites:- Tomcat, Apache with Mod_jk, DNS entry for 1) support.example.com 2) CNAME/IN for docs.example.com, Latest Stable Build of Confluence and Jira .

Aproaches and Challenges:-

There are two different approaches one can take for this.

a) Run  Two tomcat instances one each for Jira and Confluence ( Built in Tomcat with the applications ) in two different ports, Add proxy pass or configure Mod_jk Redirection with Name Based Virtual Host setup in Apache

Drawback of the above setup:-

Server Overhead as there would be two tomcat instances, Separate Rewrite rules for each Container No system wide defaults.

b) Second approach would be to configure one of the Tomcat instance ( Either Jira or Confluence ) to serve both the Containers ( Jeera as well as Confluence )

The second approach is better as compared to the first one as a) No additonal system over head ( 1 Tomcat Insatnce per server ) 2) Single System wide configuration of Apache/ Mod_jk.

For this document we will go with the second approach.

Server Setup:- Install Ubuntu Jaunty, Install Java, Create user jira, Configure JAVA_HOME pointing to JDK installation root path ( For eg.. /usr/local/java ) in .bashrc

Download Jira and Confluence from Atlassian, Untar it in /mnt/ebs

tar zxvf jira*.tgz -C /mnt/ebs

tar zxvf confluence*.tar.tgz -C /mnt/ebs

Configure jira and mod_jk in apache su - jira ( Will be covered in a different Document )

Run the jira and test the setup.

Create a Directory for confluence data

mkdir -p /mnt/ebs/confluencedata

Change ownership to user jira

chown -R jira  /mnt/ebs/{confluence*,jira*}

Configure Confluence:-

Open /mnt/ebs/confluence*/confluence/WEB-INF/classes/confluence-init.properties

Add a line which reads like below

Configure Name Based Virtual Containers in Tomcat:-

open /mnt/ebs/jira*/conf/server.xml

Locate the line which reads

<engine name=”Catalina” defaultHost=”localhost” >

Change it to

<engine name=”Catalina” defaultHost=”support.example.com”>

Locate the line which reads

<host name=”localhost” appbase=”webapps” unpackWARs=”true” autoDeploy=”true”>

Change it to

<host name=”support.example.com” appbase=”webapps” unpackWARs=”true” autoDeploy=”False”>

Go to the end of </Host> and insert the below lines for Confluence setup

<Host name=”docs.example.com” debug=”0″ appBase=”/mnt/ebs/confluence-3.0.2-std/webapps” unpackWARs=”true” autoDeploy=”False”>

<Context path=”/mnt/ebs/confluence-3.0.2-std/confluence” debug=”1″  >

<Manager pathname=” ” >

</Context>

</Host>

Add additional hostnames in /mnt/ebs/www/conf/000-default ( Optional .. Speeds up performance by eliminating Reverse Lookup for each new request)

Restart tomcat..

su - jira -C  “./ $HOME/.bashrc && /mnt/ebs/jira*/bin/startup.sh

If all is well you should be able to access Jira on http://support.example.com and Confluence at http://docs.example.com

8 Comments »

  1. Valuable thoughts and advices. I read your topic with great interest.

    Comment by Peter — November 22, 2009 @ 12:33 am

  2. It was a very interesting post thanks for writing it!

    Comment by Unknown — November 24, 2009 @ 1:29 pm

  3. I liked it. So much useful material. I read with great interest.

    Comment by John — November 30, 2009 @ 10:40 am

  4. Не в этом суть….

    Intended Audience:- Sysadmin
    Goal:- Is to achive Confluence and Jira parallelly in the same system
    Pre-Requisites:- Tomcat, […….

    Trackback by Alex Gordon — April 8, 2010 @ 3:17 pm

  5. Как раз то, что нужно, буду участвовать. Вместе мы сможем прийти к правильному ответу….

    Intended Audience:- Sysadmin
    Goal:- Is to achive Confluence and Jira parallelly in the same system
    Pre-Requisites:- Tomcat, […….

    Trackback by Kylie Batt — April 21, 2010 @ 1:07 pm

  6. В этом что-то есть. Благодарю за помощь в этом вопросе, теперь я не допущу такой ошибки….

    Confluence :- A feature rich Wiki/ Document Management system from atlassian
    Jira:- An Excellent Bug/ Issue Tracking system…..

    Trackback by Kylie Batt — May 4, 2010 @ 9:12 pm


  7. Medicamentspot.com. Canadian Health&Care.No prescription online pharmacy.Special Internet Prices.Best quality drugs. High quality pills. Buy drugs online

    Buy:Cialis Soft Tabs.Maxaman.Viagra Soft Tabs.Viagra Professional.Cialis Super Active+.Tramadol.Zithromax.Cialis.Cialis Professional.VPXL.Viagra.Viagra Super Force.Viagra Super Active+.Soma.Propecia.Levitra.Super Active ED Pack….

    Trackback by ANGELO — July 21, 2010 @ 3:52 am

  8. solar http://ysolarci.AUTOTECHGUIDE.INFO/tag/door+light+solar+lights/ : lights…

    light…

    Trackback by lights — August 30, 2010 @ 8:32 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress