做者:阿東
微信公衆號:傑哥的IT之旅(ID:Jake_Internet)java
JIRA 介紹
Jira是atlassian公司出品的一款事務管理軟件。不管是需求仍是BUG或者是任務,都是事務的一種,因此JIRA能夠勝任很是多的角色:需求管理、缺陷跟蹤、任務管理等mysql
Jira提供專門的scrum視圖和kanban視圖,因此適合敏捷開發團隊使用。linux
工具基礎概念
問題:不一樣的組織使用jira追蹤不一樣的問題。Jira的項目根據企業組織定製,是問題的集合。
模塊:一個項目模塊是這個項目中問題的邏輯分類集合。每一個項目能夠根據企業組織的要求設置多個模塊。
例如:一個軟件研發項目能夠設置「文檔」、「郵件系統」、「用戶界面」等模塊。git
版本:對於一些項目類型來講,特別是軟件研發項目,爲問題關聯產品的版本是很是有用的。
一個問題能夠設置兩種類型的版本信息。
影響版本----能夠清晰的反映出這個問題在哪一個版本中出現錯誤。
例如:一個軟件的缺陷可能影響了產品的1.1和1.2github
修復版本-----能夠反映出報告的問題將在哪一個版本,或已經在哪一個版本中修復。
例如:軟件缺陷影響了產品的1.1版和1.2版,這個缺陷已經在2.0版中修復。注意沒有修復版本的問題會被歸類到爲規劃。
版本能夠有3個狀態:已發佈、未發佈和已歸檔
版本能夠設置發佈日期,而jira會自動將到期尚未發佈的版本高亮顯示出來,並標註上「超期」標誌。web
安裝
環境:
Centos 7
Jdk-1.8
Mysql-5.6
Jira-7.8.1sql
查看java版本數據庫
# java -version
Mysql 的安裝(yum)
安裝mysql,爲jira常見對應的數據庫、用戶名和密碼json
下載mysql源vim
安裝rpm包 # wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm 安裝後,會獲得兩個mysql的yum的repo源 # rpm -ivh mysql-community-release-el7-5.noarch.rpm 安裝mysql # yum install mysql-server mysql-client 啓動mysql # systemctl enable mysqld # systemctl start mysqld 重置mysql密碼 # mysql -u root > use mysql; > update user set password=password(‘new passed’) where user=’user_name’; > flush privileges; > create database jira default characher set utf8 collate utf8_bin; > show databases; > grant all on jira. To ‘jira’@’%’ indentified by ‘jirapasswd’; > flush privileges;
下載並安裝jira
查看 linux 系統位數
# genconf LONG_BIT 64
Jira的下載網站
地址:https://www.atlassian.com/software/jira/update
# wget https://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-7.8.1-x64.bin # chmod 755 ./atlassian-jira-software-7.8.1-x64.bin # ./atlassian-jira-software-7.8.1-x64.bin Unpacking JRE ... Starting Installer ... This will install JIRA Software 7.4.1 on your computer. OK [o, Enter], Cancel [c] o # 按o安裝 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] 2 # 2 爲自定義安裝 Where should JIRA Software be installed? [/opt/atlassian/jira] /usr/local/atlassina/jira # 自定義安裝目錄 Default location for JIRA Software data [/var/atlassian/application-data/jira] /usr/local/atlassina/jira_data # 自定義數據目錄 Configure which ports JIRA Software will use. JIRA requires two TCP ports that are not being used by any other applications on this machine. The HTTP port is where you will access JIRA through your browser. The Control port is used to startup and shutdown JIRA. Use default ports (HTTP: 8080, Control: 8005) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2] 2 # 2爲自定義端口 HTTP Port Number [8080] # 8080 爲默認端口 8050 # http鏈接端口 Control Port Number [8005] 8040 # 控制端口 JIRA can be run in the background. You may choose to run JIRA as a service, which means it will start automatically whenever the computer restarts. Install JIRA as Service? Yes [y, Enter], No [n] y # 是否開機自啓 Details on where JIRA Software will be installed and the settings that will be used. Installation Directory: /usr/local/atlassina/jira Home Directory: /usr/local/atlassina/jira_data HTTP Port: 8050 RMI Port: 8040 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 7.4.1 is complete Start JIRA Software 7.4.1 now? Yes [y, Enter], No [n] y # 啓動 Please wait a few moments while JIRA Software starts up. Launching JIRA Software ... Installation of JIRA Software 7.4.1 is complete Your installation of JIRA Software 7.4.1 is now ready and can be accessed via your browser. JIRA Software 7.4.1 can be accessed at http://localhost:8050 Finishing installation ...
修改默認端口
Jira安裝到了/opt/Atlassian/jira和/var/Atlassian/application-data/jira目錄下,而且jira監聽的端口是8080。Jira的主要配置文件,存放在/opt/Atlassian/jira/conf/server.xml文件中。
# vim /opt/Atlassian/jira/conf/server.xml # cd /opt/Atlassian/jira/bin # ./start-jira.sh
破解JIRA
先關閉jira,將破解包裏面的atlassian-extras-3.2.jar和mysql-connector-java-5.1.39-bin.jar兩個文件複製到/opt/Atlassian/jira/Atlassian-jira/WEB-INF/lib的目錄下
Atlassian-extras-3..2.jar 用做破解jira系統
Mysql-connectir-java 用來鏈接mysql數據庫的驅動軟件包
# cp mysql-connector-java-5.1.47.jar /opt/atlassian/jira/lib/ # cp ./atlassian-extras-3.2.jar /opt/atlassian/jira/atlassian-jira/WEB-INF/lib
也可自行在官網註冊30天的是使用註冊碼:
註冊官網:https://my.atlassian.com
或使用如下地址:
https://id.atlassian.com/signup?application=mac&continue=https://my.atlassian.com
登錄帳號後,選擇 New Evaluation License
將上圖中生成的key複製到頁面
設置管理員用戶
安裝完成。
Jira集成cas
參考文章:https://github.com/apereo/java-cas-client#atlassian-integration
下載cas-client依賴包地址:http://central.maven.org/maven2/org/jasig/cas/client/
整理思路
Cas的客戶端實現是依靠正在客戶端配置cas的過濾器和監聽器實現的,並配置在首位,用於監聽子系統的session和收取cas server發過來的命令。
Jira有本身自己的用戶登陸登出的驗證機制,jira的登陸主要依靠認證器com.atlassian.jira.security.login.JiraSeraphAuthenticator來進行認證
那麼在jira的配置文件配置cas的客戶端依賴,並替換條jira的認證器便可實現cas的整合,cas官網提供了相關的jar包和配置說明。
主要步驟
1.配置web.xml,須要注意的是過濾器和監聽器的位置
2.配置seraph-config.xml,設定跳轉地址
3.拷貝依賴包到jira目錄,須要注意的是兩個包版本需一致
過程
1.配置web.xml
須要配置過濾器和監聽器兩個配置
# vim /opt/Atlassian/jira/Atlassian-jira/WEB-INF/web.xml a.配置cas的過濾器 <!-- CAS:START - JAVA Client Filters --> <filter> <filter-name>CasSingleSignOutFilter</filter-name> <filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class> </filter> <filter> <filter-name>CasAuthenticationFilter</filter-name> <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class> <init-param> <param-name>casServerLoginUrl</param-name> <param-value>http://192.168.1.133:8080/cas/login</param-value> </init-param> <init-param> <param-name>serverName</param-name> <param-value>http://192.168.1.20:8080/</param-value> </init-param> </filter> <filter> <filter-name>CasValidationFilter</filter-name> <filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class> <init-param> <param-name>casServerUrlPrefix</param-name> <param-value>http://192.168.1.133:8080/cas/</param-value> </init-param> <init-param> <param-name>serverName</param-name> <param-value>http://192.168.1.20:8080/</param-value> </init-param> <init-param> <param-name>redirectAfterValidation</param-name> <param-value>true</param-value> </init-param> </filter> <!-- CAS:END--> <!-- CAS:START Java client filter mappings--> <filter-mapping> <filter-name>CasSingleSignOutFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>CasAuthenticationFilter</filter-name> <url-pattern>/*</url-pattern> <!--須要全匹配,否則就會直接能夠訪問到登陸頁面的問題--> </filter-mapping> <filter-mapping> <filter-name>CasValidationFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!--CAS:END--> <filter-mapping> <filter-name>login</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping>
過濾器filter配置說面
過濾器mapping配置說明
Mapping必須配置在login這個過濾器上面
b.配置監聽器 <listener> <listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class> </listener>
監聽器配置說明
監聽器,須要配置到DO NOT ADD ANY SERVLET CONTEXT LISTENERS這段話的上面,或者下面。
2.配置seraph-config.xml
須要修改seraph-config.xml,更改受權爲cas,同時配置登出和登陸的信息
a.配置登陸和登出信息
# vim /opt/atlassian/jira/atlassian-jira/WEB-INF/classes/seraph-config.xml --> <param-name>login.url</param-name> <param-value>http://192.168.1.133:8080/cas/login?service=${originalurl}</param-value> <!-- <param-value>/login.jsp?permissionViolation=true&os_destination=${originalurl}&page_caps=${pageCaps}&user_role=${userRole}</param-value> --> <!--<param-value>http://sso.mycompany.com/login?redirectTo=${originalurl}</param-value>--> </init-param> <init-param> <!-- the URL to redirect to when the user explicitly clicks on a login link (rather than being redirected after trying to access a protected resource). Most of the time, this will be the same value as 'login.url'. - same properties as login.url above --> <param-name>link.login.url</param-name> <param-value>http://192.168.1.133:8080/cas/login?service=${originalurl}</param-value> <!-- <param-value>/login.jsp?os_destination=${originalurl}</param-value> --> <!--<param-value>/secure/Dashboard.jspa?os_destination=${originalurl}</param-value>--> <!--<param-value>http://sso.mycompany.com/login?redirectTo=${originalurl}</param-value>--> </init-param> <init-param> <!-- URL for logging out. - If relative, Seraph just redirects to this URL, which is responsible for calling Authenticator.logout(). - If absolute (eg. SSO applications), Seraph calls Authenticator.logout() and redirects to the URL --> <param-name>logout.url</param-name> <param-value>http://192.168.1.133:8080/cas/logout</param-value> <!--<param-value>/secure/Logout!default.jspa</param-value>--> <!--<param-value>http://sso.mycompany.com/logout</param-value>--> </init-param>
配置cas的受權方式,註釋點原來的驗證方式
3.拷貝cas依賴包
拷貝cas的客戶端依賴的jar包,(cas-client-core-3.3.3.jar,cas-client-integration-atlassian-3.3.3.jar),到/opt/atlassian/jira/Atlassian-jira/WEB-INF/lib
# cp cas-client-* /opt/atlassian/jira/atlassian-jira/WEB-INF/lib/
4.重啓jira服務
啓動服務
# /opt/Atlassian/jira/bin/start-jira.sh 關閉服務 # /opt/Atlassian/jira/bin/shutdown.sh #查看日誌 # tail -f /opt/Atlassian/jira/logs/Catalina.out
可能遇到的問題
1.com.atlassian.plugin.osgi.container.OsgiContainerException: Cannot start plugin: com.atlassian.jira.plugins.jira-development-integration-plugin
緣由:語言包的問題,在破解的時候存在問題
2.未認證服務
添加服務到casa上,還須要在./tomcat/webapps/cas/WEB-INF/class/application.properties,配置cas.serviceRegistry.initFromJson=true,讓cas能夠從json來初始化數據。
Confluence集成cas
主要步驟:
1.配置web.xml文件,設置過濾器,匹配
2.配置seraph-config.xml,設定訪問到cas的信息
3.修改xwork.xml(這個文件存在於confluence-3.0.1.jar),配置登出
4.導入cas登陸的jar包
5.重啓cas服務
6.登陸測試
1.配置web.xml
編輯web.xml添加過濾器,監聽器
# vim /opt/Atlassian/confluence/confluence/confluence/WEB-INF/web.xml
過濾器定義:在全部過濾器後面,配置cas的過濾器
<!—配置過濾器和cas以及本地服務的路徑信息> <!--CAS:START - Java Client Filters--> <filter> <filter-name>CasSingleSignOutFilter</filter-name> <filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class> </filter> <filter> <filter-name>CasAuthenticationFilter</filter-name> <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class> <init-param> <param-name>casServerLoginUrl</param-name> <param-value>http://192.168.1.136:8080/cas/login</param-value> </init-param> <init-param> <param-name>serverName</param-name> <param-value>http://192.168.1.30:8090/</param-value> </init-param> </filter> <filter> <filter-name>CasValidationFilter</filter-name> <filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class> <init-param> <param-name>casServerUrlPrefix</param-name> <param-value>http://192.168.1.136:8080/cas/</param-value> </init-param> <init-param> <param-name>serverName</param-name> <param-value>http://192.168.1.30:8090/</param-value> </init-param> </filter> <!--CAS:END-->
過濾器匹配,在登陸匹配
<!-- End plugins 2.5 filter changes --> <!--CAS:START - Java Client Filter Mappings--> <filter-mapping> <filter-name>CasSingleSignOutFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter-mapping> <filter-name>CasAuthenticationFilter</filter-name> <url-pattern>/login.action</url-pattern> </filter-mapping> <filter-mapping> <filter-name>CasValidationFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!--CAS:END --> <filter-mapping> <filter-name>login</filter-name> <url-pattern>/*</url-pattern> <dispatcher>FORWARD</dispatcher> <dispatcher>REQUEST</dispatcher> <dispatcher>ERROR</dispatcher> </filter-mapping>
監聽器配置地址
在全部監聽器前面,配置監聽器,也就是在Servlet Context Listeners (Executed on app startup/shutdown)這段話後面,配置監聽器
<listener> <listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class> </listener>
2.配置seraph-config.xml
配置seraph-config.xml,設定訪問cas登陸的信息,同時設置confluence的受權信息爲cas的方式
# vim /opt/Atlassian/confluence/confluence/WEB-INF/classes/seraph-config,xml
修改默認的登陸配置
<parameters> <init-param> <param-name>login.url</param-name> <!-- <param-value>/login.action?os_destination=${originalurl}&permissionViolation=true</param-value> --> <param-value>http://192.168.1.136:8080/cas/login?service=${originalurl}</param-value> </init-param> <init-param> <param-name>link.login.url</param-name> <!-- <param-value>/login.action</param-value>--> <param-value>http://192.168.1.136:8080/cas/login?service=${originalurl}</param-value> </init-param> <init-param> 設定受權信息 <!-- Default Confluence authenticator, which uses the configured user management for authentication. --> <!-- <authenticator class="com.atlassian.confluence.user.ConfluenceAuthenticator"/>--> <authenticator class="org.jasig.cas.client.integration.atlassian.ConfluenceCasAuthenticator"/>
3.配置登出
獲取到xwork.xml文件,須要從lib目錄下面,獲取到confluence-6.9.0.jar文件,將jar包複製到某個目錄進行解壓
#```
cp /opt/Atlassian/confluence/confluence/WEB-INF/lib/confluence-6.9.0.jar /home/ceshi/
將獲取到的xwork.xml文件複製到/opt/Atlassian/confluence/confluence/WEB-INF/classes目錄下
設定退出重定向到cas服務器上
<action name="logout" class="com.atlassian.confluence.user.actions.LogoutAction">
<interceptor-ref name="defaultStack"/>
<!-- <result name="error" type="velocity">/logout.vm</result>-->
<result name="success" type="redirect">http://192.168.1.136:8080/cas/logout</result>;
</action>
![](https://s4.51cto.com/images/blog/202101/25/971ab3b78f039b56a04b5566e38f0be0.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=) **4.添加jar包** 添加的jar包爲csa-client-core-3.3.3.jar和cas-client-integration-atlassian-3.5.0.jar,貌似版本不一樣不會報錯 # cp ./cas-client* /opt/Atlassian/confluence/confluence/WEB-INF/lib/ **5.重啓confluence服務** # /opt/Atlassian/confluence/bin/stop-confluence.sh # /opt/Atlassian/confluence.bin/start-confluence.sh 6.登陸測試