2023年最新版confluence7.19.4、jira9.4破解并使用Nginx代理

背景

安装

jira

准备两个目录,一个是 jira 的安装目录,一个是 jira 的 home 目录,数据都存在 home 目录

/data/jira

/data/jira_home

下载,解压

wget https://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-9.4.1.tar.gz
tar zxvf atlassian-jira-software-9.4.1.tar.gz 

<installation-directory>/atlassian-jira/WEB-INF/classes/jira-application.properties这个文件加上

jira.home=/data/jira_home

<installation-directory>/bin/setenv.sh 加上破解程序

CATALINA_OPTS="-javaagent:/opt/atlassian-agent.jar ${CATALINA_OPTS}"

<installation-directory>/atlassian-jira/WEB-INF/lib 放置 mysql-connector-java-5.1.39.jar

jira 没有内置 mysql 的驱动,所以要提前下载好放这。MySQL 8.0 以下的一定要用 5.1 的,用 5.7 的有 bug,血泪史

启动安装即可

confluence

下载解压

wget https://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-9.4.1.tar.gz
tar zxvf tlassian-jira-software-9.4.1.tar.gz

准备两个目录,一个是 confluence 的安装目录,一个是 confluence 的 home 目录,数据都存在 home 目录

/data/conf

/data/conf_home

<installation-directory>/confluence/WEB-INF/classes/confluence-init.properties加上 home 目录

confluence.home=/data/conf_home

<installation-directory>/bin/setenv.sh 加上破解程序

CATALINA_OPTS="-javaagent:/opt/atlassian-agent.jar ${CATALINA_OPTS}"

<installation-directory>/confluence/WEB-INF/lib 放置 mysql-connector-java-5.1.39.jar

jira 没有内置 mysql 的驱动,所以要提前下载好放这。MySQL 8.0 以下的一定要用 5.1 的,用 5.7 的有 bug,血泪史

启动安装即可

破解

浏览器去访问 confluence 、jira 的 web 页面,当出现需要许可证时,如下图:

image

jira

java -jar atlassian-agent.jar \
    -d -m xx@ks.io -n pro -p jira \
    -o http://172.22.222.166 -s BA54-LAS2-TZZL-7H78

confluence

java -jar atlassian-agent.jar \
    -d -m xx@ks.io -n pro -p 'conf' \
    -o http://172.22.222.166 -s B0QF-RU2L-NL9H-Y163

切记 -p 后面跟着的不要变, confluence 必须用 -p 'conf',用其余的一律提示许可证不可用,血泪史

Nginx代理

jira

<Jira-Install>/conf/server.xml

找到

<Context docBase="${catalina.home}/atlassian-jira" path="" reloadable="false" useHttpOnly="true">

修改为:

<Context docBase="${catalina.home}/atlassian-jira" path="/jira" reloadable="false" useHttpOnly="true">

找到

<Connector port="8080"
  relaxedPathChars="[]|" 
  relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;" 
  maxThreads="150" 
  minSpareThreads="25" 
  connectionTimeout="20000" 
  enableLookups="false" 
  maxHttpHeaderSize="8192" 
  protocol="HTTP/1.1" 
  useBodyEncodingForURI="true" 
  redirectPort="8443" 
  acceptCount="100" 
  disableUploadTimeout="true"/>

改为

<Connector port="8080"
  relaxedPathChars="[]|" 
  relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"  
  maxThreads="150" 
  minSpareThreads="25" 
  connectionTimeout="20000" 
  enableLookups="false" 
  maxHttpHeaderSize="8192" 
  protocol="HTTP/1.1" 
  useBodyEncodingForURI="true" 
  redirectPort="8443" 
  acceptCount="100" 
  disableUploadTimeout="true"
  proxyName="xx.com" 
  proxyPort="80"/> 
 
<!-- OPTIONAL,Nginx Proxy Connector with https scheme-->
<Connector port="8081"
  relaxedPathChars="[]|" 
  relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"  
  maxThreads="150" 
  minSpareThreads="25" 
  connectionTimeout="20000" 
  enableLookups="false" 
  maxHttpHeaderSize="8192" 
  protocol="HTTP/1.1" 
  useBodyEncodingForURI="true" 
  redirectPort="8443" 
  acceptCount="100" 
  disableUploadTimeout="true"
  proxyName="xx.com" 
  proxyPort="443" 
  scheme="https" 
  secure="true"/> 
 
<!-- Standard HTTP Connector without any proxy config -->
<Connector port="8082"
  relaxedPathChars="[]|" 
  relaxedQueryChars="[]|{}^&#x5c;&#x60;&quot;&lt;&gt;"  
  maxThreads="150" 
  minSpareThreads="25" 
  connectionTimeout="20000" 
  enableLookups="false" 
  maxHttpHeaderSize="8192" 
  protocol="HTTP/1.1" 
  useBodyEncodingForURI="true" 
  redirectPort="8443" 
  acceptCount="100" 
  disableUploadTimeout="true"/>

nginx 配置

    location /jira {
        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://jira-hostname:8080/jira;
        client_max_body_size 10M;
    }

重启 jira,nginx

confluence

编辑 <installation-directory>/conf/server.xml

找到

<Context path="" docBase="../confluence" debug="0" reloadable="false">

改为

<Context path="/confluence" docBase="../confluence" debug="0" reloadable="false">

找到

<Connector port="8090" connectionTimeout="20000" redirectPort="8443"
   maxThreads="48" minSpareThreads="10"
   enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
   protocol="org.apache.coyote.http11.Http11NioProtocol"/>

改为

<Connector port="8090" connectionTimeout="20000" redirectPort="8443"
   maxThreads="48" minSpareThreads="10"
   enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
   protocol="org.apache.coyote.http11.Http11NioProtocol"
   scheme="https" secure="true" proxyName="xx.com proxyPort="443"/>

nginx 配置

  location /confluence {
        client_max_body_size 100m;
        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:8090/confluence;
    }
}

重启 confluence、nginx

备注

confluence 备份目录:/var/atlassian/application-data/confluence/backups

jira 备份目录:/var/atlassian/application-data/jira/export

posted @ 2022-12-20 17:50  海口-熟练工  阅读(11243)  评论(4编辑  收藏  举报