Documentation for JIRA 5.0. Documentation for other versions of JIRA is available too.
This guide describes how to install JIRA WAR on Tomcat 6.0, a popular open-source server from the Apache project. Tomcat can be downloaded from the Apache site.
JIRA installations which have been installed using the 'Windows Installer', 'Linux Installer' or from an 'Archive File' are pre-configured to use their own dedicated Tomcat application server. To install JIRA using one of these distributions, follow the Installing JIRA guide instead of the instructions below.
Please read the following important notes before you begin installing JIRA on Tomcat 6.0:
There are also a number of practical reasons why we do not support deploying multiple Atlassian applications in a single Tomcat container. Firstly, you must shut down Tomcat to upgrade any application and secondly, if one application crashes, the other applications running in that Tomcat container will be inaccessible.
Finally, we recommend not deploying any other applications in the same Tomcat container that runs JIRA, especially if these other applications have large memory requirements or require additional libraries in Tomcat's lib
subdirectory.
On this page:
The extracted directory is hereafter referred to as your JIRA Installation Directory.
$ sudo /usr/sbin/useradd --create-home --comment "Account for running JIRA" --shell /bin/bash jira
> net user jira mypassword /add /comment:"Account for running JIRA"
To maximise security, ensure that this user can only write to the
logs
, temp
and work
directories of your application server (Apache Tomcat) installation and your JIRA Home Directory.
(This section is optional and recommended for experts only.)
If you wish to customise any files in the <jira-application-dir>
(i.e. the webapp
subdirectory) of your JIRA Installation Directory, please perform them in the sibling edit-webapp
subdirectory only.
To edit a file within the webapp
subdirectory, first copy it from the webapp/path/to/file
subdirectory to the edit-webapp/path/to/file
subdirectory of your JIRA Installation Directory and edit it in the latter location.
When building JIRA (below), .war
files are constructed based on file contents copied from the webapp
subdirectory of your JIRA Installation Directory, which are overwritten by file contents from the sibling edit-webapp
directory. Thus, never edit files within this webapp
directory!
Be aware that the more files you customise in your JIRA Installation Directory, the more difficult it will be to upgrade JIRA or migrate JIRA to another server, as your customisations will need to be migrated manually over to your new JIRA installation.
entityengine.xml
FileEnsure that the Transaction Factory has been specified correctly in JIRA's entityengine.xml
file. For more information, see Configuring the Entity Engine for JIRA.
In the entityengine.xml
file (located in edit-webapp/WEB-INF/classes/
of the JIRA Installation Directory), ensure the <transaction-factory>...</transaction-factory>
tag contains:
<transaction-factory class="org.ofbiz.core.entity.transaction.JNDIFactory"> <user-transaction-jndi jndi-server-name="default" jndi-name="java:comp/env/UserTransaction"/> <transaction-manager-jndi jndi-server-name="default" jndi-name="java:comp/env/UserTransaction"/> </transaction-factory>
See Configuring the Entity Engine for JIRA for more information about configuring JIRA's database access layer.
jira-application.properties
file and set the value of the 'jira.home
' property to the desired location for your JIRA Home Directory. If you are specifying this location's path on Windows, use double back-slashes ("\") between subdirectories. For example, X:\\path\\to\\JIRA\\Home
JIRA_HOME
in your operating system whose value is the location of your JIRA Home Directory. To do this:set JIRA_HOME=X:\path\to\JIRA\Home
JIRA_HOME
environment variable value using this format, where:X
is the drive letter where your JIRA Home Directory is located and=
')export JIRA_HOME=/path/to/jira/home
Please note that you cannot use the same JIRA home directory for multiple instances of JIRA. We recommend locating your JIRA Home Directory completely independently of the JIRA Installation Directory (i.e. not nesting one within the other) as this will minimise information being lost during major operations (e.g. backing up and restoring instances).
For more information about setting up your JIRA Home Directory, please see Setting your JIRA Home Directory.
Now build JIRA by running build.bat
(Windows) or ./build.sh
(Linux/Solaris) on the command line in the JIRA Installation Directory. This will produce the deployable WAR file in the dist-tomcat/tomcat-6
subdirectory of the JIRA Installation Directory.
Your Tomcat installation requires an appropriate JDBC driver to allow JIRA to communicate with the database. To add this JDBC driver to Tomcat, refer to the appropriate instructions:
Tomcat does not come with some libraries required to run JIRA. To fix this, download http://www.atlassian.com/software/jira/downloads/binary/jira-jars-tomcat-distribution-5.0-tomcat-6x.zip extract and copy the .jar
library files from this archive to the lib
subdirectory of your Tomcat installation directory.
Please Note:
.jar
library files before copying over new ones.To prevent exceptions related to logging, please ensure that the following files are present in Tomcat's lib
directory. Also ensure that these files are not present in the webapp/jira/WEB-INF/lib
subdirectory of the JIRA Installation Directory. If any of the following files are present in the webapp/jira/WEB-INF/lib
subdirectory, remove them and rebuild the deployable JIRA WAR file as described in the previous step (above).
File |
---|
jcl-over-slf4j-x.y.z.jar |
jul-to-slf4j-x.y.z.jar |
log4j-x.y.z.jar |
slf4j-api-x.y.z.jar |
slf4j-log4j12-x-y-z.jar |
A JIRA 'context' now needs to be set up in Tomcat. To do this:
conf/Catalina/localhost/
within your Tomcat installation directory.jira.xml
file from the etc
subdirectory of your JIRA Installation Directory to the conf/Catalina/localhost
subdirectory of your Tomcat installation directory (created in the previous step).If necessary, customise the copied jira.xml
file within your Tomcat installation — in particular, the value of the docBase
attribute of the Context
element:
<Context path="/jira" docBase="path/to/atlassian-jira-5.x.war" debug="0" useHttpOnly="true"> <Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction" factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/> <Manager pathname=""/> </Context>
The paths (denoted as path/to/
) will be correct by default, assuming you want to deploy the .war
from the dist-tomcat/tomcat-6
subdirectory of your JIRA Installation Directory.
If you are installing in Windows, make sure that the paths you specify for the location of the WAR file and database are full paths with drive letters (e.g. C:\path\to\atlassian-jira-4.x.war
).
server.xml
to Handle Internationalised Characters CorrectlyIn order for JIRA to correctly display internationalised characters in user and group names, you need to modify the conf/server.xml
file in your Tomcat installation directory by specifying the URIEncoding="UTF-8"
property within the connector definition for your HTTP protocol.
The connector definition is specified by the following element in your server.xml
file:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>
You should modify this element by specifying the URIEncoding="UTF-8"
attribute:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8"/>
Please Note:
Memory and mail handling settings need to be modified in Tomcat to avoid the following issues:
OutOfMemoryError
errors if large pages (such as RSS or Excel pages) are requested.OutOfMemory
errors when running JIRA if these memory settings are not increased.mail.mime.decodeparameters
startup parameter in Tomcat to true
.To prevent these issues, follow the appropriate instructions for your operating system below.
If Tomcat is not installed as a service:
Edit Tomcat's bin/setenv.bat
file (or create this file if it does not exist) and add the following to this file:
set CATALINA_OPTS=%CATALINA_OPTS% -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Xms128m -Xmx512m -XX:MaxPermSize=256m
If Tomcat is installed and running as a service:
In this dialog box, click on the 'Java' tab and specify the following values:
Field | Value |
---|---|
Java Options (append to the existing value) | -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true |
Initial memory pool | 128 |
Maximum memory pool | 512 |
Your configuration should be similar to the screenshot below:
Edit Tomcat's bin/setenv.sh
file (or create this file if it does not exist) and add the following to this file:
export CATALINA_OPTS="$CATALINA_OPTS -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Xms128m -Xmx512m -XX:MaxPermSize=256m"
For other environments and more information on memory settings, see Increasing JIRA Memory.
(Only required if Tomcat is not running as a service.)
JIRA should now be ready to run in Tomcat. To start up JIRA, start (or restart) the Tomcat server with Tomcat's bin/startup.sh
or bin/startup.bat
scripts.
Point your browser to
http://localhost:8080/jiraYou should now see the Setup Wizard, which will take you through the JIRA's setup procedure, including a configuration step for your database connection.
It is easy to make a mistake in this process. First, check that you have followed the process described above:
edit-webapp/WEB-INF/classes/entityengine.xml
in your JIRA Installation Directory (step 2 above) and re-run the build script (step 3 above), but your entityengine.xml
changes were not picked up? If so, delete the webapps/jira
subdirectory of your Tomcat installation directory and then restart JIRA. (In some circumstances, Tomcat does not correctly re-expand the web application.)lib
subdirectory of your Tomcat installation directory? (Refer to step 4 above.)objectweb-datasource-x.y.z.jar
present in the lib
subdirectory of Tomcat's installation directory..war
file within conf/Catalina/localhost/jira.xml
of your Tomcat installation directory correct? (Refer to step 5 above.).war
file to Tomcat's webapps
directory? This is almost guaranteed to cause problems - please move this .war
file elsewhere and delete any JIRA subdirectories created in Tomcat's webapps
directory which Tomcat may have created (after Tomcat is initially started).conf/server.xml
file instead of the conf/Catalina/localhost/jira.xml
file of your Tomcat installation directory? Although this is fine, be sure that you do not also have a conf/Catalina/localhost/jira.xml
file present.startup.bat
, or in one of the log files in Tomcat's logs
directory. On Linux/Solaris, logs will appear in a log file in logs
, usually logs/*
(not just logs/catalina.out
). Check the log file for errors after startup.OutOfMemoryError
), you may wish to set the system property -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true
in the setenv.sh
/ setenv.bat
file. For more information please see JRA-10145. (Refer to step 7 above.)build.xml
file is an Ant file, which when invoked with the build.sh
/ build.bat
script, will construct deployable web application archive (.war
) files (for supported application servers). The build.xml
file copies the contents of the webapp
subdirectory of your JIRA Installation Directory and overwrites it with the contents of the sibling edit-webapp
directory, when constructing its .war
files. Thus, unless otherwise requested, never edit files within this webapp
directory!webapp/path/to/file
to edit-webapp/path/to/file
subdirectories of your JIRA Installation Directory and edit it in the latter location.If you are stuck, then please consider installing one of the 'recommended' distributions of JIRA.
Do you have experiences to share with Tomcat 6.0.x and JIRA? We welcome your thoughts. Please see the user-contributed Tomcat 6.0.x notes.