在 ubuntu server 安装 JIRA 7
环境
操作系统 Ubuntu 14.04.5 LTS
软件版本 atlassian-jira-software-7.1.9-x64.bin
安装前准备
安装 Vim,用于编辑配置文本
sudo apt-get install vim
安装 Java 环境
检查是否安装了 Java 环境
java -version
如果输出为类似这样,则表示当前没有安装 Java 环境,需要进行安装
The program 'java' can be found in the following packages:
* default-jre
* gcj-4.8-jre-headless
* openjdk-7-jre-headless
* gcj-4.6-jre-headless
* openjdk-6-jre-headless
Try: apt-get install <selected package>
更新包并安装相关依赖
sudo apt-get update
sudo apt-get install default-jre
sudo apt-get install default-jdk
sudo apt-get install python-software-properties
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:webupd8team/java
这里运行 sudo add-apt-repository ppa:webupd8team/java
可能会遇到以下报错,是因为没有配置好相关依赖,需要运行 sudo apt-get install software-properties-common
才能顺利执行
sudo: add-apt-repository: command not found
然后安装 Java8
sudo apt-get install oracle-java8-installer
如果报错如下:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package oracle-java8-installer
执行一次包更新就可以了
sudo apt-get update
完成后,查看 Java 版本
java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
这样,Java 已经顺利安装完成。
配置 Java 环境
查看当前 Java 安装位置
sudo update-alternatives --config java
输出如下,可直接 Enter 回车,不进行修改
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-8-oracle/jre/bin/java 1072 auto mode
1 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 manual mode
2 /usr/lib/jvm/java-8-oracle/jre/bin/java 1072 manual mode
Press enter to keep the current choice[*], or type selection number:
之后配置 Java 环境变量
sudo vim /etc/environment
将其修改为:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
JAVA_HOME="/usr/lib/jvm/java-8-oracle"
然后应用修改
source /etc/environment
这时候查询 Java 的系统变量值:
echo $JAVA_HOME
应该可以得到:
/usr/lib/jvm/java-8-oracle
获取 JIRA 安装文件
从官网下载文件,用 wget 方式,注意选择版本
sudo wget https://downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-7.1.9-x64.bin
下载成功如下:
--2016-08-22 15:17:11-- https://downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-7.1.9-x64.bin
Resolving downloads.atlassian.com (downloads.atlassian.com)... 54.230.8.86, 54.230.8.215, 54.230.8.52, ...
Connecting to downloads.atlassian.com (downloads.atlassian.com)|54.230.8.86|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 321966262 (307M) [application/octet-stream]
Saving to: 'atlassian-jira-software-7.1.9-x64.bin'
100%[======================================>] 321,966,262 77.8MB/s in 6.2s
2016-08-22 15:17:17 (49.6 MB/s) - 'atlassian-jira-software-7.1.9-x64.bin' saved [321966262/321966262]
安装 JIRA
解压文件并启动安装
chmod a+x atlassian-jira-software-7.1.9-x64.bin
./atlassian-jira-software-7.1.9-x64.bin
其中的配置,可以选默认值或者自定义,具体输出如下:
Unpacking JRE ...
Starting Installer ...
Aug 22, 2016 3:22:11 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
This will install JIRA Software 7.1.9 on your computer.
OK [o, Enter], Cancel [c]
Choose the appropriate installation or upgrade option.
Please choose one of the following:
Express Install (use default settings) [1], Custom Install (recommended for advanced users) [2, Enter], Upgrade an existing JIRA installation [3]
Where should JIRA Software be installed?
[/opt/atlassian/jira]
Default location for JIRA Software data
[/var/atlassian/application-data/jira]
Configure which ports JIRA Software will use.
JIRA requires two TCP ports that are not being used by any other
applications on this machine. The HTTP port is where you will access JIRA
through your browser. The Control port is used to startup and shutdown JIRA.
Use default ports (HTTP: 8080, Control: 8005) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2]
JIRA can be run in the background.
You may choose to run JIRA as a service, which means it will start
automatically whenever the computer restarts.
Install JIRA as Service?
Yes [y, Enter], No [n]
Details on where JIRA Software will be installed and the settings that will be used.
Installation Directory: /opt/atlassian/jira
Home Directory: /var/atlassian/application-data/jira
HTTP Port: 8080
RMI Port: 8005
Install as service: Yes
Install [i, Enter], Exit [e]
Extracting files ...
Please wait a few moments while JIRA Software starts up.
Launching JIRA Software ...
Installation of JIRA Software 7.1.9 is complete
Your installation of JIRA Software 7.1.9 is now ready and can be accessed
via your browser.
JIRA Software 7.1.9 can be accessed at http://localhost:8080
Finishing installation ...
这时候,JIRA 就安装完成了,如果是在虚拟机安装的,那么打开 http://ip-address:8080
就可以看到 JIRA 的页面了。
其它配置
JIRA 目前版本,是需要在线激活并认证才能使用,支持免费试用 14 天。
打开后其中可以配置 mysql 或其他数据库,也可以使用内置数据库,不过内置数据库是用来演示及测试的,生产环境不建议使用。
常见问题
打开网页后,如果在配置 JIRA 的过程中,遇到网页显示 error,不用太担心,可能是服务在后台正在配置,稍微等待一会儿,过一会刷新下就可以了。
参考资料
- 安装 Java
https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get
- Python 命令配置
http://www.arthurtoday.com/2010/09/ubuntu-add-apt-repository.html
- 安装 JIRA
https://www.mininodes.com/how-to-install-jira-on-an-ubuntu-arm-server/