|
You will need a valid SSL certificate before you can enable HTTPS. If you already have a certificate prepared, skip to step 2 below.
自己署名証明書を作成するか、認証局(CA、証明機関とも呼ばれます)によって発行された証明証を使用するかを選択することができます。以下で2つのオプションを説明しています。
暗号化が必要だが web サイトのリクエストの身元を確認する必要がない場合、自己署名証明書が役立ちます。一般的に、自己署名証明書はテスト環境や社内ネットワーク(イントラネット)で使用します。
証明書が認証局(CA)によって署名されていないため、ユーザーはサイトが信頼されていないというメッセージを受け取り、サイトにアクセスする前に、証明書を承認するいくつかのステップを実行する必要があります。これは通常、サイトに初めてアクセスする際に発生します。
Follow the steps below to generate a certificate using Java's keytool utility. This tool is included in the JDK.
keytoolutility to generate the certificate:Windows の場合、コマンド プロンプトで以下のコマンドを実行します。
"%JAVA_HOME%\bin\keytool" -genkeypair -alias tomcat -keyalg RSA |
OSX または UNIX ベースのシステムの場合、コマンド プロンプトで以下のコマンドを実行します。
$JAVA_HOME/bin/keytool -genkeypair -alias tomcat -keyalg RSA |
changeit" です。CN=Java Duke, OU=Java Software Division, O=Sun Microsystems Inc, C=USy' to confirm the details.tomcat' (the alias you entered in the keytool command above), press the 'Enter' key. This specifies that your keystore entry will have the same password as your private key. You MUST use the same password here as was used for the keystore password itself. This is a restriction of the Tomcat implementation.When running Confluence in a production environment, you will need a certificate issued by a certificate authority (CA, sometimes also called a 'certification authority') such as VeriSign, Thawte or TrustCenter. The instructions below are adapted from the Tomcat documentation.
まず、ローカル証明書を作成し、その証明書に基づいて「証明書署名要求」(CSR)を作成します。CSR を選択した認証局に提出します。CA は証明書を生成するために、その CSR を使用します。
keytool utility to generate a local certificate, as described in the previous section.Use the keytool utility to generate a CSR, replacing the text <MY_KEYSTORE_FILENAME> with the path to and file name of the .keystorefile generated for your local certificate:
keytool -certreq -keyalg RSA -alias tomcat -file certreq.csr -keystore <MY_KEYSTORE_FILENAME> |
certreq.csr to your chosen certificate authority. Refer to the documentation on the CA's website to find out how to do this.新しい証明書をローカルのキーストアにインポートします。
keytool -importcert -alias tomcat -keystore <MY_KEYSTORE_FILENAME> -file <MY_CERTIFICATE_FILENAME> |
CONFLUENCE-INSTALLATION}>/conf/server.xml.以下の行をコメント アウトします。
<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" SSLEnabled="true"
URIEncoding="UTF-8" keystorePass="<MY_CERTIFICATE_PASSWORD>"/>
|
MY_CERTIFICATE_PASSWORD> with the password you specified for your certificate.SSLEnabled="true" が Connector 要素の一部であることを確認します。この属性が存在しない場合、Confluence へのアクセス試行がタイム アウトします。Tomcat はデフォルトで、キーストア ファイルの名前が .keystore であることと、およびそのファイルが Tomcat を実行されているユーザーのホーム ディレクトリ (自身のホーム ディレクトリとは異なる可能性があります) にあることを想定しています。つまり、Tomcat はデフォルトでは以下の場所で SSL 証明書を探します。
C:\Documents and Settings\\#CURRENT_USER#\.keystore~/.keystore証明書をユーザー定義の場所に移動することができます。以下で説明するように、証明書をデフォルトの場所から移動させる場合、Tomcat が証明書を見つけることができるように、サーバー設定ファイルを更新する必要があります。
CONFLUENCE-INSTALLATION}>/conf/server.xmlkeystoreFile="<MY_CERTIFICATE_LOCATION>" 属性を Connector 要素に追加し、要素が次のようになるようにします。
<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" SSLEnabled="true"
URIEncoding="UTF-8" keystorePass="<MY_CERTIFICATE_PASSWORD>"
keystoreFile="<MY_CERTIFICATE_LOCATION>"/>
|
<MY_CERTIFICATE_LOCATION> を、.keystore ファイルの名前とパスを含む、証明書へのパスで置き換えます。https://<MY_BASE_URL>:8443/.Although HTTPS is now activated and available, the old HTTP URLs (http://localhost:8090) are still available. Now you need to redirect the URLs to their HTTPS equivalent. You will do this by adding a security constraint in web.xml. This will cause Tomcat to redirect requests that come in on a non-SSL port.
web.xml file. Skip the steps below and follow the steps on the RSS Feed Macro page instead.<CONFLUENCE_INSTALLATION>/confluence/WEB-INF/web.xml でファイルを編集します。以下の宣言を、ファイルの末尾の </web-app> タグの前に追加します。
<security-constraint>
<web-resource-collection>
<web-resource-name>Restricted URLs</web-resource-name>
<url-pattern>/</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
|
Confluence has two web.xml files. The other one is at
<CONFLUENCE_INSTALLATION>/conf/web.xml. Please only add the security constraints to <CONFLUENCE_INSTALLATION>/confluence/WEB-INF/web.xml, as described above.
keytool -genkeypair' command generates a key pair consisting of a public key and the associated private key, and stores them in a keystore. The command packages the public key into an X.509 v3 self-signed certificate, which is stored as a single-element certificate chain. This certificate chain and the private key are stored in a new keystore entry, identified by the alias that you specify in the command. The Java SE documentation has a good overview of the utility.redirectPort 属性を更新する必要があります。Tomcat は、受信リクエストの安全性を確保する必要がある場合のリダイレクト先のポートを確認するために、この情報を必要とします。keytoolutility:-keyalg RSA option, as shown in the example of the keytool command above. The default is the SHA1 algorithm, which results in an error 'Internet Explorer cannot display the webpage' on IE7 on Vista.-sigalg MD5withRSA option. Otherwise, SHA1 will be used even if you specify the -keyalg RSA option. See this Atlassian blogpost for more information.Internet Explorer で添付ファイルをダウンロードできない問題: サイト全体に SSL を適用すると、IE で添付ファイルを適切にダウンロードできなくなる可能性があります。この問題を修正するには、<CONFLUENCE_INSTALLATION>/conf/server.xml を編集し、<Context ... /> 要素に次の内容を追加します。
<Valve className="org.apache.catalina.authenticator.NonLoginAuthenticator"
disableProxyCaching="true" securePagesWithPragma="false" />
|