如何在CentOS 8 / RHEL 8 Linux上安装Jira

JIRA是Atlassian开发的项目管理工具,也用于与软件开发和其他项目相关的问题跟踪和错误跟踪。本指南将引导您完成在CentOS 8 / RHEL 8 Linux上的Jira安装。

步骤1:安装Java

要运行Jira,需要在您的CentOS 8 / RHEL 8计算机上安装Java才能运行。请查阅有关如何在CentOS / RHEL 8系统中安装Java的指南:

如何在RHEL 8 / CentOS 8上安装Java(OpenJDK 11)

通过检查Java版本来确认安装:

$ java -version
openjdk version "11.0.5" 2019-10-15 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.5+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.5+10-LTS, mixed mode, sharing)

步骤2:安装MySQL 5.7数据库服务器

撰写本文时,Jira不适用于MySQL 8数据库服务器,请使用下面的指南安装MySQL 5.7。

安装MySQL 5.7数据库CentOS 8 / RHEL 8

编辑MySQL 5.7配置服务器部分以添加以下行。

$ sudo vi /etc/my.cnf
[mysqld]
default-storage-engine=INNODB
character_set_server=utf8mb4
innodb_default_row_format=DYNAMIC
innodb_large_prefix=ON
innodb_file_format=Barracuda
innodb_log_file_size=2G
sql_mode = NO_AUTO_VALUE_ON_ZERO

重新启动mysqld服务:

sudo systemctl restart mysqld

安装数据库服务器后,以root用户身份登录并为Jira创建数据库和用户:

$ mysql -u root -p
CREATE DATABASE jira CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE USER 'jira'@'localhost' IDENTIFIED BY '[email protected]%rd';
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,REFERENCES,ALTER,INDEX on jira.* TO 'jira'@'localhost' IDENTIFIED BY '[email protected]%rd';
FLUSH PRIVILEGES;
QUIT;

步骤3:在CentOS 8 / RHEL 8上下载并安装JIRA

我们已经安装了Java和数据库服务器,下一步是下载JIRA的二进制文件。请在“ Jira下载”页面上检查最新版本。

sudo yum -y install wget
wget https://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-8.6.0-x64.bin -O atlassian-jira-software.bin

给出文件执行位:

chmod +x atlassian-jira-software.bin

现在启动安装程序:

sudo ./atlassian-jira-software.bin

按下 键启动Jira设置。

Unpacking JRE ...
Starting Installer ...

This will install Jira Software 8.6.0 on your computer.
OK [o, Enter], Cancel [c]
Click Next to continue, or Cancel to exit Setup.

选择[[1个]使用快速安装设置:

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]
1

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]
i
Extracting files ...
Please wait a few moments while Jira Software is configured.
Installation of Jira Software 8.6.0 is complete

接受以启动Jira服务。

Installation of Jira Software 8.6.0 is complete
Your installation of Jira Software 8.6.0 is now ready and can be accessed
via your browser.
Jira Software 8.6.0 can be accessed at http://localhost:8080
Finishing installation ...

安装Java MySQL连接器:

wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.18.zip
unzip mysql-connector-java-8.0.18.zip
sudo cp mysql-connector-java-8.0.18/mysql-connector-java-8.0.18.jar /opt/atlassian/jira/lib

重新启动Jira:

sudo /etc/init.d/jira stop
sudo /etc/init.d/jira start

步骤4:在CentOS 8 / RHEL 8上配置JIRA Nginx代理

安装Nginx Web服务器并启用该服务。

sudo yum -y install nginx
sudo systemctl enable --now nginx

配置HTTP连接器

编辑Jira服务器配置文件。

sudo vi /opt/atlassian/jira/conf/server.xml

找到以下代码段:

并添加 proxyNameproxyPort 元素(用适当的属性替换它们),以及下面的另一个连接器–用于排查绕过代理的故障:

proxyName="jira.computingforgeeks.com" proxyPort="80"/>

还要添加这些新行以绕过代理。


            

别忘了更换 jira.computingforgeeks.com 在您的配置中,您的配置应如下所示:

重新启动Jira:

sudo /etc/init.d/jira stop
sudo /etc/init.d/jira start

配置Nginx

为Jira创建一个新的Nginx配置文件。

sudo vi /etc/nginx/conf.d/jira.conf

更新Nginx设置以使用以下服务器(替换 jira.computingforgeeks.com 与FQDN和 本地主机 如果Nginx位于其他服务器上,则使用服务器的主机名):

