Jun 18 2010

Installing Atlassian Jira with Tomcat 6

thorque

Do you need a tracking system to track your requirements, issues and tasks? So you can look around – and maybe – your eyes keep on the famous Atlassian Jira. At first Jira is a bug tracker. You can create, manage and close bugs with Jira. But there is more:

  • Bug tracking
  • Manage your projects with Jira
  • Create your own workflows for tasks and issues
  • Powerful Reporting
  • Extensible with plugins

You can download a standalone version bundled with a Tomcat 5.5. With this download you can start directly. But typically you already have an infrastructure. For such scenarios it’s much better to use the WAR/EAR-Edition of Jira.

This article describes the installation with Apache Tomcat 6 on a Linux box. If you plan to do this on windows you only must change paths and – of course – shell against Windows Batch.

Install Tomcat

You can get Tomcat from the official projectsite. You get a ZIP- or TAR.GZ-Archive. Now you can extract the archive and do a testrun by browsing to http://localhost:8080.

If you want to deploy Jira to this instance of Tomcat you need some additional Jars not included in the web archive you will later deploy. You can get the additional jars from here. Create a new directory in you Tomcat installation directory: ext/jira/lib. Copy all Jars into this directory.

Finally you must Tomcat announce the new libraries. For this you edit the conf/catalina-properties by changing the common.loader property (the property is a single line; here are only breaks due to layout reasons):

