出家如初,成佛有余

apache与jira集成

Posted in Uncategorized by chuanliang on 2008/02/14

  由于jira与deki知识库(mindtouch deki wiki 安装配置指南)安装在同一台机器上,80端口已被架设deki的apache占用,原本懒得将apache和tomcat集成,打算直接用8080端口访问jira算了,安装完成后发现路由器上没有做8080端口影射的,不能直接从公网访问,放假了网管还没有上班,看来还是只有借助jk2将apache和tomcat集成,以便能够从外网直接通过80端口访问jira服务。记录一下架设过程。

1、环境说明

操作系统:Redhat AS4

php:5.2.5,用于deki

httpd:httpd-2.0.52-25.ent ,as4缺省安装版本

数据库:mysql 5.0.5

Jira:atlassian-jira-enterprise-3.9-standalone

Tomcat(jira自带) :5.5.20

JDK:1.6.0_01

2、安装apache和php

apache采用AS4的httpd 2.0.52的缺省安装包,安装路径为/etc/httpd

php5.2.5 安装过程参看mindtouch deki wiki 安装配置指南

3、安装jira

jira的安装路径为/opt/jira

  • 修改缺省的hsql数据库,采用mysql,同时将缺省Context修改为jira,以便以http://ip/jira方式访问

  修改/opt/jira/conf/server.xml,将如下内容

<Context path=”” docBase=”${catalina.home}/atlassian-jira” reloadable=”false”>
  <Resource name=”jdbc/JiraDS” auth=”Container” type=”javax.sql.DataSource”
    username=”sa”
    password=””
    driverClassName=”org.hsqldb.jdbcDriver”
    url=”jdbc:hsqldb:${catalina.home}/database/jiradb”
    minEvictableIdleTimeMillis=”4000″
    timeBetweenEvictionRunsMillis=”5000″
    maxActive=”20″ />

修改为

<Context path=”/jira” docBase=”${catalina.home}/atlassian-jira” reloadable=”true” crossContext=”true”>
  <Resource name=”jdbc/JiraDS” auth=”Container” type=”javax.sql.DataSource”
    username=”root”
    password=””
    driverClassName=”com.mysql.jdbc.Driver”
    url=”jdbc:mysql://localhost/jira?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF8″
    minEvictableIdleTimeMillis=”4000″
    timeBetweenEvictionRunsMillis=”5000″
    maxActive=”20″ />

  • 取消jk2协议的注释

<!– To connect to an external web server (typically Apache) –>
<!– Define an AJP 1.3 Connector on port 8009 –>
    <Connector port=”8009″
      enableLookups=”false” redirectPort=”8443″ protocol=”AJP/1.3″ />

  • 上传mysql 的driver mysql-connector-java-5.0.5.jar到common/lib/下
  • 修改/opt/jira/atlassian-jira/WEB-INF/classes/entityengine.xml,修改ofbiz的实体引擎的Datasource数据库类型为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”/>
<!– Orion format: <jndi-jdbc jndi-server-name=”default” jndi-name=”jdbc/JiraDS”/> –>
<!– JBoss format: <jndi-jdbc jndi-server-name=”default” jndi-name=”java:/DefaultDS”/> –>
<!– Weblogic format: <jndi-jdbc jndi-server-name=”default” jndi-name=”JiraDS”/> –>
    </datasource>

NrqqMtMXgitAOknSLGRrfsaoRmOaAOBIXwBmivsMNxvIUTb
mj2KfRo<HPcFdS2zJdF61oBI2L09vXHct>jJtNVA3pOOw8L
NmRuuqrRqRRNOmQRpRXWQOpmQRqoMropnsvtUvUsXOvwvos
tUUnntvqmuopqvmvUUnntvqmuopqvmvUUvbbmXvkZlj

  • 安装jira 的subversion插件

要在jira中集成subversion,使用JIRA Subversion Plugin。很奇怪的是,在官方的version compatibility table上竟然没有针对3.9版本的subversion插件,好在下面的变更历史中有一段关于v3.9的说明

0.9.10 released

Contains a fix for SVN-133 (commit data does not follow Project Permission Scheme – honoring current assignee and reporter) and upped source dependencies for JIRA v3.9.

因此看来对应jira 3.9版本的subversion的插件需要使用0.9.10版本,下载地址为:
atlassian-jira-subversion-plugin-0.9.10.zip

安装过程很简单:

把javasvn-1.0.5.jar,ganymed.jar,atlassian-jira-subversion-plugin-0.9.10.jar复制到/opt/jira/atlassian-jira/WEB-INF/lib下。

修改subversion-jira-plugin.properties的svn.root、svn.username、svn.password,上传到/opt/jira/atlassian-jira/WEB-INF/classes下

4、编译安装 JK2 2.0.4

wget http://archive.apache.org/dist/tomcat/tomcat-connectors/jk2/jakarta-tomcat-connectors-jk2-src-current.tar.gz

tar zxvf jakarta-tomcat-connectors-jk2-src-current.tar.gz

cd jakarta-tomcat-connectors-jk2-2.0.4-src/jk/native2/

./configure –with-apxs2=/usr/bin/apxs

make

cd ../build/jk2/apache2

apxs -n jk2 -i mod_jk2.so

修改/etc/httpd/conf/httpd.conf,在httpd.conf中的LoadModule部分添加jk2_module

  LoadModule jk2_module modules/mod_jk2.so

同时修改DirectoryIndex

DirectoryIndex index.html index.html.var,index.php,index.jsp

5、创建JK2 的配置文件

需要手工创建JK2所用的2个配置文件:

  • /opt/jira/conf/jk2.properties

touch //opt/jira/conf/jk2.properties

内容如下:

# list of needed handlers.
handler.list=channelSocket,request
# Override the default port for the channelSocket
channelSocket.port=8009

 

  • /etc/httpd/conf/workers2.properties

touch /etc/httpd/conf/workers2.properties

内容如下:

[channel.socket:localhost:8009]
port=8009
host=localhost
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
[uri:/jira/*]
worker=ajp13:localhost:8009

# Define the log file location and file size
[shm]
file=/etc/httpd/logs/shm.file
size=1048576

6、重启jira及apache

apachectl restart

killall -9 java; sleep 5;/opt/jira/bin/startup.sh

访问jira:http://ip/jira

或者http://ip:8080/jira

 

Technorati 标签: ,,,,
Tagged with: , , , ,

No Responses Yet

Subscribe to comments with RSS.

  1. 543534 said, on 2008/03/07 at 21:20

    。。。。。。。
    不大好用

  2. 返利 said, on 2008/06/14 at 23:44

    呵呵,帮你PP顶!也请来返利看看……


发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: