Redmine?
Redmine은 오픈소스 프로그램으로 웹 기반의 프로젝트 관리와 버그 추적 기능을 제공하는 도구입니다.
프로젝트 관리에 도움이 되도록 달력과 간트 차트, 일정관리 기능, 통합된 프로젝트 관리 기능, 이슈추적, 여러가지 형상 관리 기능을 제공합니다.
Ruby on Rails에 기반하여 작성 되었으며 Multi Platform을 지원하고 여러가지 종류의 데이터베이스를 지원 합니다.
본 글은 CentOS 6.4(x86_64)에서 테스트 되었으며 MySQL대신 MariaDB와 Nginx를 사용하여 Redmine을 설치하는 방법에 대해 기록하였습니다.
설치순서 : 필요 패키지 -> Nginx -> MariaDB -> Redmine
[root@ruo91 ~]# sed -i ‘s/SELINUX=enforcing/SELINUX=disabled/g’ /etc/sysconfig/selinux
[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
[root@ruo91 ~]# service iptables restart
iptables: 방화벽 규칙을 지웁니다: [ OK ]
iptables: 체인을 ACCEPT 규칙으로 설정 중: filter [ OK ]
iptables: 모듈을 언로드하는 중: [ OK ]
iptables: 방화벽 규칙 적용 중: [ OK ]
[root@ruo91 ~]# adduser redmine
[root@ruo91 ~]# passwd redmine
redmine 사용자의 비밀 번호 변경 중
새 암호:
새 암호 재입력:
passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.
[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
[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;
}
}
}
[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
[root@ruo91 ~]# yum –enablerepo=mariadb install -y MariaDB-server MariaDB-client MariaDB-devel
[root@ruo91 ~]# rm -f /etc/my.cnf.d/*
[root@ruo91 ~]# ln -s /usr/share/mysql/my-huge.cnf /etc/my.cnf.d/mariadb.cnf
[root@ruo91 ~]# service mysql start
Starting MySQL……… SUCCESS!
[root@ruo91 ~]# mysqladmin -u root password ‘비밀번호 입력’
[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’;
[root@ruo91 ~]# svn co http://svn.redmine.org/redmine/branches/2.3-stable /opt/redmine-2.3
[root@ruo91 ~]# cd /opt/redmine-2.3
[root@ruo91 redmine-2.3]# nano config/database.yml
production:
adapter: mysql2
database: redmine
host: localhost
port: 3306
username: redmine
password: Redmine 데이터베이스 비밀번호
[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: “메일 비밀번호”
[root@ruo91 redmine-2.3]# gem install bundler
[root@ruo91 redmine-2.3]# bundle install –without development test
[root@ruo91 redmine-2.3]# rake generate_secret_token
[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
[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