System Engineering/CI, CD

CI/CD #14. CentOS Redmine(레드마인) 설치하기

ZunoXI 2021. 7. 8.

개요

효율적인 애자일 방식구현을 위한 협업툴 Redmine 설치하기

CentOS Redmine 설치

현재 필자가 구축한 CICD 파이프라인은 gitlab서버와 jenkins서버, 쿠버네티스 클러스터를 구축하고 gitlab과 jenkins연동후 git push시 k8s클러스터까지 자동 배포가 되게끔 설정했다. 배포를 위한 파이프라인은 구축되었으나 실제 프로젝트를 수행하는 팀단위에서 이러한 프로젝트 및 이슈들을 트래킹하고 일정 및 노하우를 관리하는 툴이 필요하다. 이쪽분야로 Jira, confluence 등의 좋은 툴이 있지만 경우에따라 오픈소스가 아니라 비용을 지불하고 사용해야하기때문에 사용에 제한이 있다. 따라서 이번 포스팅에서는 오픈소스를 익힐겸 redmine을 통하여 협업툴을 설치하고 gitlab과 연동을 준비한다.

 

 

참고

해당 포스팅은 다음 블로그 포스팅을 참고하여 작성하였습니다.

 

CentOS에 Redmine 설치하기

이번 글에서는 오픈소스 관리 툴인 Redmine 4.1을 CentOS 7에 설치해 볼 것이다. 글의 진행 순서는 다음과 같다. 실습 전 준비사항 Redmine 용 MariaDB 설치 Redmine 의존성 설치 Redmine 설치 및 설정 Apache와 R..

twofootdog.tistory.com

 

 

 

 


 

 

 

1. Redmine이란 & 설치환경

 

먼저 Redmine은 앞서 설명한 것 처럼 웹을 기반으로하는 프로젝트 관리와 이슈, 버그 트래킹 기능을 제공하는 도구이다. 팀 협업툴로 많이 쓰이는 오픈소스 프로그램으로 git과 연동하여 소스관리도 확인이가능하다. 실시간 연동은 지원하지 않고 있어서 batch job같은 것으로 수동동기화를 해줘야한다. 이부분은 다음포스팅에서 다뤄볼 예정이다.

 

* 설치환경

- OS : CentOS Linux release 7.9

- Redmine : Redmine 4.1

 

 

2. Maria DB 설치

 

Redmine의 데이터를 보관하기위해 이전에 작성한 포스팅중 sonarqube용 postgresql과 같은 별도의 DB가 필요하다. 이번 포스팅에서는 Redmine용으로 maria db를 설치할 예정이다.

 

$ yum -y install mariadb-server mariadb  # maria db 설치
$ systemctl start mariadb.service  # maria db 시작
$ systemctl enable mariadb.service    # maria db 시스템 등록

 

 

MariaDB root 계정에 비밀번호를 설정한다.

 

# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):   #root 패스워드 설정안했기때문에 그냥 엔터를 입력

 

비밀번호 세팅에서만 'Y'를 입력하여 root비밀번호를 설정해주고 나머지는 본인의 필요에 맞게 설정하면된다. 필자는 모두 'N'을 선택했다.

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] n
 ... skipping.

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
 ... skipping.

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] n
 ... skipping.

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] n
 ... skipping.

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

 

다음, DB와 DB에서 사용할 계정을 생성하고 외부 권한을 부여한다.

 

# mysql -u root -p
Enter password:                         # 위 생성한 mysql root계정의 pw입력
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

# DB생성
MariaDB [(none)]> CREATE DATABASE redmine CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.00 sec)

# DB계정 생성 및 PW 설정(redmine이란 DB계정의 pw는 1111로 만들겠다는 의미)
MariaDB [(none)]> CREATE USER 'redmine'@'%' IDENTIFIED BY '1111';
Query OK, 0 rows affected (0.00 sec)

# redmine계정에 모든 외부 접속권한을 부여
MariaDB [(none)]> GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'%';
Query OK, 0 rows affected (0.00 sec)

 

