当前位置: > 其它学习 > JIRA >

CentOS7安装JIRA 7.10.1 + Confluence 6.9.1 + Crowd 3.2.1

时间:2019-02-01 14:58来源:未知 作者:IT
环境
服务器要求
目标
安装java
配置环境变量
安装MySQL
创建数据库
上传Mysql驱动
安装JIRA
安装Confluence
安装Crowd
集成Crowd
安装Apache
环境
Java 1.8
MySQL 5.7
Tomcat 8.5.6
CentOS 7
JIRA 7.10.1
Confluence 6.9.1
Crowd 3.2.1
服务器要求
服务器内存不低于8G,如果只安装JIRA或Confluence可以用4G内存。
CPU建议4核以上
目标
搭建JIRA 7.10.1 + Confluence 6.9.1 + Crowd 3.2.1

安装java
# 创建java目录
$ mkdir /usr/local/java

# 本地上传jdk-8u171-linux-x64.tar.gz
$ scp jdk-8u171-linux-x64.tar.gz root@192.168.31.145:/usr/local/java/

# 进入/usr/local/java
$ cd /usr/local/java

# 解压
$ tar -zxvf jdk-8u171-linux-x64.tar.gz


配置环境变量
编辑配置文件

$ vim /etc/profile


# 在尾部添加以下配置:

export JAVA_HOME=/usr/local/java/jdk1.8.0_171
export JRE_HOME=$JAVA_HOME/jre
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
1
2
3
4
5
6
7
重载/etc/profile

$ source /etc/profile
1
检查是否安装成功

$ java -version
1
安装MySQL
参考: http://blog.csdn.net/csdn2193714269/article/details/72897815

安装Mysql


# 下载mysql5.7源安装包

$ wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm


# 安装mysql源

$ yum localinstall mysql57-community-release-el7-8.noarch.rpm


# 安装mysql

$ yum install mysql-community-server


# 启动MySQL服务

$ systemctl start mysqld
$ systemctl status mysqld


# 开机启动

$ systemctl enable mysqld
$ systemctl daemon-reload


# 查看密码

$ grep 'temporary password' /var/log/mysqld.log

# 生成的密码root@localhost: 2tCIQ7kyC/E8



# 登录

$ mysql -uroot -p

# 修改密码

$ ALTER USER 'root'@'localhost' IDENTIFIED BY '2tCIQ7kyC/E8123';
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Mysql密码

2tCIQ7kyC/E8123

配置数据库my.cnf

$ vi /etc/my.cnf

在末尾添加以下配置

character-set-server=utf8
collation-server=utf8_bin
default-storage-engine=INNODB
transaction-isolation=READ-COMMITTED
max_allowed_packet = 512M
innodb_log_file_size=2GB
binlog_format=row

重启数据库

$ systemctl restart mysqld

创建数据库
进入数据库

$ mysql -uroot -p

创建JIRA数据库

> CREATE DATABASE jiradb CHARACTER SET utf8 COLLATE utf8_bin;

创建Confluence数据库

> CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_bin;

上传Mysql驱动
上传驱动

$ scp mysql-connector-java-5.1.46/mysql-connector-java-5.1.46-bin.jar root@192.168.31.145:/root/

安装JIRA
上传atlassian-jira-software-7.10.1.tar.gz


# 上传atlassian-jira-software-7.10.1.tar.gz

$ scp atlassian-jira-software-7.10.1.tar.gz root@101.132.146.161:/root/

解压

$ tar -zxvf atlassian-jira-software-7.10.1.tar.gz
$ mv atlassian-jira-software-7.10.1-standalone/ /usr/local/atlassian-jira-software

配置jira_home

$ mkdir /var/jira

$ vim /etc/profile

在最后一行添加

export JIRA_HOME=/var/jira

重载/etc/profile

$ source /etc/profile

配置mysql驱动


# 拷贝到jira的安装目录下的atlassian-jira/WEB-INF/lib下

$ cp mysql-connector-java-5.1.46-bin.jar /usr/local/atlassian-jira-software/atlassian-jira/WEB-INF/lib/ 
$ cp mysql-connector-java-5.1.46-bin.jar /usr/local/atlassian-jira-software/lib/

