昨天转载了
Judy Shen的《使用JIRA搭建企业问题跟踪系统》,在这篇文章中Jude Shen着重讲解了JIRA的特性和常用的设置。但是对于安装却没有提及,在本人实际安装JIRA的过程中,出现了一些问题,虽然最终解决但是花费了本人一下午的时间。为了帮助大家顺利安装,今天本人把安装的过程重新梳理一遍,请特别留意红色字体的部分。
- 安装JDK(JDK1.4.2以上),配置JAVA_HOME,安装Mysql(本人使用的版本是5.0.19),安装tomcat(5.0.28)
- 下载JIRA: 本人下载的版本为----3.6 Enterprise EAR/WAR的Zip文件
- 解压缩JIRA,编辑解压缩目录\edit-webapp\WEB-INF\classes\entityengine.xml文件,原文件定义使用hsql(红色字体为增加部分):
- <transaction-factory class="org.ofbiz.core.entity.transaction.JNDIFactory">
<user-transaction-jndi jndi-server-name="default" jndi-name="java:comp/env/UserTransaction"/>
<transaction-manager-jndi jndi-server-name="default" jndi-name="java:comp/env/UserTransaction"/>
</transaction-factory> - 原来的field-type-name="hsql",改为“mysql”
- <datasource name="defaultDS" field-type-name="mysql"
helper-class="org.ofbiz.core.entity.GenericHelperDAO"
check-on-start="true"
use-foreign-keys="false"
use-foreign-key-indices="false"
check-fks-on-start="false"
check-fk-indices-on-start="false"
add-missing-on-start="true"
check-indices-on-start="true">
<jndi-jdbc jndi-server-name="default" jndi-name="java:comp/env/jdbc/JiraDS"/> - 修改完entityengine.xml文件的上述两个地方后,执行加压缩目录下的build加压缩目录下的build.bat将默认地生成JIRA的war包
- 下载mysql-connector-java-3.1.12-bin.jar拷贝到Tomcat安装目录的\common\lib下,请特别注意版本号必须为3.1.12
- 从Atlassian下载jira-jars-tomcat5.zip拷贝到Tomcat安装目录的\common\lib下
10. 配置Tomcat
安装目录conf/server.xml,增加 useBodyEncodingForURI="true"
<Connector port="8080"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" useBodyEncodingForURI="true"/>
11. 创建数据库(我命名为jiradb,使用utf8编码)
12. 创建数据库的使用用户(jirauser)
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX on
jiradb.* TO 'jirauser'@'localhost' IDENTIFIED BY 'mypassword';
13. 拷贝dist-tomcat目录下的war包拷贝到tomcat安装目录下的webapps/目录下,拷贝dist-tomcat/tomcat-5/jira.xml到tomcat安装目录下/conf/Catalina/localhost/ 并修改该该文件
删除下列配置(适用于hsqldb)
<!-- NOTE: If NOT using hsqldb, delete the next two parameters -->
<!-- Give unused connections 4 secs before eviction. -->
<parameter>
<name>minEvictableIdleTimeMillis</name>
<value>4000</value>
</parameter>
<!-- Check for evictions every 5 secs. -->
<parameter>
<name>timeBetweenEvictionRunsMillis</name>
<value>5000</value>
</parameter>
修改后的jira.xml文件如下:
<!--
A sample configuration file for Tomcat 4.1.x and 5.0
Customize the docBase attribute, drop in your $CATALINA_HOME/webapps/ (4.1.x) or
$CATALINA_HOME/conf/Catalina/localhost/ (5.0) directory and restart Tomcat.
Note the JOTM dependencies; you'll need to copy various jars to Tomcat's common/lib/ directory.
See http://www.atlassian.com/software/jira/docs/latest/servers/tomcat41.html for details.
-->
<Context path="/jira" docBase="C:\usr\Apache\Tomcat5\webapps\jira" debug="0">
<Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/JiraDS">
<parameter>
<name>driverClassName</name>
<!-- NOTE: if you change the database type, you will need to change it in WEB-INF/classes/entityengine.xml -->
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost/jiradb?autoReconnect=true&useUnicode=true&characterEncoding=UTF8&mysqlEncoding=utf8</value>
</parameter>
<parameter>
<name>username</name>
<value>jirauser</value>
</parameter>
<parameter>
<name>password</name>
<value>mypassword</value>
</parameter>
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
</ResourceParams>
<Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction"/>
<ResourceParams name="UserTransaction">
<parameter>
<name>factory</name>
<value>org.objectweb.jotm.UserTransactionFactory</value>
</parameter>
<parameter>
<name>jotm.timeout</name>
<value>60</value>
</parameter>
</ResourceParams>
</Context>
14. 启动tomcat,敲入http://.../jira,应该就能看到JIRA的配置向导了
(全文完)