아래와 같이 'show databases'를 입력했을때 정상적으로 내용이 확인되면 된다.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| redmine            |
| test               |
+--------------------+
5 rows in set (0.01 sec)

 

 

 

3. Redmine 의존성 설치

 

Redmine 의존성 파일 설치

# yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick
# yum -y install gcc g++ cpp gcc-c++
# yum -y install openssl-devel readline-devel zlib-devel curl-devel libyaml-devel
# yum -y install mariadb-devel
# yum -y install ImageMagick ImageMagick-devel

 

ruby 설치

# cd /usr/local/src 
# wget https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.5.tar.gz 
# tar xvf ruby-2.6.5.tar.gz 
# cd ruby-2.6.5 
# ./configure 
# make && make install 
# ruby -v 
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]

 

ruby-gems 설치

# cd /usr/local/src 
# wget https://rubygems.org/rubygems/rubygems-3.1.2.tgz 
# tar xvf rubygems-3.1.2.tgz 
# cd rubygems-3.1.2 
# /usr/local/bin/ruby setup.rb

 

bundler, chef ruby-shadow 설치

# gem install bundler chef ruby-shadow

 

rails 설치

# gem install rails -V

 

 

4. Redmine 설치

 

Redmine 설치

# cd /home/redmine
# wget https://www.redmine.org/releases/redmine-4.1.0.tar.gz 
# tar xvfz redmine-4.1.0.tar.gz

 

Redmine DB 연동 정보 수정

# cd redmine-4.1.0 
# cp config/configuration.yml.example config/configuration.yml 
# cp config/database.yml.example config/database.yml 
# vi config/database.yml 
production: 
 adapter: mysql2 
 database: redmine 
 host: localhost 
 username: redmine 
 password: "1111" 
 encoding: utf8

 

기타 설정

 

패키지 설치

$ bundle install --without development test --path vendor/bundle

쿠키 암호화를 위한 시크릿 토큰 생성

$ bundle exec rake generate_secret_token

데이터베이스 생성

# mysql -u root -p
Enter password:                         # 위 생성한 mysql root계정의 pw입력
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

# 외부접속 권한부여
MariaDB [(none)]> GRANT ALL ON redmine.* TO redmine@'localhost' IDENTIFIED BY '1111';

# exit

$ RAILS_ENV=production bundle exec rake db:migrate

기본언어 한국어 설정

$ bundle exec rake redmine:load_default_data RAILS_ENV=production REDMINE_LANG=ko

레드마인실행

 

# 방화벽 오픈 (3000번 포트 오픈)
$ firewall-cmd --permanent --add-port=3000/tcp 
$ systemctl restart firewall

# 레드마인실행
$ bundle exec rails server webrick -e production -b 0.0.0.0(혹은 본인 서버 IP) &

# 백그라운드로 실행시키고 싶은경우
$ bundle exec rails server webrick -e production -d -b 0.0.0.0(혹은 본인 서버 IP) &

 

 

자, 이후 브라우저 주소창에 http://서버ip:3000를 입력하여 아래와 같이 레드마인의 초기화면이 나타나는지 확인한다.

 

 

끄읏 :)  다음포스팅에서는 깃랩과 연동하고 실시간으로 동기화하게끔 설정하는 방법에 대해 포스팅해볼예정.

 

 

 

 

 


필요에따라 apache를 설치하여 도메인으로(80포트)접속되게끔 설정할 수 있다. 해당설정은 다음 포스팅을 참고하면 좋을 것 같다.

 

CentOS에 Redmine 설치하기

이번 글에서는 오픈소스 관리 툴인 Redmine 4.1을 CentOS 7에 설치해 볼 것이다. 글의 진행 순서는 다음과 같다. 실습 전 준비사항 Redmine 용 MariaDB 설치 Redmine 의존성 설치 Redmine 설치 및 설정 Apache와 R..

twofootdog.tistory.com

 

 

 

 

반응형

댓글