编辑server配置文件

$ cd /usr/local/atlassian-jira-software/conf
$ vi server.xml

server.xml配置内容
<?xml version="1.0" encoding="utf-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<Server port="8005" shutdown="SHUTDOWN">
    <Listener className="org.apache.catalina.startup.VersionLoggerListener"/>
    <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on"/>
    <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
    <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>

    <Service name="Catalina">
        <!--
         ==============================================================================================================
         DEFAULT - Direct connector with no proxy for unproxied access to Jira.

         If using a http/https proxy, comment out this connector.
         ==============================================================================================================
        -->
        <!-- 注释掉此处 -->
        <!--
        <Connector port="8080" maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false"
                   maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443"
                   acceptCount="100" disableUploadTimeout="true" bindOnInit="false"/>
        -->


        <!--
         ==============================================================================================================
         HTTP - Proxying Jira via Apache or Nginx over HTTP

         If you're proxying traffic to Jira over HTTP, uncomment the below connector and comment out the others.
         Ensure the proxyName and proxyPort are updated with the appropriate information if necessary as per the docs.

         See the following for more information:

            Apache - https://confluence.atlassian.com/x/4xQLM
            nginx  - https://confluence.atlassian.com/x/DAFmGQ
         ==============================================================================================================
        -->

        <!-- 取消注释掉以下内容,并编辑proxyName为对应网址或ip -->

        <Connector port="8080" maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false"
                   maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443"
                   acceptCount="100" disableUploadTimeout="true" bindOnInit="false" scheme="http"
                   proxyName="192.168.31.145" proxyPort="80"/>


        <!--
         ==============================================================================================================
         HTTPS - Proxying Jira via Apache or Nginx over HTTPS

         If you're proxying traffic to Jira over HTTPS, uncomment the below connector and comment out the others.
         Ensure the proxyName and proxyPort are updated with the appropriate information if necessary as per the docs.

         See the following for more information:

            Apache - https://confluence.atlassian.com/x/PTT3MQ
            nginx  - https://confluence.atlassian.com/x/DAFmGQ
         ==============================================================================================================
        -->

        <!--
        <Connector port="8080" maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false"
                   maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443"
                   acceptCount="100" disableUploadTimeout="true" bindOnInit="false" secure="true" scheme="https"
                   proxyName="<subdomain>.<domain>.com" proxyPort="443"/>
        -->

        <!--
         ==============================================================================================================
         AJP - Proxying Jira via Apache over HTTP or HTTPS

         If you're proxying traffic to Jira using the AJP protocol, uncomment the following connector line
         See the following for more information:

            Apache - https://confluence.atlassian.com/x/QiJ9MQ
         ==============================================================================================================
        -->

        <!--
        <Connector port="8009" URIEncoding="UTF-8" enableLookups="false" protocol="AJP/1.3" />
        -->

        <Engine name="Catalina" defaultHost="localhost">
            <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
                <!-- 此处path设置为/jira,方便Apache配置反向代理 -->
                <Context path="/jira" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">
                    <Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction"
                              factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/>
                    <Manager pathname=""/>
                    <JarScanner scanManifest="false"/>
                </Context>

            </Host>
            <Valve className="org.apache.catalina.valves.AccessLogValve"
                   pattern="%a %{jira.request.id}r %{jira.request.username}r %t "%m %U%q %H" %s %b %D "%{Referer}i" "%{User-Agent}i" "%{jira.request.assession.id}r""/>
        </Engine>
    </Service>
</Server>



安装Confluence
解压atlassian-confluence-6.9.1.tar.gz,并移动到/usr/local/confluence

$ tar -xzvf atlassian-confluence-6.9.1.tar.gz
$ mv atlassian-confluence-6.9.1 /usr/local/confluence
$ cd /usr/local/confluence/

创建confluence主目录

$ mkdir /var/confluence-home

配置主目录

$ cd /usr/local/confluence/confluence/WEB-INF/classes
$ vi confluence-init.properties

配置confluence.home

confluence.home=/var/confluence-home

配置mysql驱动


# 拷贝到confluence的安装目录下的confluence/WEB-INF/lib/下

