Apache Tomcat で Oracle データソースを設定する

Oracle データベースセットアップ

このページの内容

お困りですか?

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

コミュニティに質問

このページでは、Confluence のための Oracle データソース接続の設定方法について説明します。

Step 1. Shut down Tomcat

  1. Run bin/shutdown.sh or bin/shutdown.bat to bring Tomcat down while you are making these changes.
  2. Make a backup of your <CONFLUENCE_HOME>/confluence.cfg.xml file and your <CONFLUENCE_INSTALLATION>/conf/server.xml file, so that you can easily revert if you have a problem.

ステップ 2. Oracle データベースドライバをインストールする

  1. Download the Oracle JDBC driver. Links are available on this page: Database JDBC Drivers.
  2. Copy the driver JAR file into the lib folder of your Tomcat installation: <TOMCAT-INSTALLATION>/lib.

Step 3. Configure Tomcat

  1. If you are using the Confluence distribution, edit the conf/server.xml file in your Tomcat installation. If you are running your own Tomcat instance, edit the XML file where you declared the Confluence Context descriptor.
  2. Find the Context element in the Host element:

    <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false">
        <Context path="" docBase="../confluence" debug="0" reloadable="true">
             <!-- Logger is deprecated in Tomcat 5.5. Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->
             <Manager pathname="" />
        </Context>
    </Host>
    
  3. Insert the DataSource Resource element into the Context element, directly after the opening <Context.../> line,  before Manager, as shown here:

    <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false">
        <Context path="" docBase="../confluence" debug="0" reloadable="true">
             <!-- Logger is deprecated in Tomcat 5.5. Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->
    			<!-- If you're using Confluence 5.7 or below; change maxTotal to maxActive -->
             <Resource
             name="jdbc/confluence"
             auth="Container"
             type="javax.sql.DataSource"
             driverClassName="oracle.jdbc.OracleDriver"
             url="jdbc:oracle:thin:@hostname:port:sid"
             username="<username>"
             password="<password>"
             connectionProperties="SetBigStringTryClob=true"
    		 accessToUnderlyingConnectionAllowed="true"
             maxTotal="25"
             maxIdle="10"
             maxWaitMillis="10000"
             />
    
             <Manager pathname="" />
        </Context>
    </Host>
    
  4. Change the username and password to match your Oracle login.
  5. Change the url to match the URL for your Oracle database. See how to find your Oracle URL. For example:

    jdbc:oracle:thin:@example.atlassian.com:1521:confluencedb
    
  6. If required, choose different maxTotal and maxIdle values. These define the number of database connections that will be allowed at one time, and the number that will be kept open even when there is no database activity.

ステップ 4. Confluence Web アプリケーションを設定する

次のデータソースを使用するように Confluence を設定します。

  1. Edit this file in your Confluence installation: <CONFLUENCE_INSTALLATION>/confluence/WEB-INF/web.xml.
  2. Insert the following element just before </web-app> near the end of the file:

    <resource-ref>
      <description>Connection Pool</description>
      <res-ref-name>jdbc/confluence</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
    </resource-ref>
    

Step 5. Restart Tomcat

Run bin/startup.sh or bin/startup.bat to start Tomcat with the new settings.

最終更新日: 2015 年 12 月 2 日

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

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