JIRA集成环境
此文档仅技术分享。不可商用,商用请购买官方软件
JIRA集成环境说明:
* 下载的是独立安装包,自带Tomcat服务,因此不需要再安装Tomcat环境
* 系统默认安装了Java 1.7.0_45环境,但较乱,这里选择新安装一个JDK
第一部分:安装JDK环境
1. 下载JDK二进制版安装包:
安装版本:jdk-7u60-linux-x64.gz
下载地址:http://yun.baidu.com/share/link?shareid=1769428623&uk=103052787
查看最新:http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. 解压并安装JDK:
# cd /usr/local/src
# tar xzvf jdk-7u60-linux-x64.gz -C /usr/lib/jvm
# cd /usr/lib/jvm
# mv jdk1.7.0_60 jdk7
3. 配置环境变量:
# vi /etc/profile (注:在最后添加下面的行)
export JAVA_HOME=/usr/lib/jvm/jdk7
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=$CLASSPATH:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
# source /etc/profile
4. 配置默认JDK:(一般情况下也可以不配置)
# update-alternatives --config java (注:查看当前各种JDK版本和配置)
# update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk7/bin/java 300
# update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk7/bin/javac 300
# update-alternatives --config java
There are 3 programs which provide 'java'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
2 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
3 /usr/lib/jvm/jdk7/bin/java
Enter to keep the current selection[+], or type selection number: 3 (注:新安装的)
5. 测试下JAVA环境:
----------------------------------------------------------------------------------------------------------------
第二部分:安装Tomcat服务器(本例中不用安装)
注:因为下载的是独立安装包,自带Tomcat服务器,所以跳过这一部分
1. 下载Apache Tomcat二进制版安装包:
安装版本:apache-tomcat-6.0.43.zip
下载地址:http://mirrors.cnnic.cn/apache/tomcat/tomcat-6/v6.0.43/bin/
2. 解压并安装Tomcat:
# cd /usr/local/src
# unzip apache-tomcat-6.0.43.zip
# mv apache-tomcat-6.0.43 /usr/local/tomcat6
3. 配置环境变量:
# vi /etc/profile (注:最好在最后,并且在”export PATH”行的上面添加)
export TOMCAT_HOME=/usr/local/tomcat6
# source /etc/profile
4. 给Tomcat服务器启动关闭等SHELL文件添加可执行权限:
# cd /usr/local/tomcat6/bin
# chmod +x *.sh
5. 启动Tomcat服务器:
# cd /usr/local/tomcat6/bin
# ./startup.sh
Using CATALINA_BASE: /usr/local/tomcat6
Using CATALINA_HOME: /usr/local/tomcat6
Using CATALINA_TMPDIR: /usr/local/tomcat6/temp
Using JRE_HOME: /usr/lib/jvm/jdk7/jre
Using CLASSPATH: /usr/local/tomcat6/bin/bootstrap.jar
# ps -ef|grep tomcat
root 6219 1 10 18:43 pts/0 00:00:05 /usr/lib/jvm/jdk7/jre/bin/java -Djava.util.logging.config.file=/usr/local/tomcat6/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/tomcat6/endorsed -classpath /usr/local/tomcat6/bin/bootstrap.jar -Dcatalina.base=/usr/local/tomcat6 -Dcatalina.home=/usr/local/tomcat6 -Djava.io.tmpdir=/usr/local/tomcat6/temp org.apache.catalina.startup.Bootstrap start
-----------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------
第三部分:安装MySQL服务器(本例中也不用安装)
注:因为JIRA与GitLab安装在同一台服务器上,将共用GitLab集成环境中带的MySQL服务器。
1. 下载源代码版安装包:
安装版本:mysql-5.5.22.tar.gz
下载地址:http://dev.mysql.com/downloads/mysql/5.5.html#downloads
2. 检查安装环境,需要下面的依赖库,如果没有请手动或在线安装:
cmakebison gcc gcc-c++ autoconf automake zlib
libxml ncurses-devel libtool-ltdl-devel
# rpm -qa |grep bison
3. 检查下服务器上是否已安装了其他版本的MYSQL服务器或客户端,有卸掉:
# rpm -qa |grep my
# rpm -qa |grep sql
# rpm -e mysql-libs
# rpm -e mysql
4. 创建MYSQL用户,数据存储目录:
# groupadd mysql
# useradd -g mysql mysql
# mkdir -p /data/mysqldata
# chown -R mysql:mysql /data/mysqldata
5. 编译安装MYSQL 5.5.22服务器:
# cd /usr/local/src
# tar xzvf mysql-5.5.22.tar.gz
# cd mysql-5.5.22
# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/etc \
-DMYSQL_DATADIR=/data/mysqldata-DMYSQL_TCP_PORT=3306 \
-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock -DMYSQL_USER=mysql
# gmake
# gmake install
6. 设置MYSQL服务器配置文件:
# cd /usr/local/mysql
# cp support-files/my-medium.cnf /etc/my.cnf
# vi /etc/my.cnf
[mysqld]
# FOR GLOBAL
max_connections = 50
skip-name-resolve
# FOR INNODB
innodb_buffer_pool_size = 512M
innodb_additional_mem_pool_size = 50M
7. 初始化数据库,并添加为MYSQLD系统服务:
# cd /usr/local/mysql
# ./scripts/mysql_install_db --datadir=/data/mysqldata --basedir=/usr/local/mysql \
--defaults-file=/etc/my.cnf --user=mysql
# cp ./support-files/mysql.server /etc/rc.d/init.d/mysqld
# chmod 755 /etc/init.d/mysqld
# chkconfig --add mysqld
# chkconfig --level 24 mysqld off
# chkconfig --level 35 mysqld on
8. 配置MYSQLD启动脚本:
# vi /etc/init.d/mysqld
basedir=/usr/local/mysql
datadir=/data/mysqldata
9. 配置环境变量:
# vi /etc/profile
export PATH=/usr/local/mysql/bin:${JAVA_HOME}/bin:$PATH
# source /etc/profile
10. 启动MYSQL服务器,并设置root密码:
# service mysqld start
# mysqladmin -u root password '123456'
# netstat -ant |grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
[root@bjwkrgit01018 mysql]# ps -ef|grep mys
root 16697 1 0 22:19 pts/0 00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/data/mysqldata --pid-file=/data/mysqldata/bjwkrgit01018.pid
mysql 16997 16697 0 22:19 pts/0 00:00:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/mysqldata --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/data/mysqldata/bjwkrgit01018.err --pid-file=/data/mysqldata/bjwkrgit01018.pid --socket=/tmp/mysqld.sock --port=3306
# mysql -uroot -p123456
-----------------------------------------------------------------------------------------------------------------
第四部分:安装JIRA并破解
(参照技术牛人:http://blog.itpub.net/26230597/viewspace-1275597)
1. 下载JIRA集成环境二进制版安装包:
下载版本:atlassian-jira-6.3.6.tar.gz
官网地址:https://www.atlassian.com/software/jira/download
百度网盘:http://pan.baidu.com/s/1eQgTYKE
2. 解压安装文件:
# tar xzvf atlassian-jira-6.3.6.tar.gz
# mv atlassian-jira-6.3.6-standalone /usr/local/jira6
3. 在GitLab自带的MYSQL中新建JIRA需要的数据库并授权:
注:GitLab/opt/gitlab-7.8.1-0/README.txt会描述相关信息
# cd /opt/gitlab-7.8.1-0/mysql/bin
# ./mysql -uroot -phyzx1234(此密码与GitLab管理账户的密码一样)
CREATE DATABASE jira6 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
grant all privileges on jira6.* to jira6@'localhost' identified by 'jira6@123';
flush privileges;
4. 下载JDBC连接MYSQL的驱动包,并放到JIRA的库文件目录中:
# cp /usr/local/src/mysql-connector-java-5.1.22/mysql-connector-java-5.1.22-bin.jar /usr/local/jira6/atlassian-jira/WEB-INF/lib/
注:如果8080已经被占用,可修改JIRA服务器的默认监听端口为8081:
# lsof -i:8080
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 6219 root 37u IPv6 23232 0t0 TCP *:webcache (LISTEN)
# lsof -i:8081
# vi /usr/local/jira6/conf/server.xml
<Connector port="8081" (注:这行配置在第49行)
# more /usr/local/jira6/conf/server.xml |grep 8080
# more /usr/local/jira6/conf/server.xml |grep 8081
<Connector port="8081"
5. 新建JIRA Home目录并修改配置文件,不要和安装目录一致,会报错:
# mkdir /usr/local/jira6/jira_home
# vi /usr/local/jira6/atlassian-jira/WEB-INF/classes/jira-application.properties
jira.home = /data/jira_home
6. 下载汉化包与破解补丁包:
-----------------------------------------------------------------------------------------------------
汉化包:JIRA-6.3.3-language-pack-zh_CN.jar
下载地址:http://download.csdn.net/download/mchdba/7943421
注:汉化包经测试不好使,不汉化了,使用英文版的,以后有机会再汉化
---------------------------------------------------------------------------------------------------------
破解补丁包:atlassian-extras-2.2.2.jar
下载地址:http://download.csdn.net/download/mchdba/7950429
7. 启动JIRA服务:
# /usr/local/jira6/bin/startup.sh
# ps -ef | grep jira
root 26917 1 12 15:48 pts/0 00:03:51 /usr/lib/jvm/jdk7/jre/bin/java -Djava.util.logging.config.file=/usr/local/jira6/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -XX:MaxPermSize=384m -Xms384m -Xmx768m -Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory -XX:+PrintGCDateStamps -XX:-OmitStackTraceInFastThrow -Djava.endorsed.dirs=/usr/local/jira6/endorsed -classpath /usr/local/jira6/bin/bootstrap.jar:/usr/local/jira6/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/jira6 -Dcatalina.home=/usr/local/jira6 -Djava.io.tmpdir=/usr/local/jira6/temp org.apache.catalina.startup.Bootstrap start
8. 在浏览器中访问下面的网址,如果能进入欢迎页,说明JIRA服务器正常:
http://192.168.1.20:8080
或者:
http://192.168.1.20:8080/secure/Dashboard.jspa
---------------------------------------------------------------------------------------------------------------
9. 停止JIRA服务器,应用汉化包,再启动JIRA,如果可以正常显示中文说明汉化成功:
注:下面的汉化步骤暂时不做
# /usr/local/jira6/bin/shutdown.sh
# cp /usr/local/src/JIRA-6.3.3-language-pack-zh_CN.jar
/usr/local/jira6/atlassian-jira/WEB-INF/lib/
# /usr/local/jira6/bin/startup.sh
汉化后的访问界面:
-----------------------------------------------------------------------------------------------------------------
10. 配置JIRA:
1)首先是语言配置,选择默认的英语:
2)接着数据库选择已创建好的MYSQL数据库并测试下连接:
* 经测试MySQL主机名需要设置为:127.0.0.1
* 测试过程需要点时间,如果连接数据库没有问题,会在后台创建JIRA需要的表:
3)测试通过后,进入JIRA应用程序属性设置页:
4)单击”Next”,进入配置安装类型信息页,这里选择第一个”项目跟踪”:
5)单击”Next”,进入授权页面:
*这一步需要先到官网(my.atlassian.com)注册一个账号(最好用QQ邮箱),选择JIRA Server类型,输入Server ID (找一个,例如:BSDM-SW1T-IPPX-F4DB),填写公司名称,然后生成一个评估版的许可证,因为安装过程必须使用,大约能用90天
*把License Key框中的内容全部复制出来保存:
*本次申请的License KEY内容如下:
AAABKA0ODAoPeNptkF9PgzAUxd/7KZr4og9doAIzJE3caI0YYARQp/Gl4tXVQNkKLNu3lw0T/2QPN
7nJufd3Ts5ZsepxLA2mHrYsn3q+Y+OAF5hatos4tKVR6041mt2F2Qyf52C2YC5efCy2surlQUKBg
ePCZQfs8EisS0I99KmMnESqBN2CeFNHjEgKkaVZmAsUNLqTZSdiqSpG6dV06rr0erOZlE2NfvCsM
z38YRX7NSSyBhYs4lhkQTiLRn2gqS2MD9V4+wCmPUAoGmx0B1rqEsRurcz+V1yHUBctzIfUqh1Nb
5+elyM06etXMIv3+3ZAMWKjsYOQs3nOY5I/2gUJ03RJbhw+R7lI2DAkcl3bsj0HfWcezqOQn1JOh
0l7U65kC/87/QKuyYjiMCwCFE401CeKiJTlAW5U7gWw+cCfq5dLAhQ4AldhHugMnHTo//Kepc9fw
keN+Q==X02eu
6)设置管理员账号:jiraadmin
7)邮件服务器配置,可选择后来再配置:
8)配置完成,进入JIRA管理控制台:
9)安装插件Jira Agile并申请试用license
用管理员账号登陆Jira,进入插件管理,选择安装插件Jira Agile,并在界面上申请试用license。安装成功后会显示该插件版本和license details等信息,此时应显示为试用license,有效期为30天。
11. 破解授权许可证:
1)单击管理控制台右上角齿轮状的”设置”图标,再选择”系统”-“授权”,可看到当前许可证的使用期限:
2)备份atlassian-extras-2.2.2.jar包并用下载的破解包替换它:
# cp /usr/local/jira6/atlassian-jira/WEB-INF/lib/atlassian-extras-2.2.2.jar
/usr/local/jira6/atlassian-jira/WEB-INF/lib/bak20150401_atlassian-extras-2.2.2.jar
# cp /usr/local/src/atlassian-extras-2.2.2.jar
/usr/local/jira6/atlassian-jira/WEB-INF/lib/atlassian-extras-2.2.2.jar
用atlassian-universal-plugin-manager-plugin-2.13.3.jar替换你的JIRA的安装目录的\atlassian-jira\WEB-INF\atlassian-bundled-plugins.zip中的同名jar包。
3)重启JIRA服务器:
# /usr/local/jira6/bin/shutdown.sh
# /usr/local/jira6/bin/startup.sh
4)编写一份授权码文件(文档后面有模板),更新上去:
查看你在Jira网站的注册帐号信息,根据“key字段说明.txt”文件中的说明,修改破解目录中Jira_key.txt 和 agile_key.txt文件中的对应字段。
访问Jira Portal,用管理员账号登陆,进入system-->license, 将第4步中填好的jira_key.txt文件中内容粘贴到Update License输入框中,并点击“add”,License即更新成功。这时你应该看到License Type显示为JIRA:Commercial。
例:
key字段说明(以Jira_key为例)
Description=JIRA: Commercial,
CreationDate=你的安装日期,格式(yyyy-mm-dd),
jira.LicenseEdition=ENTERPRISE,
Evaluation=false,
jira.LicenseTypeName=COMMERCIAL,
jira.active=true,
licenseVersion=2,
MaintenanceExpiryDate=你想设置的失效日期如:2099-12-31,
Organisation=你的Company Name,
SEN=你申请到的SEN注意没有前缀LID,
ServerID=你申请到的ServerID,
jira.NumberOfUsers=-1,
LicenseID=LID你申请到的SEN,注意LID前缀不要丢掉,
LicenseExpiryDate=你想设置的失效日期如:2099-12-31,
PurchaseDate=你的安装日期,格式(yyyy-mm-dd)
(注意,各项之间以逗号分隔;日期格式必须为yyyy-mm--dd,例如2014-08-03)
最后破解Agile插件
进入Add-Ons-->Manage Add-ons,展开插件Jira Agile,显示出详细内容。点击License key旁的Edit按钮,将第4步中准备的agile_key.txt文件中内容粘贴到展开的输入框中,然后单击Update按钮。这时你应该看到该插件的license已经更新为Unlimited-user commercial license。
例:
Description=JIRA Agile (formerly GreenHopper) for JIRA\: Commercial,
NumberOfUsers=-1,
CreationDate=2014-08-01,
Evaluation=false,
greenhopper.LicenseEdition=ENTERPRISE,
licenseVersion=2,
MaintenanceExpiryDate=2099-01-01,
Organisation=saper,
greenhopper.active=true,
SEN=SEN-L4390388,
ServerID=BQJE-RNSR-9NMG-JDWN,
LicenseExpiryDate=2099-01-01,
LicenseTypeName=COMMERCIAL,
PurchaseDate=2014-08-01
说明:
启动/重启JIRA服务器的命令:
# /usr/local/jira6/bin/startup.sh
# /usr/local/jira6/bin/shutdown.sh
12. 备份恢复:
1)备份恢复附件:/usr/local/jira6/jira_home/data/attachments
2)备份恢复用户数据:(备份为XML文件)
* 手动: Administration à System à IMPORT&EXPORT à Backup / RestoreSystem
* 自动:Administration à System à Services à Backup Service
3)备份MySQL中的jira6数据库,正常有上面两个备份就可以了
本次破解编写的授权码如下:
Description=JIRA: Commercial,
CreationDate=2015-03-25,
jira.LicenseEdition=ENTERPRISE,
Evaluation=false,
jira.LicenseTypeName=COMMERCIAL,
jira.active=true,
licenseVersion=2,
MaintenanceExpiryDate=2099-12-31,
Organisation=HYZX,
SEN=SEN-L5510164,
ServerID=BSDM-SW1T-IPPX-F4DB,
jira.NumberOfUsers=-1,
LicenseID=AAABKA0ODAoPeNptkF9PgzAUxd/7KZr4og9doAIzJE3caI0YYARQp/Gl4tXVQNkKLNu3lw0T/2QPN
7nJufd3Ts5ZsepxLA2mHrYsn3q+Y+OAF5hatos4tKVR6041mt2F2Qyf52C2YC5efCy2surlQUKBg
ePCZQfs8EisS0I99KmMnESqBN2CeFNHjEgKkaVZmAsUNLqTZSdiqSpG6dV06rr0erOZlE2NfvCsM
z38YRX7NSSyBhYs4lhkQTiLRn2gqS2MD9V4+wCmPUAoGmx0B1rqEsRurcz+V1yHUBctzIfUqh1Nb
5+elyM06etXMIv3+3ZAMWKjsYOQs3nOY5I/2gUJ03RJbhw+R7lI2DAkcl3bsj0HfWcezqOQn1JOh
0l7U65kC/87/QKuyYjiMCwCFE401CeKiJTlAW5U7gWw+cCfq5dLAhQ4AldhHugMnHTo//Kepc9fw
keN+Q==X02eu,
LicenseExpiryDate=2099-12-31,
PurchaseDate=2015-03-25
授权码参数范例如下:
Description=JIRA: Commercial,
CreationDate=你的安装日期,格式(yyyy-mm-dd),注意一定要和控制台里的一样,
jira.LicenseEdition=ENTERPRISE,
Evaluation=false,
jira.LicenseTypeName=COMMERCIAL,
jira.active=true,
licenseVersion=2,
MaintenanceExpiryDate=你想设置的失效日期如:2099-12-31,
Organisation=注册时填的公司名,如HYZX,
SEN=你申请到的SEN,
ServerID=你申请到的ServerID,
jira.NumberOfUsers=-1,
LicenseID=你申请到的评估版许可证,
LicenseExpiryDate=你想设置的失效日期如:2099-12-31,
PurchaseDate=你的安装日期,格式(yyyy-mm-dd),注意一定要和控制台里的一样
配置JIRA为系统服务的步骤如下:
vim/etc/init.d/jira
# chkconfig: 2345 85 15
# description: jira
# processname: jira
# source function library
. /etc/init.d/functions
#下面一行比较重要,为jira的安装路径,没有的话,将会提示找不到文件
CATALINA_HOME="/home/jira/atlassian-jira-6.3.6-standalone"
RETVAL=0
start() {
echo -n $"Starting jira services: "
. $CATALINA_HOME/bin/catalina.sh start
RETVAL=$?
echo
}
stop() {
echo -n $"Shutting down jira services: "
. $CATALINA_HOME/bin/catalina.sh stop
RETVAL=$?
echo
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
;;
status)
status jira
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit $RETVAL
# 修改权限:
chmod+x /etc/init.d/jira
# 添加到开机启动
chkconfig–add jira
# 启动
/etc/init.d/jirastart
# 停止
/etc/init.d/jirastop
此文档仅技术分享。不可商用,商用请购买官方软件