• JIRA+Confluence 安装(整合安装)[转帖]


    一、下载(目前最新版本是3.12.1)

    http://www.atlassian.com/software/jira/JIRADownloadCenter.jspa

    我最初下载的是3.12.1 Enterprise - Standalone (Windows Installer) 这个版本,如果你想用自己的Tomcat服务器,没关系,把里面的confluence文件夹拿出来就可以了。我是把JIRA放到d:/manage/目录下

    二、配置应用服务器

    这里我用Tomcat 5.5.25

    1.jira.xml (tomcat/conf/Catalina/localhost)

    <Context path="/jira" docBase="D:/mat/manage/jira" debug="0" reloadable="false">
       <Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource"
                username="confluenceuser"
                password="XXXXX"
                driverClassName="com.mysql.jdbc.Driver"
                url="jdbc:mysql://localhost/jiradb?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF8"
                />

        <Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction"
                factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/>
        <Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false">
           <Store className="org.apache.catalina.session.FileStore"/>
        </Manager>
    </Context>

    3.catalina.bat(下划线部分是新增)

    // 设置虚拟机内存

    set JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file="%CATALINA_BASE%/conf/logging.properties" -Xms256m -Xmx256m

    //设置这个的目的是为了防止内存溢出(官方文档)

    set CATALINA_OPTS=%CATALINA_OPTS% -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true

    以上是我的配置,以下是官方文档配置:

    Fix Tomcat memory settings

    Note
    This only works for Tomcat 5.5.15 and higher!

    Tomcat has a memory leak where large JSP page requests can fill up memory. To avoid this, edit Tomcat'sbin/setenv.sh (create it if it does not exist) and set:

    export CATALINA_OPTS="$CATALINA_OPTS -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true"

    or when installed as a Windows service, run:

    tomcat5 //US//JIRA ++JvmOptions="-Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true

    4.server.xml(同样,下划线部分为新增,英文语意已经很清楚了,就不做过多解释)

    <Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true"enableLookups="false" maxHttpHeaderSize="8192" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" port="8080" redirectPort="8443" URIEncoding="UTF-8" useBodyEncodingForURI="true"/>

    5.添加依赖jar包至tomcat/common/lib

    首先加入mysql的JAR包,然后下载如下JAR

    Tomcat does not come with some libraries required to run JIRA. To fix this, download jira-jars-tomcat5.zip(1.2Mb), and copy the contained jars to Tomcat's common/lib/ directory.

    三.JIRA类路径相关配置文件修改

    /WEB-INF/classes/entityengine.xml

    由于我使用MYSQL而不是内嵌的hsql数据库,所以做如下更改

    这是原始文件

    <datasource name="defaultDS" field-type-name="hsql"
          schema-name="PUBLIC"
          helper-class="org.ofbiz.core.entity.GenericHelperDAO"
          check-on-start="true"
          use-foreign-keys="false"
          use-foreign-key-indices="false"
          check-fks-on-start="false"
          check-fk-indices-on-start="false"
          add-missing-on-start="true"
          check-indices-on-start="true">
            <jndi-jdbc jndi-server-name="default" jndi-name="java:comp/env/jdbc/JiraDS"/>

    改为如下设置

    <datasource name="defaultDS" field-type-name="mysql"
          helper-class="org.ofbiz.core.entity.GenericHelperDAO"
          check-on-start="true"
          use-foreign-keys="false"
          use-foreign-key-indices="false"
          check-fks-on-start="false"
          check-fk-indices-on-start="false"
          add-missing-on-start="true"
          check-indices-on-start="true">
            <jndi-jdbc jndi-server-name="default" jndi-name="java:comp/env/jdbc/JiraDS"/>

     

    CONFLUENCE Installation Guide

    一、下载(目前最新版本是2.7)

    http://www.atlassian.com/software/confluence/ConfluenceDownloadCenter.jspa

    我是把confluence放到d:/manage/jira/目录下(因为我还装了JIRA,当然也可以放在其他目录).

    二、配置应用服务器

    1.wiki.xml(tomcat/conf/Catalina/localhost => confluence名字太长,我就叫他wiki吧)

    注意这里多配了一个Resource,目的是为了和JIRA整合,但要清楚,安装confluence的时候我们要指定的是WikiDS,因为核心思想是二者的主要数据分库存储,而用户数据由JIRA接管。

    <Context path="/wiki" docBase="D:/manage/jira/confluence" debug="0" reloadable="false">

    <Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource"
                username="confluenceuser"
                password="XXXXX"
                driverClassName="com.mysql.jdbc.Driver"
                url="jdbc:mysql://localhost/jiradb?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF8"
                />
    <Resource name="jdbc/WikiDS" auth="Container" type="javax.sql.DataSource"
                username="confluenceuser"
                password="XXXXX"
                driverClassName="com.mysql.jdbc.Driver"
                url="jdbc:mysql://localhost/wikidb?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF8"
                />

        <Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction"
                factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/>
        <Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false">
           <Store className="org.apache.catalina.session.FileStore"/>
        </Manager>
    </Context>

    2.项目的web.xml配置(Configure resource references )

    Also, we need to configure the resource references in the appropriate web application file descriptors, to provide access to the JDBC resource we will create later.

    First, we edit ./confluence/WEB-INF/web.xml and insert the resource reference for the resourcejdbc/confluence at the end of the file, just before the </web-app> tag.

    ... 
      <resource-ref>
        <description>Connection Pool</description>
        <res-ref-name>jdbc/JiraDS</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
      </resource-ref>
    <resource-ref>
        <description>Connection Pool</description>
        <res-ref-name>jdbc/WikiDS</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
      </resource-ref>
    ...
    </web-app>

    ---------------------------------------------------------------------------------

     

    开始整合

    (特别注意,以下配置是在confluence登陆后再进行操作,不然你登陆的时候已经被JIRA接管用户了,最后一步新建管理员是过不去的,当然了,没有权限啊.......尽管可以手工修改配置完成状态,但是就完全与JIRA耦合了。日后想与JIRA分开用户管理时就要手工修改数据库建confluence的管理员用户,否则就)

    A.首先成功配置好CONFLUENCE,并完成首次登陆,然后什么也别干,退出来,停TOMCAT。

    B.登陆JIRA,创建confluence-administrators和confluecne-users两个组(confluence默认的两个用户组)

    C..CONFLUENCE类路径相关配置文件修改

     

    1.atlassian-user.xml (WEB-INF/CLASSES目录下)

    注释掉如下内容

    <!--
            
            <hibernate name="Hibernate Repository" key="hibernateRepository" description="Hibernate Repository" cache="true"/>
         -->

    加入如下内容

    <osuser name="OSUser Repository" key="osuserRepository"/>

    2.osuser.xml

    注释掉如下内容

    <!--
        <provider class="bucket.user.providers.CachingCredentialsProvider">
            <property name="chain.classname">com.opensymphony.user.provider.hibernate.HibernateCredentialsProvider</property>
            <property name="chain.configuration.provider.class">bucket.user.BucketHibernateConfigProvider</property>
        </provider>
        <provider class="bucket.user.providers.CachingAccessProvider">
            <property name="chain.classname">com.opensymphony.user.provider.hibernate.HibernateAccessProvider</property>
            <property name="chain.configuration.provider.class">bucket.user.BucketHibernateConfigProvider</property>
        </provider>

        <provider class="bucket.user.providers.CachingProfileProvider">
            <property name="chain.classname">com.opensymphony.user.provider.hibernate.HibernateProfileProvider</property>
            <property name="chain.configuration.provider.class">bucket.user.BucketHibernateConfigProvider</property>
        </provider>
    -->

    打开如下内容的注释

    <provider class="bucket.user.providers.CachingCredentialsProvider">
            <property name="chain.classname">com.atlassian.confluence.user.providers.jira.JiraJdbcCredentialsProvider</property>
            <property name="chain.datasource">java:comp/env/jdbc/JiraDS</property>
        </provider>
        <provider class="bucket.user.providers.CachingAccessProvider">
            <property name="chain.classname">com.atlassian.confluence.user.providers.jira.JiraJdbcAccessProvider</property>
            <property name="chain.datasource">java:comp/env/jdbc/JiraDS</property>
        </provider>
        <provider class="bucket.user.providers.CachingProfileProvider">
            <property name="chain.classname">com.atlassian.confluence.user.providers.jira.JiraJdbcProfileProvider</property>
            <property name="chain.datasource">java:comp/env/jdbc/JiraDS</property>
            <property name="chain.configuration.provider.class">bucket.user.BucketHibernateConfigProvider</property>
        </provider>

    D.完成上述配置后,用JIRA管理员登陆CONFLUENCE,在全局设置里,打开外部用户管理。

  • 相关阅读:
    Mysql数据库基本操作
    Entity Framework 实践系列 —— 搞好关系 单相思(单向一对一,onetoone)
    ADO.NET最佳实践
    C++试题1
    SQL操作(初级、中级、高级)
    存储过程入门与提高
    数据库学习笔记
    触发器设计技巧与实例
    UML在关系型数据库设计中的应用
    数据库设计的一些构想
  • 原文地址:https://www.cnblogs.com/iapp/p/3631743.html
Copyright © 2020-2023  润新知