Integrating JIRA with Apache
The content on this page relates to platforms which are not supported by JIRA. Consequently, Atlassian can not guarantee providing any support for it. Please be aware that this material is provided for your information only and using it is done so at your own risk.
This page describes how to integrate Apache HTTP Server (also referred to as httpd
) with JIRA, utilising mod_proxy so that Apache operates as a reverse-proxy over HTTP. If HTTPS configuration is required, please see our Integrating JIRA with Apache using SSL documentation. Configuring Apache allows for running JIRA on non-standard HTTP port (such as 8080) and users will be able to access JIRA over standard HTTP as their traffic will be routed through the proxy.
Apache can be configured to allow access to JIRA in any of the following methods:
- Directly on its own domain: http://jira.com
- As a subdomain of another domain: http://jira.atlassian.com
- It can also be accessed on a context path on either a domain or subdomain: http://atlassian.com/jira
This documentation will cover a straightforward implementation of mod_proxy
using the above three configurations. If a more complication solution is required, refer to the Apache HTTP Server Version Documentation, consult with the Apache SME within your organisation and if need be raise a question on Atlassian Answers or look at getting in touch with one of our Atlassian Experts.
Step 1: Configure Tomcat
This step is only required if JIRA will be accessed on a context path, for example http://atlassian.com/jira. If this is not required, this step can be skipped.
- Stop JIRA.
Edit Tomcat's
server.xml
to include the required JIRA context path. The below example usespath="jira"
- this means JIRA is accessible onhttp://jiraserver:8080/jira
given the default JIRA port is used.<Engine defaultHost="localhost" name="Catalina"> <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true"> <Context docBase="${catalina.home}/atlassian-jira" path="/jira" reloadable="false" useHttpOnly="true"> <!-- ==================================================================================== Note, you no longer configure your database driver or connection parameters here. These are configured through the UI during application setup. ==================================================================================== --> <Resource auth="Container" factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60" name="UserTransaction" type="javax.transaction.UserTransaction"/> <Manager pathname=""/> </Context> </Host>
Ensure the
path
value is set with a prepending forward slash (/
) . For example,path="/jira"
rather thanpath="jira"
.- Start JIRA.
- Test that JIRA is accessible on the new context path, for example
http://jiraserver:8080/jira
.
Step 2: Configure Apache HTTP Server
The installation of Apache and configuration of a DNS is not covered in this documentation. Additionally, it is assumed that Apache 2.2 has been installed and DNS entries have been configured for the JIRA domain. As Apache's configuration is specific to the operation system that is used, only some distributions and their configurations are currently documented.
2.1 Enable the Proxy Modules
Debian/Ubuntu
Windows/Other OS
2.2. Configure Apache to use those Modules
Debian/Ubuntu
Windows/Other OS
Step 3: Configure JIRA
- Set Use gzip compression to OFF as in Configuring JIRA Options. GZIP compression is known to cause performance issues using a reverse-proxy, especially if the proxy is also compressing the traffic.
- Set the Base URL to be the FQDN that JIRA will be accessed on, for example http://jira.atlassian.com. This is also located in Configuring JIRA Options.
JIRA can only be configured to respond to a single URL and the Base URL (as in Configuring JIRA Options) must match the URL end-users are accessing. Misconfiguration of this may cause significant problems within JIRA such as the Activity Stream and Dashboard Gadgets failing to function correctly.
- Test by accessing JIRA on the FQDN (e.g.: http://jira.atlassian.com), ensuring that JIRA is accessible and all dashboard gadgets correctly display.
Troubleshooting
- Hijacked Sessions: Some users have reported problems with user sessions being hijacked when the mod_cache module is enabled. If these problems are encountered, try disabling the
mod_cache
module.This module is enabled by default in some Apache HTTP Server version 2 distributions.
- Permission Denied Errors enabling
mod_proxy
(andmod_jk
) on Linux distros that use SELinux: Users have reported 'permission denied' errors when trying to getmod_proxy
(andmod_jk
) working. Disabling SELinux (/etc/selinux/config
) apparently fixes this. Running Mac OS X: Disable webperfcache, which proxies port 80 by default. A user reported this as the likely cause of JIRA session problems, in the form of users' identities becoming mixed up, as below.
Additionally we do not recommend using Max OS X as it is not supported, as in our Supported Platforms.
The OSX Servers enable webperfcache by default for Virtual Hosts, which for static content would be great, but for dynamic sites (which ALL of ours are) it is Evil and causes many issues.
Of note recently was the jira session issue. Also see :-
http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/webperfcache.8.html
Unfortunately even if you disable webperfcache for a site, if there is a single site enabled then all sites will still proxy through webperfcache with resulting session problems.
- Too many redirects: Both Tomcat & Apache are redirecting, when only one should be. Disable redirection in Tomcat (revert any changes as in Running JIRA over SSL or HTTPS) and check that there is only one redirection in Apache.
- General Problems:
- Clear the browser cache and try again.
- Ensure that JIRA works as expected when running directly from Tomcat and bypassing Apache. For example, accessing
http://jiraserver:8080
instead of http://jira.atlassian.com. - Increase the LogLevel for Apache to debug and restart it.
- Attempt to access JIRA and check the Apache Log Files for any errors.
- Raise a question on Atlassian Answers for assistance.
- 403 Forbidden error:
Add the
RequestHeader unset Authorization
line to the apache configuration page to disable authorization headers.<Location /jira> RequestHeader unset Authorization ProxyPreserveHost On ProxyPass http://jiraserver/jira ProxyPassReverse http://jiraserver/jira </Location>
See Also
- Integrating JIRA with Apache using SSL
- Configuring Apache Reverse Proxy Using the AJP Protocol
- For more advanced
mod_webapp
configurations (eg. SSL), see this mod_proxy guide. - Apache Virtual Host documentation