Confluence 5.7 のサポートは終了しています。
ドキュメントの最新バージョンを確認してください。
設定を使用する場合がある状況がいくつかあります。
Note: This page documents a configuration of Apache, rather than of Confluence itself. Atlassian will support Confluence with this configuration, but we cannot guarantee to help you debug problems with Apache. Please be aware that this material is provided for your information only, and that you use it at your own risk.
これらの例では、以下を使用します。
http://www.example.com/confluence - 希望の URL
http://example:8090 - 現在 Confluence がインストールされているホスト名とポート
/confluence - 希望のコンテキスト パス(ホスト名とポートの後の部分)
以下の例では、ご利用のサーバーの希望の URL に置き換えてください。以下の内容のコピー/貼り付けをすると、ご利用のサーバーで動作しません。
Set your Confluence application path (the part after hostname and port). To do this in Tomcat (bundled with Confluence), edit conf/server.xml
, locate the "Context" definition:
<Context path="" docBase="../confluence" debug="0" reloadable="true">
次のように変更します。
<Context path="/confluence" docBase="../confluence" debug="0" reloadable="true">
Confluence を再起動し、http://example:8090/confluence でアクセスできることを確認します。
Set the URL for redirection. In the same conf/server.xml
file, locate this code segment:
<Connector port="8090" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" />
最後の行を追加します。
<Connector port="8090" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" proxyName="www.example.com" proxyPort="80" />
これで動作しない場合、および SSL を使用している場合、Connector タグに、scheme 属性 scheme="https" を追加してみてください。
ここで2つの選択肢があります。
Now enable mod_proxy in Apache, and proxy requests to the application server by adding the example below to your Apache httpd.conf (note: the files may be different on your system; the JIRA docs describe the process for Ubuntu/Debian layout):
# Put this after the other LoadModule directives LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so # Put this in the main section of your configuration (or desired virtual host, if using Apache virtual hosts) ProxyRequests Off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /confluence http://app-server.internal.example.com:8090/confluence ProxyPassReverse /confluence http://app-server.internal.example.com:8090/confluence <Location /confluence> Order allow,deny Allow from all </Location>
# Put this after the other LoadModule directives LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so # Put this in the main section of your configuration (or desired virtual host, if using Apache virtual hosts) ProxyRequests Off ProxyPreserveHost On <Proxy *> # Auth changes in 2.4 - see http://httpd.apache.org/docs/2.4/upgrading.html#run-time Require all granted </Proxy> ProxyPass /confluence http://app-server.internal.example.com:8090/confluence ProxyPassReverse /confluence http://app-server.internal.example.com:8090/confluence <Location /confluence> # Auth changes in 2.4 - see http://httpd.apache.org/docs/2.4/upgrading.html#run-time Require all granted </Location>
複雑な設定は、mod_proxy_html フィルタを使用して、途中のプロキシされたコンテンツを変更することに関連します。Apache とアプリケーション サーバーの間で Confluence のパスが異なる場合にこれが必要になります。例:
外部からアクセス可能な(Apache) URL | http://confluence.example.com/ |
---|---|
アプリケーション サーバーの URL | http://app-server.internal.example.com:8090/confluence/ |
URL のアプリケーション パスがそれぞれ異なっていることに注意してください。Apache ではパスが / ですが、アプリケーション サーバーではパスが /confluence になっています。
この設定の場合、標準の Apache ディストリビューションに含まれない mod_proxy_html モジュールをインストールする必要があります。
別のソリューションを以下で説明します。
# Put this after the other LoadModule directives LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_html_module modules/mod_proxy_html.so <VirtualHost *> ServerName confluence.example.com # Put this in the main section of your configuration (or desired virtual host, if using Apache virtual hosts) ProxyRequests Off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://app-server.internal.example.com:8090/confluence ProxyPassReverse / http://app-server.internal.example.com:8090/confluence ProxyHTMLURLMap / /confluence/ <Location /> Order allow,deny Allow from all </Location> </VirtualHost>
# Put this after the other LoadModule directives LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_html_module modules/mod_proxy_html.so <VirtualHost *> ServerName confluence.example.com # Put this in the main section of your configuration (or desired virtual host, if using Apache virtual hosts) ProxyRequests Off ProxyPreserveHost On <Proxy *> # Auth changes in 2.4 - see http://httpd.apache.org/docs/2.4/upgrading.html#run-time Require all granted </Proxy> ProxyPass / http://app-server.internal.example.com:8090/confluence ProxyPassReverse / http://app-server.internal.example.com:8090/confluence ProxyHTMLURLMap / /confluence/ <Location /> # Auth changes in 2.4 - see http://httpd.apache.org/docs/2.4/upgrading.html#run-time Require all granted </Location> </VirtualHost>
複数のアプリケーションがこの設定で実行している場合、ProxyHTMLURLMap 設定が、より複雑になる可能性があります。web サーバー URL がサブディレクトリであり、仮想ホスト上にない場合、マッピングを Location ブロックにも記載する必要があります。Apache Week チュートリアルには、このための情報がより多くあります。
これは新しい設定を有効するのに必要です。コマンドライン/ターミナル/シェルで以下を実行することで完了できます。
sudo apachectl graceful
プロキシと Tomcat の両方で圧縮を実行すると、JIRA などのアトラシアンの他のアプリケーションをと統合する際に問題が発生することがあります。「Confluence 内で HTTPレスポンスを圧縮する」を参照して、HTTP 圧縮を無効にしてください。
最後の段階では、Base URL に、プロキシ内で使用するアドレスを設定します。この例では、http://www.example.com/confluence です。
If you're running Apache in front of Tomcat, it's a good idea to terminate your SSL configuration at Apache, then forward the requests to Tomcat over HTTP. You can set up Apache to terminate the SSL connection and use the ProxyPass and ProxyPassReverse directives to pass the connection through to Tomcat (or the appropriate application server) which is running Confluence.
Most of the relevant Apache Config:
Listen 443 NameVirtualHost *:443 <VirtualHost *:443> SSLEngine On SSLCertificateFile /etc/apache2/ssl/apache.pem ProxyPass / http://localhost:8090/ ProxyPassReverse / http://localhost:8090/ </VirtualHost>
Apart from the Apache configuration there are a couple of things you will need to do before you get your server working:
proxyName="proxy.example.com" proxyPort="443" scheme="https" secure="true"
Tomcat がアプリケーション サーバーの場合、2つの選択肢があります。
アプリケーション サーバーが AJP コネクタを持っている場合