$ cp ~/mysql-connector-java-5.1.46-bin.jar /usr/local/confluence/confluence/WEB-INF/lib/ 
$ cp ~/mysql-connector-java-5.1.46-bin.jar /usr/local/confluence/lib/
1
2
3
4
5
编辑server配置文件

$ cd /usr/local/confluence/conf
$ vi server.xml

server.xml配置内容
<Server port="8000" shutdown="SHUTDOWN" debug="0">
    <Service name="Tomcat-Standalone">
        <!--
         ==============================================================================================================
         DEFAULT - Direct connector with no proxy, for unproxied HTTP access to Confluence.

         If using a http/https proxy, comment out this connector.
         ==============================================================================================================
        -->
       <!-- 注释掉此处 -->
       <!--
        <Connector port="8090" connectionTimeout="20000" redirectPort="8443"
                   maxThreads="48" minSpareThreads="10"
                   enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
                   protocol="org.apache.coyote.http11.Http11NioProtocol"/>
        -->

        <!--
         ==============================================================================================================
         HTTP - Proxying Confluence via Apache or Nginx over HTTP

         If you're proxying traffic to Confluence over HTTP, uncomment the connector below and comment out the others.
         Make sure you provide the right information for proxyName and proxyPort.

         For more information see:
            Apache - https://confluence.atlassian.com/x/4xQLM
            nginx  - https://confluence.atlassian.com/x/TgSvEg

         ==============================================================================================================
        -->

        <!-- 取消注释掉以下内容,并编辑proxyName为对应网址或ip -->
        <Connector port="8090" connectionTimeout="20000" redirectPort="8443"
                   maxThreads="48" minSpareThreads="10"
                   enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
                   protocol="org.apache.coyote.http11.Http11NioProtocol"
                   scheme="http" proxyName="192.168.31.145" proxyPort="80"/>


        <!--
         ==============================================================================================================
         HTTPS - Direct connector with no proxy, for unproxied HTTPS access to Confluence.

         For more info see https://confluence.atlassian.com/x/s3UC
         ==============================================================================================================
        -->

        <!--
        <Connector port="8443" maxHttpHeaderSize="8192"
                   maxThreads="150" minSpareThreads="25"
                   protocol="org.apache.coyote.http11.Http11NioProtocol"
                   enableLookups="false" disableUploadTimeout="true"
                   acceptCount="100" scheme="https" secure="true"
                   clientAuth="false" sslProtocol="TLSv1.2" sslEnabledProtocols="TLSv1.2" SSLEnabled="true"
                   URIEncoding="UTF-8" keystorePass="<MY_CERTIFICATE_PASSWORD>"/>
        -->

        <!--
         ==============================================================================================================
         HTTPS - Proxying Confluence via Apache or Nginx over HTTPS

         If you're proxying traffic to Confluence over HTTPS, uncomment the connector below and comment out the others.
         Make sure you provide the right information for proxyName and proxyPort.

         For more information see:
            Apache - https://confluence.atlassian.com/x/PTT3MQ
            nginx  - https://confluence.atlassian.com/x/cNIvMw
         ==============================================================================================================
        -->

        <!--
        <Connector port="8090" connectionTimeout="20000" redirectPort="8443"
                   maxThreads="48" minSpareThreads="10"
                   enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
                   protocol="org.apache.coyote.http11.Http11NioProtocol"
                   scheme="https" proxyName="<subdomain>.<domain>.com" proxyPort="443"/>
        -->

        <Engine name="Standalone" defaultHost="localhost" debug="0">
            <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false" startStopThreads="4">
                <!-- 此处path设置为/confluence,方便Apache配置反向代理 -->
                <Context path="/confluence" docBase="../confluence" debug="0" reloadable="false" useHttpOnly="true">
                    <!-- Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->
                    <Manager pathname=""/>
                    <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60"/>
                    <!-- 以下配置邮件功能,如果需要取下注释 -->
                    <!--
                    <Resource name="mail/ExmailSMTPServer"
                        auth="Container"
                        type="javax.mail.Session"
                        mail.smtp.host="smtp.exmail.qq.com"
                        mail.smtp.port="465"
                        mail.smtp.auth="true"
                        mail.smtp.user="邮箱地址"
                        password="邮箱密码"
                        mail.smtp.starttls.enable="true"
                        mail.transport.protocol="smtps"
                        mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
                    />
                    -->
                </Context>

                <Context path="${confluence.context.path}/synchrony-proxy" docBase="../synchrony-proxy" debug="0"
                         reloadable="false" useHttpOnly="true">
                    <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60"/>
                </Context>
            </Host>
        </Engine>
    </Service>