server {
    listen 80;
    server_name jira.computingforgeeks.com;
    location / {
        proxy_set_header X-Forwarded-Host $host;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
        proxy_pass http://localhost:8080;
        client_max_body_size 10M;
    }
}

禁用Nginx并重新启动Jira和Nginx

sudo setenforce 0
sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config
sudo  /etc/init.d/jira stop
sudo  /etc/init.d/jira start
sudo systemctl restart nginx

确认两个服务的状态:

$ systemctl status jira nginx
● jira.service
   Loaded: loaded (/etc/rc.d/init.d/jira; generated)
   Active: active (running) since Mon 2020-01-06 16:06:27 EAT; 22s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 6299 ExecStop=/etc/rc.d/init.d/jira stop (code=exited, status=0/SUCCESS)
  Process: 6393 ExecStart=/etc/rc.d/init.d/jira start (code=exited, status=0/SUCCESS)
    Tasks: 89 (limit: 11512)
   Memory: 357.4M
   CGroup: /system.slice/jira.service
           └─6430 /opt/atlassian/jira/jre//bin/java -Djava.util.logging.config.file=/opt/atlassian/jira/conf/logging.properties -Djava.util.logging.man>

Jan 06 16:06:27 centos8.novalocal jira[6393]:                `UOJ
Jan 06 16:06:27 centos8.novalocal jira[6393]: [1B blob data]
Jan 06 16:06:27 centos8.novalocal jira[6393]:       Atlassian Jira
Jan 06 16:06:27 centos8.novalocal jira[6393]:       Version : 8.6.0
Jan 06 16:06:27 centos8.novalocal jira[6393]: [19B blob data]
Jan 06 16:06:27 centos8.novalocal jira[6393]: If you encounter issues starting or stopping Jira, please see the Troubleshooting guide at https://docs.a>
Jan 06 16:06:27 centos8.novalocal jira[6393]: Server startup logs are located in /opt/atlassian/jira/logs/catalina.out
Jan 06 16:06:27 centos8.novalocal jira[6393]: Tomcat started.
Jan 06 16:06:27 centos8.novalocal runuser[6399]: pam_unix(runuser:session): session closed for user jira
Jan 06 16:06:27 centos8.novalocal systemd[1]: Started jira.service.

● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2020-01-06 16:06:43 EAT; 6s ago
  Process: 6540 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
  Process: 6538 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=0/SUCCESS)
  Process: 6537 ExecStartPre=/usr/bin/rm -f /run/nginx.pid (code=exited, status=0/SUCCESS)
 Main PID: 6542 (nginx)
    Tasks: 2 (limit: 11512)
   Memory: 3.9M
   CGroup: /system.slice/nginx.service
           ├─6542 nginx: master process /usr/sbin/nginx
           └─6543 nginx: worker process

Jan 06 16:06:43 centos8.novalocal systemd[1]: Starting The nginx HTTP and reverse proxy server...
Jan 06 16:06:43 centos8.novalocal nginx[6538]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
Jan 06 16:06:43 centos8.novalocal nginx[6538]: nginx: configuration file /etc/nginx/nginx.conf test is successful
Jan 06 16:06:43 centos8.novalocal systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Jan 06 16:06:43 centos8.novalocal systemd[1]: Started The nginx HTTP and reverse proxy server.

在防火墙中允许http端口:

sudo firewall-cmd --add-service=http --permanent
sudo firewall-cmd --reload

安装完成后,前往 jira.example.com 在浏览器中开始设置过程。

选择“我自己来设置”。

如何在CentOS 8 / RHEL 8 Linux上安装Jira

点击“下一个“并提供MySQL数据库凭据。对于类型,选择”我自己的数据库

如何在CentOS 8 / RHEL 8 Linux上安装Jira

单击测试连接,然后将显示成功连接消息。

如何在CentOS 8 / RHEL 8 Linux上安装Jira

在接下来的页面中,填写“应用程序标题”,“模式”,JIRA许可证,管理员帐户,电子邮件通知。最后一页将要求您选择默认语言。

如何在CentOS 8 / RHEL 8 Linux上安装Jira

访问Jira Admin仪表板以创建更多用户。

如何在CentOS 8 / RHEL 8 Linux上安装Jira

在下一个指南中,我们将介绍“让我们加密SSL证书”来保护您的Jira安装。

更多指南:

在Debian 10(Buster)上安装OpenProject Community Edition

最佳项目管理专业人员(PMP)认证书

如何在Ubuntu上安装Taiga.io项目管理工具

评分最高的AWS Cloud认证准备书

最佳认证Scrum Master准备书

Sidebar