linux系统下JIRA 配置https

linux系统下JIRA 配置https

首先需要安装jdk,MySQL,其次安装JIRA。
一,配置证书

1, 使用 keytool($JAVA_HOME/bin/keytool)生成本地秘钥库文件(*.jks):

$JAVA_HOME/bin/keytool -genkeypair -keysize 2048 -alias jira -keyalg RSA -sigalg SHA256withRSA -keystore /opt/atlassian/ca/jira.jks


1)*.jks文件不要放在安装目录,以免后续升级时被冲掉;

2)执行时要输入 firt and last name 时。要写域名或者IP,比如: 192.168.100.101,jira.company.com;

3)执行时要输入密码,只能是字母和数字组合,记住了,后续要用到。

2, 生成证书签名请求(*.csr):

$JAVA_HOME/bin/keytool -certreq -keyalg RSA -alias jira -file jira.csr -keystore /opt/atlassian/ca/jira.jks

:执行时要输入上一步设置的密码。

3, 签名(*.crt):(有俩种方式获取)

1)CA机构签名:

将生成的 jira.csr 提交给CA机构签名,CA会给你签名后的证书 jira.crt 以及根证书或者中间证书:root.crt

2)自签名:

生成密钥和根证书:

openssl req -newkey rsa:2048 -nodes -keyout ca.key -x509 -days 365 -out ca.crt

自签名:

openssl x509 -req -CA ca.crt -CAkey ca.key -in jira.csr -out jira.crt -days 365 -CAcreateserial

检查签名:

openssl verify -verbose -CAfile ca.crt jira.crt

在这里插入图片描述

4, 导入根证书、签名的证书至本地秘钥库:

$JAVA_HOME/bin/keytool -importcert -alias rootCA -keystore /opt/atlassian/ca/jira.jks -trustcacerts -file ca.crt

$JAVA_HOME/bin/keytool -importcert -alias jira -keystore /opt/atlassian/ca/jira.jks -file jira.crt

检查导入证书:

$JAVA_HOME/bin/keytool -list -alias jira -keystore /opt/atlassian/ca/jira.jks

在这里插入图片描述

二、配置JIRA服务

1,备份<Jira_INSTALL>/conf/server.xml

2,配置https连接选项:

编辑<Jira_INSTALL>/conf/server.xml,增加如下:

    <Connector port="8443" maxHttpHeaderSize="8192" relaxedPathChars="[]|" relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"
               maxThreads="150" minSpareThreads="25"
               protocol="org.apache.coyote.http11.Http11NioProtocol"
               enableLookups="false" disableUploadTimeout="true"
               acceptCount="100" scheme="https" secure="true"
               clientAuth="false" useBodyEncodingForURI="true" URIEncoding="UTF-8"
               sslProtocol="TLSv1.2" sslEnabledProtocols="TLSv1.2,TLSv1.3" SSLEnabled="true"
               keyAlias="jira" keystoreFile="/opt/atlassian/ca/jira.jks" keystorePass="xxx" keystoreType="JKS"/>

1)如果JIRA是老版本升级的,那没有这个参数会启动不起来,一定要加上:relaxedQueryChars="[]|{}^\`"<>"

2)如果https端口不是8443,修改了端口,http里的对应也要改:
在这里插入图片描述

3,配置http自动重定向https页面:

编辑<Jira_INSTALL>/atlassian-jira/WEB-INF/web.xml,在前增加如下:

<security-constraint>
	<web-resource-collection>
		<web-resource-name>all-except-attachments</web-resource-name>
		<url-pattern>*.jsp</url-pattern>
		<url-pattern>*.jspa</url-pattern>
		<url-pattern>/browse/*</url-pattern>
		<url-pattern>/issues/*</url-pattern>
	</web-resource-collection>
	<user-data-constraint>
		<transport-guarantee>CONFIDENTIAL</transport-guarantee>
	</user-data-constraint>
</security-constraint>

三、重启JIRA

使用原来的地址访问,会自动跳到https的8443端口,或者使用https://ip地址:8443。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

来了,慢慢看

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值