Ubuntu 11.10 安装Java、JIRA/Confluence/FishEye、Nginx

1.替换Ubuntu源

编辑/etc/apt/source.list

deb http://mirrors.163.com/ubuntu/ oneiric main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ oneiric-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ oneiric-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ oneiric-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ oneiric-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ oneiric main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ oneiric-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ oneiric-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ oneiric-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ oneiric-backports main restricted universe multiverse

2.安装Java

sudo apt-get install openjdk-7-jdk
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
export PAHT=$JAVA_HOME:$PATH

3.下载、安装、启动JIRA/Confluence/FishEye

http://confluence.atlassian.com/display/JIRA/Installing+JIRA+on+Linux

http://confluence.atlassian.com/display/DOC/Installing+Confluence+on+Linux

http://confluence.atlassian.com/display/FISHEYE/Installing+FishEye

默认JIRA为8080端口,Confluence为8090端口,FishEye为8060端口

启动

/opt/atlassian/jira/bin/start-jira.sh
/opt/atlassian/confluence/bin/start-confluence.sh
/opt/atlassian/fecru/bin/start.sh

4.安装Nginx并配置JIRA/Confluence/FishEye端口转发

安装Nginx

sudo apt-get install nginx

按子域名配置proxy

# sudo vi /etc/nginx/nginx.conf
# add lines below to http {}
server {
    listen          80;
    server_name     *.dev.xxx.com;
    location / {
        if ( $host ~ "jira.dev.xxx.com" ) {
                proxy_pass      http://localhost:8080;
        }
        if ( $host ~ "wiki.dev.xxx.com" ) {
                proxy_pass      http://localhost:8090;
        }
        if ( $host ~ "code.dev.xxx.com" ) {
                proxy_pass      http://localhost:8060;
        }
        proxy_connect_timeout 30s;
        proxy_send_timeout 90;
        proxy_read_timeout 90;
        proxy_buffer_size 32k;
        proxy_buffers 4 32k;
        proxy_busy_buffers_size 64k;
        proxy_redirect off;
        proxy_hide_header Vary;
        proxy_set_header Accept-Encoding '';
        proxy_set_header Host $host;
        proxy_set_header Referer $http_referer;
        proxy_set_header Cookie $http_cookie;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

启动

sudo /etc/init.d/nginx start

5.配置JIRA/Confluence/FishEye

访问http://jira.dev.xxx.com配置JIRA

访问http://wiki.dev.xxx.com配置Confluence

访问http://code.dev.xxx.com配置FishEye

6.集成JIRA/Confluence/FishEye[b]

http://confluence.atlassian.com/display/DOC/Integrating+JIRA+and+Confluence

http://confluence.atlassian.com/display/JIRA/Integrating+JIRA+with+FishEye

http://confluence.atlassian.com/display/DOC/Enabling+the+Remote+API

[b]7.Githook

.git/hooks/commit-msg

#!/bin/sh
test "" != "$(egrep '[A-Z]+-[0-9]+,' "$1")" || {
  echo >&2 "ERROR: Commit message is missing JIRA issue number."
  exit 1
}

相关推荐