common.loader=${catalina.base}/ext/jira/lib/*.jar,
       ${catalina.base}/lib,${catalina.base}/lib/*.jar,
       ${catalina.home}/lib,${catalina.home}/lib/*.jar

Jira needs a lot of memory. Sometimes Jira needs more than Tomcat can deliver. So you should add mor memory to Tomcat. This and some other properties you should set, before the next restart of Tomcat.

export JAVA_OPTS="-XX:MaxPermSize=256m -Xmx1024m
       -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true
       -Dmail.mime.decodeparameters=true"

The first both options gives more memory to Tomcat. The last both options are needed by Jira. The 3rd is needed to avoid a memory leak of Tomcat and the last option is needed to send attachments with another encoding than the default encoding.

You must restart Tomcat to activate your changes.

Installing Jira

The archive you get as WAR-Edition contains the binaries you need to deploy it to Tomcat. But the archive contains the binaries for the EAR-Edition too. And for older Tomcats and Resin and so on… Additionally this archive enables you to do customizations like configurations, templates,  additionally sources to compile and JARs. After you downloaded the archive and extract it you must change one property pointing to the data directory used by Jira by editing edit-webapp/WEB-INF/classes/jira-application.properties.

Now you can build the web archive you can use to deploy to Tomcat. In the root directory the is a build script (build.sh and build.bat) you can use to archieve this. After some time the script is ready and a new directory is created: dist-tomcat/tomcat-6. There you find the web archive and the deployment descriptor for Tomcat 6. You can simple copy this descriptor to <<tomcat-install-directory>>/conf/Catalina/localhost. Tomcat will install Jira and you can browse to http://localhost:8080/jira.

Customizing the web archive

You can overwrite every file the web archive contains. The can archieved vy copying the file into the edit-webapp directory. Please remember to create the same directory structure. For instance if you want to customize the file webapp/WEB-INF/classes/log4j.properties you must copy it to edit-webapp/WEB-INF/classes/log4j.properties. After running the build script you can reload the webapplication with Tomcat’s Manager or simply restarting Tomcat.

Speed up the build script

The build script create web archive for all tomcat versions and a generic web archive for other servlet containers. If you plan to deploy to Tomcat 6 it would be enough to build the archive for Tomcat 6. To do this you must only change the target war in the build.xml:

<target name="war" depends="clean, compile" description="Packages the WAR file">
<!-- Build the war file -->
<jar jarfile="${dist-generic}/${name}-${version}.war">
<fileset dir="${build.war}"/>
</jar>
<!-- Tomcat-6-specific .war -->
<jar jarfile="${dist-tomcat}/tomcat-6/${name}-${version}.war">
<fileset dir="${build.war}">
<exclude name="WEB-INF/lib/commons-logging*.jar"/>
<exclude name="WEB-INF/lib/log4j-*.jar"/>
</fileset>
</jar>
<copy file="etc/tomcat-6-jira.xml" tofile="${dist-tomcat}/tomcat-6/jira.xml">
<filterset>
<filter token="JIRA_HOME" value="${basedir}"/>
<filter token="JIRA_WEBAPP" value="${basedir}${slash}${dist-tomcat}${slash}tomcat-6${slash}${name}-${version}.war"/>
</filterset>
</copy>
<echo>
--------------------------------------------------
Deployable WARs generated:
TOMCAT:  ${basedir}${slash}${dist-tomcat}${slash}${name}-${version}.war
GENERIC: ${basedir}${slash}${dist-generic}${slash}${name}-${version}.war
See http://www.atlassian.com/software/jira/docs/latest/servers/ for install instructions
--------------------------------------------------
</echo>
</target>

Conclusion

Now your Jira is up and running. The next steps are configuration of projects and users, but this isn’t the focus of this article.


May 8 2005

The Centaurus-Platform: Hosting with Tomcat

thorque
Tomcat-Kolumne Javamagazin 04/2005

PDF-File The Centaurus-Platform: Hosting with Tomcat (German)

Tomcat is the most popular Servlet-Container. You can easily create application to deploy to Tomcat. But there were no offers for hosting of such application. The Centaurus-Platform has the goal to offer a Hosting solution for Tomcat-based applications.

This article is written in german.

Die Centaurus-Platform: Hosting mit Tomcat – Nah am Mythos

Es ist allgemein bekannt, dass Tomcat der Webcontainer für alle Fälle ist. Die Entwicklung von Java- Webanwendungen hat in den letzten sieben Jahren stark zugenommen. Leider gibt es kaum attraktive Angebote für das Hosting solcher Anwendungen. Nach Gründen dafür muss man nicht lange suchen, denn der Tomcat und andere Webcontainer taugen out of the box nur sehr eingeschränkt für diese Aufgabe. Das Projekt Centaurus-Platform hat sich diesem Problem angenommen und stellt nun erste Ergebnisse bereit. Diese Ergebnisse werden in dieser Kolumne beschrieben.


Nov 7 2004

Tomcat as Unix-Service

thorque
Tomcat-Kolumne in Javamagazin 10/2004

PDF-File Tomcat as Unix-Service (German)

If you want to run Tomcat in a production environment you need to integrate Tomcat into the system. If you have Unix as operating system this is commonly done with integration into the dameon scripts.

This article is written in german.

Tomcat als Unix-Service oder die kleinen Hürden einer stabilen Tomcat-Unix-Dienstinstallation

Während die Windows-Plattform eher für Entwicklungszwecke genutzt wird, ist die Unix-Plattform das Ziel für einen Tomcat-Produktionsserver. Ein großes Hindernis bei der Konfiguration eines Tomcats auf einem Unix-Betriebssystem ist die fehlende Standard-Systemintegration. Diese Kolumne beschreibt die Installation eines Tomcat als Systemdienst und die Integration in UNIX-Systeme.


Oct 8 2004

Tomcat as Service

thorque
Tomcat-Kolumne Javamagazin 09/2004

PDF-File Tomcat as Service (German)

There are 2 different methods to integrate Tomcat in a Windows-Server System Both methods will be described in this article.

This article is written in germnan.

Der feine Unterschied – Tomcat als Serviceunternehmen: erfolgreiche Dienstleistung unter Windows

Der feine Unterschied – Tomcat als Serviceunternehmen: erfolgreiche Dienstleistung unter Windows. In dieser Kolumne geht es um Intregation des Tomcats in den Windows Dienstemanager. Dabei werden zwei verschiedene Möglichkeiten aufgezeigt und genau unter die Lupe genommen.


Apr 8 2004

Tomcat Security

thorque
Tomcat-Kolumne Javamagazin 04/2004

PDF-File Tomcat Security (German)

This article shows how to use the Java Security  Manager to run an secured Tomcat Instance.

This article is written in german.

Sicherheit für Leib und Leben: Trutzburg: Mein Tomcat ist eine Festung

In dieser Kolumne geht es um die Absicherung des Tomcats mit dem Java-SecurityManager, wenn Webanwendungen von verschiedenen Kunden in denselben Tomcat installiert werden.