Documentation for JIRA 5.2. Documentation for other versions of JIRA is available too.

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_ajp so that Apache operates as a reverse-proxy. AJP is a wire protocol and is an optimized version of the HTTP protocol to allow a standalone web server such as Apache to talk to Tomcat. Historically, Apache has been much faster than Tomcat at serving static content. The idea is to let Apache serve the static content when possible, but proxy the request to Tomcat for Tomcat related content.

This protocol can be used in favour of HTTP/1.1 as in either of the following Apache configurations:

On this page:

ステップ 1: Tomcat を設定する

  1. Jira を停止します。
  2. Enable the AJP Connector on the Tomcat container hosting JIRA by uncommenting the following element in $JIRA_INSTALL/conf/server.xml:

    <Connector port="8009" URIEncoding="UTF-8" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
  3. Jira を起動します。
  4. Test that JIRA is accessible on the standard HTTP connector, for example http://jiraserver:8080. This is to ensure that Tomcat has successfully restarted.

ステップ 2: Apache HTTP サーバを設定する

Apache のインストールおよび DNS の構成に関しては、本ドキュメントでは扱っていません。また、Apache 2.2 がインストール済みであり、DNS エントリーが JIRA ドメイン向けに設定されているものと想定しています。Apache の設定は利用する OS によって異なるため、現在のドキュメントは一部のディストリビューションの設定のみとなっています。

2.1 プロキシモジュールを有効化する

Debian/Ubuntu
  1. 以下の方法で、モジュールを有効化します:

    $ sudo a2enmod proxy_ajp
    Considering dependency proxy for proxy_ajp:
    Module proxy already enabled
    Enabling module proxy_ajp.
    To activate the new configuration, you need to run:
    service apache2 restart
  2. Apache を再起動します。
Windows/その他の OS
  1. httpd.conf ファイルを編集し、以下の行を加えます:

    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
  2. Apache を再起動します。

2.2 これらのモジュールを使用するように、Apacheを設定します

Debian/Ubuntu
  1. root ユーザーに切り替えます。
  2. 既存サイトをバックアップするか、新しく作成します。新しいサイトの作成に関しては、本ドキュメントでは扱っていません(デフォルトのコピーで十分なはずです)。
  3. $APACHE_INSTALL/sites-available 内の既存サイトを修正します。例: default (HTTP) または default-ssl (HTTPS)。
  4. Add the following inside the VirtualHost, replacing jiraserver with the hostname of the JIRA server and also modifying the port if required.

    # JIRA AJP Proxy Configuration:
    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>
    
    ProxyRequests           Off
    ProxyPass               /       ajp://jiraserver:8009/
    ProxyPassReverse        /       ajp://jiraserver:8009/

    (info) URLの前の/(スラッシュ)を忘れると、プロキシーエラーが発生しますので必ず付け加えてください。

  5. (任意): 次のようにサイトを有効化します

    # a2ensite jira
    Enabling site jira.
    To activate the new configuration, you need to run:
    service apache2 reload

    (info) これは、デフォルトを利用するのではなく新たなサイトが作成された場合においてのみ必要となります。

  6. HTTP を利用している場合、ステップ 8 まで飛ばします。HTTPS においては、証明書と秘密キーを適切なディレクトリにコピーする事で証明書をインストールし、また以下をサイトに追加する必要があります:

    SSLProxyEngine          On
  7. 以下の設定を Apache 設定の VirtualHost に含めます。

    SSLCertificateFile    /etc/ssl/certs/jira.crt
    SSLCertificateKeyFile /etc/ssl/private/jira.key
  8. Apache の設定をリロードします。
  9. Test by accessing JIRA through Apache, for example http://jira.com or http://atlassian.com/jira.
Windows/その他の OS
  1. httpd.conf ファイルを見つけて編集します。
  2. Add the following inside the VirtualHost, replacing jiraserver with the hostname of the JIRA server and also modifying the port if required.

    # JIRA AJP Proxy Configuration:
    <Proxy *>
            Order deny,allow
            Allow from all
    </Proxy>
    
    ProxyRequests           Off
    ProxyPass               /       ajp://jiraserver:8009/
    ProxyPassReverse        /       ajp://jiraserver:8009/

    (info) URLの前の/(スラッシュ)を忘れると、プロキシーエラーが発生しますので必ず付け加えてください。

  3. HTTPで利用するなら、ステップ5まで飛ばします。HTTPS においては、証明書と秘密キーを適切なディレクトリにコピーする事で証明書をインストールし、また以下をサイトに追加する必要があります:

    SSLProxyEngine          On
  4. 以下の設定を VirtualHost 内の Apache 設定に含めます。

    SSLCertificateFile    /etc/ssl/certs/jira.crt
    SSLCertificateKeyFile /etc/ssl/private/jira.key
  5. Apache を再起動します。
  6. Test by accessing JIRA through Apache, for example http://jira.com or http://atlassian.com/jira.

2.3 HTTP を HTTPS にリダイレクトします

This is an optional step and is only required if using HTTPS. It can be done by using mod_rewrite (this module may require enabling), add the following to the HTTP VirtualHost:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

ステップ 3: JIRA を設定する

  1. Configuring JIRA Options にあるように、gzip 圧縮を利用するOFF に設定します。GZIP 圧縮では、リバースプロキシを利用するとパフォーマンス上の課題が生じる事が分かっており、プロキシがトラフィックを圧縮している場合は特にこれが発生します。
  2. 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.
    (warning) 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.
  3. Test by accessing JIRA on the FQDN (e.g.: http://jira.atlassian.com), ensuring that JIRA is accessible and all dashboard gadgets correctly display.

トラブルシューティング

  • 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. 
    (info) This module is enabled by default in some Apache HTTP Server version 2 distributions.
  • SELinux を使用する Linux ディストリビューションで mod_proxy (および mod_jk) を有効化した際の Permission Denied エラー : mod_proxy (および mod_jk) を動作させようとすると "permission denied" エラーが発生することが多くのユーザーから報告されています。これは SELinux (/etc/selinux/config) を無効化することで解決できます。
  • 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.
    (warning) 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.

  • 過剰なリダイレクト : Tomcat と Apache のどちらかでリダイレクトが行われれば十分である場合において両方でリダイレクトが行われてしまう問題です。これに対しては、Tomcat でのリダイレクトを無効化し、(Running JIRA over SSL or HTTPS の説明に従って設定の変更を元に戻します。) その後リダイレクトが Apache のみで行われることを確認します。
  • その他の一般的なトラブル :
    1. ブラウザーのキャッシュを削除してからもう一度試みます。
    2. 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.
    3. Increase the LogLevel for Apache to debug and restart it.
    4. Attempt to access JIRA and check the Apache Log Files for any errors.
    5. Raise a question on Atlassian Answers for assistance.

参考情報