Redmine?
Redmine은 오픈소스 프로그램으로 웹 기반의 프로젝트 관리와 버그 추적 기능을 제공하는 도구입니다.
프로젝트 관리에 도움이 되도록 달력과 간트 차트, 일정관리 기능, 통합된 프로젝트 관리 기능, 이슈추적, 여러가지 형상 관리 기능을 제공합니다.
Ruby on Rails에 기반하여 작성 되었으며 Multi Platform을 지원하고 여러가지 종류의 데이터베이스를 지원 합니다.

본 글은 CentOS 6.4(x86_64)에서 테스트 되었으며 MySQL대신 MariaDB와 Nginx를 사용하여 Redmine을 설치하는 방법에 대해 기록하였습니다.

설치순서 : 필요 패키지 -> Nginx -> MariaDB -> Redmine

1. CentOS 설정
Selinux 비활성화

[root@ruo91 ~]# sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/g’ /etc/sysconfig/selinux

iptables HTTP 80번 포트 허용

[root@ruo91 ~]# nano /etc/sysconfig/iptables

# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state –state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
-A INPUT -j REJECT –reject-with icmp-host-prohibited
-A FORWARD -j REJECT –reject-with icmp-host-prohibited
COMMIT

iptables 재시작

[root@ruo91 ~]# service iptables restart

iptables: 방화벽 규칙을 지웁니다:                                [  OK  ]
iptables: 체인을 ACCEPT 규칙으로 설정 중:  filter          [  OK  ]
iptables: 모듈을 언로드하는 중:                                   [  OK  ]
iptables: 방화벽 규칙 적용 중:                                     [  OK  ]

Redmine 사용자 추가

[root@ruo91 ~]# adduser redmine

[root@ruo91 ~]# passwd redmine

redmine 사용자의 비밀 번호 변경 중
새  암호:
새  암호 재입력:
passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.

2. 필요 패키지 설치

[root@ruo91 ~]# yum groupinstall -y “Development Tools”
[root@ruo91 ~]# yum install -y screen openssl-devel ruby-devel rubygems ImageMagick-devel

3. Nginx 설치 및 설정

[root@ruo91 ~]# rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
[root@ruo91 ~]# yum install -y nginx

nginx 설정 파일에 Redmine의 가상 호스트를 설정 합니다. (Proxy로 던져주는 이유는 WEBrick이 너무 느려서 입니다.)

[root@ruo91 ~]# nano /etc/nginx/nginx.conf

user  nginx;
worker_processes  1;
error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;
events {
    worker_connections  1024;
}
http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    log_format  main  ‘$remote_addr – $remote_user [$time_local] “$request” ‘
                      ‘$status $body_bytes_sent “$http_referer” ‘
                      ‘”$http_user_agent” “$http_x_forwarded_for”‘;
    access_log  /var/log/nginx/access.log  main;
    sendfile        on;
    #tcp_nopush     on;
    keepalive_timeout  65;
#gzip  on;

# Redmine
server {
listen  80;
server_name localhost;

location / {
proxy_pass http://127.0.0.1:3000;
}
}
}

 

4. MariaDB 설치 및 설정

[root@ruo91 ~]# nano /etc/yum.repos.d/mariadb.repo

# MariaDB 5.5 CentOS repository list – created 2013-10-21 01:23 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
enabled=0

MariaDB 설치

[root@ruo91 ~]# yum –enablerepo=mariadb install -y MariaDB-server MariaDB-client MariaDB-devel

my.cnf 설정

[root@ruo91 ~]# rm -f /etc/my.cnf.d/*
[root@ruo91 ~]# ln -s /usr/share/mysql/my-huge.cnf /etc/my.cnf.d/mariadb.cnf

MariaDB 실행

[root@ruo91 ~]# service mysql start
Starting MySQL……… SUCCESS!

root 비밀번호 설정

[root@ruo91 ~]# mysqladmin -u root password ‘비밀번호 입력’

Redmine 사용자 및 데이터베이스 추가

[root@ruo91 ~]# mysql -u root -p

Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.33a-MariaDB-log MariaDB Server
Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
MariaDB [(none)]>

MariaDB [(none)]> CREATE DATABASE redmine CHARACTER SET utf8;
MariaDB [(none)]> CREATE USER ‘redmine’@’localhost’ IDENTIFIED BY ‘비밀번호 설정’;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON redmine.* TO ‘redmine’@’localhost’;

 
5. Redmine 설치 및 설정

[root@ruo91 ~]# svn co http://svn.redmine.org/redmine/branches/2.3-stable /opt/redmine-2.3
[root@ruo91 ~]# cd /opt/redmine-2.3

DataBase 설정

[root@ruo91 redmine-2.3]# nano config/database.yml

production:
adapter: mysql2
database: redmine
host: localhost
port: 3306
username: redmine
password: Redmine 데이터베이스 비밀번호

Mail 설정 (비동기 방식)

[root@ruo91 redmine-2.3]# nano config/configuration.yml

# default configuration options for all environments
default:
# Outgoing emails configuration (see examples above)
email_delivery:
delivery_method: :async_smtp
    async_smtp_settings:
address: smtp.example.com
port: 25
domain: mail.example.com
authentication: :login
user_name: “redmine@mail.examle.com”
password: “메일 비밀번호”

production를 제외한 나머지 필요 없는 것들은 빼고 설치 합니다.

[root@ruo91 redmine-2.3]# gem install bundler
[root@ruo91 redmine-2.3]# bundle install –without development test

조작 방지를 위한 random 키 생성

[root@ruo91 redmine-2.3]# rake generate_secret_token

Redmine 데이터베이스를 생성합니다.

[root@ruo91 redmine-2.3]# RAILS_ENV=production rake db:migrate

기본 언어셋을 한국어로 설정 합니다. 

[root@ruo91 redmine-2.3]# RAILS_ENV=production REDMINE_LANG=ko rake redmine:load_default_data

 
파일 및 로그, 임시저장소, 플러그인, 하위 디렉토리의 쓰기 권한을 줍니다.

[root@ruo91 redmine-2.3]# mkdir -p tmp tmp/pdf public/plugin_assets
[root@ruo91 redmine-2.3]# chown -R redmine:redmine files log tmp public/plugin_assets
[root@ruo91 redmine-2.3]# chmod -R 755 files log tmp public/plugin_assets

Screen과 WEBrick을 이용해 Redmine을 띄웁니다.

[root@ruo91 redmine-2.3]# screen -S redmine ruby /opt/redmine-2.3/script/rails server webrick -e production

=> Booting WEBrick
=> Rails 3.2.13 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server

Nginx에서 Proxy 설정으로 Redmine 3000번 포트로 연결 시켜 놓았기 때문에 80번 포트로 연결 하시면 Redmine을 빠른 속도로 사용이 가능합니다.
Redmine의 기본 ID와 Password는 admin 입니다.
redmine
참고