本文介绍在CentOS 8/RHEL 8 Linux操作系统上安装和配置Jira的方法。JIRA是Atlassian开发的项目管理工具,它还用于与软件开发和其他项目相关的问题跟踪和错误跟踪。
步骤1:安装Java 要运行Jira,需要在CentOS 8/RHEL 8计算机上安装Java,参考:在CentOS 8上安装Java 11(OpenJDK 11)和Java 8(OpenJDK 8)的方法。 通过检查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: 在CentOS 8/RHEL 8 Linux系统上安装和配置MySQL 5.7数据库。 编辑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 'Str0ngDBP@ssw%rd'; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,REFERENCES,ALTER,INDEX on jira.* TO 'jira'@'localhost' IDENTIFIED BY 'Str0ngDBP@ssw%rd'; FLUSH PRIVILEGES; QUIT;
步骤3:在CentOS 8/RHEL 8上下载并安装JIRA 我们已经安装了Java和数据库,下一步是下载JIRA的二进制文件,在Jira下载页面上检查最新版本,地址是:https://www.atlassian.com/software/jira/download,也可以使用终端下载: 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 按<Enter>键开始设置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 输入i键开始安装: 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 1、配置HTTP连接器 编辑Jira服务器配置文件: sudo vi /opt/atlassian/jira/conf/server.xml 找到以下代码段: <Connector port="8080" relaxedPathChars="[]|" relaxedQueryChars="[]|{}^\`"<>" 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和proxyPort元素(用适当的属性替换它们),以及下面的另一个连接器,用于排查绕过代理的故障排除: proxyName="jira.computingforgeeks.com" proxyPort="80"/> 还添加这些新行以绕过代理: <!-- Standard HTTP Connector --> <Connector port="8082" maxThreads="150" minSpareThreads="25" connectionTimeout="20000" enableLookups="false" maxHttpHeaderSize="8192" protocol="HTTP/1.1" useBodyEncodingForURI="true" redirectPort="8443" acceptCount="100" disableUploadTimeout="true"/> 不要忘记在配置中替换jira.computingforgeeks.com(请自行更改为自己的域名),配置应如下所示:
重新启动Jira: sudo /etc/init.d/jira stop sudo /etc/init.d/jira start 2、配置Nginx 为Jira创建一个新的Nginx配置文件: sudo vi /etc/nginx/conf.d/jira.conf 更新Nginx设置以拥有以下服务器(如果Nginx位于其他服务器上,则将Fira的jira.computingforgeeks.com替换为FQDN,并将localhost替换为服务器的主机名): 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
在防火墙中允许http端口: sudo firewall-cmd --add-service=http --permanent sudo firewall-cmd --reload 参考:在CentOS 8系统上配置和管理防火墙(Firewall)的方法。 安装完成后,请在浏览器中访问jira.example.com以开始设置过程。 选择下图中的“I’ll set it up myself”:
单击下一步并提供MySQL数据库帐户及密码,对于类型,选择“My Own Database”:
单击“Test Connection”,然后将显示成功连接消息:
在接下来的页面中,填写“Application title”、“Mode”、JIRA许可证、管理员帐户、电子邮件通知,最后一页将要求选择默认语言:
然后访问Jira Admin仪表板以创建更多用户:
至此,在CentOS 8/RHEL 8 Linux上安装和配置Jira全部完成。
相关主题 |