如何在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