How to configure Apache mod_jk to proxy Confluence 6.x or later

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

この記事はアトラシアンのサーバー製品にのみ適用されます。クラウドとサーバー製品の違いについてはこちらをご確認ください。

The content on this page relates to platforms which are not supported by Confluence. Consequently, Atlassian cannot 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.

目的

With Confluence 6.0, Atlassian released a feature called Collaborative Editing that allows multiple users to edit a page in real time. To enable this feature, Confluence uses a service called Synchrony that runs parallel to Confluence. If you are using Apache with mod_jk as a reverse proxy in front of Confluence, you might notice a connection cannot be made to Synchrony due to its inability to accept AJP connections.

ソリューション

Configure mod_proxy with wstunnel for Synchrony in addition to the mod_jk

  1. Configure Tomcat to create an AJP connector:

    <Connector port="8009" connectionTimeout="20000" redirectPort="8443"
                    maxThreads="48" minSpareThreads="10"
                    enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
                    protocol="org.apache.coyote.ajp.AjpNioProtocol" proxyName="example.com" proxyPort="80" scheme="http" />
  2. Stop and Start Confluence

  3. Configure a standard workers.properties file:

    worker.list=worker1
     
    worker.worker1.host=example.com
    worker.worker1.port=8009
    worker.worker1.type=ajp13
  4. Add the following to httpd.conf directly or included from another file:

    # Put this after the other LoadModule directives
    LoadModule jk_module modules/mod_jk.so
    
    # Adding mod_proxy w/ wstunnel and mod_rewrite for Synchrony support
    LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
    LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
    LoadModule proxy_wstunnel_module /usr/lib/apache2/modules/mod_proxy_wstunnel.so
    LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
    
    # Put this in the main section of your configuration (or virtual host, if using Apache virtual hosts)
    JkWorkersFile conf/workers.properties
    JkLogFile logs/apache2/mod_jk.log
    JkLogLevel info
    
    <VirtualHost *:80>
    	#Synchrony configuration
    	ProxyRequests Off
    	ProxyPreserveHost On
    
    	<Proxy *>
        	Require all granted
    	</Proxy>
    
    	ProxyPass /synchrony http://localhost:8091/synchrony
    	<Location /synchrony>
    		RewriteEngine on
    		RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
    		RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
    		RewriteRule .* ws://localhost:8091%{REQUEST_URI} [P]
    	</Location>
    	
    	# mod_jk configuration
    	JkMount /confluence worker1
    	JkMount /confluence/* worker1
    
    </VirtualHost>
  5. Restart Apache


説明 With Confluence 6.0, Atlassian released a feature called Collaborative Editing that allows multiple users to edit a page in real time. To enable this feature, Confluence uses a service called Synchrony that runs parallel to Confluence. If you are using Apache with mod_jk as a reverse proxy in front of Confluence, you might notice a connection cannot be made to Synchrony due to its inability to accept AJP connections.

最終更新日: 2018 年 12 月 31 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.