</Server>




安装Crowd
下载

$ wget https://www.atlassian.com/software/crowd/downloads/binary/atlassian-crowd-3.2.1.tar.gz

解压缩

$ tar -zxvf atlassian-crowd-3.2.1.tar.gz
$ mv atlassian-crowd-3.2.1 /usr/local/atlassian-crowd

配置crowd_home

$ mkdir /var/crowd-home
$ cd /usr/local/atlassian-crowd/crowd-webapp/WEB-INF/classes
$ vi crowd-init.properties

crowd-init.properties内容

## You can specify your crowd.home property here or in your system environment variables.



###############


##           ##


##  WINDOWS  ##


##           ##


###############


## On Windows-based operating systems, uncomment the following


## line and set crowd.home to a directory Crowd should use to


## store its configuration.


## NOTE: use forward slashes instead of backward slashes.



#crowd.home=c:/data/crowd-home



###############


##           ##


##  UNIX     ##


##           ##


###############


## On Unix-based operating systems, uncomment the following


## line and set crowd.home to a directory Crowd should use to


## store its configuration.



# 去掉crowd.home前面的#号

crowd.home=/var/crowd-home


创建数据库

> create database crowd character set utf8 collate utf8_bin;

配置mysql驱动


# 拷贝到crowd的安装目录下的crowd/WEB-INF/lib/下

$ cp ~/mysql-connector-java-5.1.46-bin.jar /usr/local/atlassian-crowd/apache-tomcat/lib/

集成Crowd
Crowd添加Confluence访问权限
https://confluence.atlassian.com/crowd/adding-an-application-18579591.html#AddinganApplication-add
Confluence集成Crowd

https://confluence.atlassian.com/crowd/integrating-crowd-with-atlassian-confluence-198573.html
JIRA 集成Crowd

https://confluence.atlassian.com/crowd/integrating-crowd-with-atlassian-jira-192625.html
此处略过相关配置,请根据官网进行配置

安装Apache
安装httpd

$ yum install httpd

服务命令

$ systemctl start httpd.service


# 配置开机启动

$ systemctl enable httpd.service


# 关闭开机启动httpd

$ systemctl disable httpd.service


# 停止服务

$ systemctl stop httpd.service


# 重启服务

$ systemctl restart httpd.service


# 加载配置文件

$ systemctl reload httpd.service

httpd配置文件

/etc/httpd/conf/httpd.conf
/etc/httpd/conf.d/

# 校验是否错误

$ apachectl configtest

配置jira和confluence

vi /etc/httpd/conf.d/atlassian.conf

<VirtualHost *:80>

    ServerName jira.**.com

    ProxyRequests Off
    ProxyVia Off

    <Proxy *>
         Require all granted
    </Proxy>

    ProxyPass /jira http://127.0.0.1:8080/jira
    ProxyPassReverse /jira http://127.0.0.1:8080/jira

    ProxyPass /confluence http://127.0.0.1:8090/confluence
    ProxyPassReverse /confluence http://127.0.0.1:8090/confluence

    ProxyPass /crowd http://127.0.0.1:8095/crowd
    ProxyPassReverse /crowd http://127.0.0.1:8095/crowd
</VirtualHost>

启动关闭jira

$ /usr/local/atlassian-jira-software/bin/start-jira.sh
$ /usr/local/atlassian-jira-software/bin/stop-jira.sh

启动关闭confluence

$ /usr/local/confluence/bin/start-confluence.sh
$ /usr/local/confluence/bin/stop-confluence.sh

启动关闭crowd

$ /usr/local/atlassian-crowd/start_crowd.sh
$ /usr/local/atlassian-crowd/stop_crowd.sh

(责任编辑:IT)
------分隔线----------------------------