redmine은 ruby on rails 프레임워크로 개발된 source source issue tracking system이다. 

설치와 사용이 손쉽고 issue 관리에 필요한 기능들이 제공되며 다양한 형상관리와 연계를 지원하고 문서화를 위해 간단한 위키를 내장하고 있다.
그리고 개인마다 다르겠지만 mantis 나 trac 보다 UI 가 더 깔끔하다는 느낌이다.
이제는 JIRA 를 도입해서 쓰고 있지 않지만 1년반 정도 유용하게 사용했던지라 혹시 도움이 될 지 몰라 예전에 작성해 둔 redmine 설치법을 올려 본다.

본 문서는 redmine 1.2.1 기준이다.

 

사전 준비

ruby 인터프리터가 제일 먼저 설치되어야 한다. 사용하려는 redmine 의 버전을 확인하고 지원하는 ruby를 확인한 후에 ruby 를 설치한다. (지원 정보는  http://www.redmine.org/projects/redmine/wiki/RedmineInstall 참고)

yum 같은 패키지 매니저가 없는 환경에서 설치를 가정하였다.

ruby interpreter

  • ruby 소스 다운로드
  • 압축을 해제하고 다음 명령어 실행

    CFLAGS=-O ./configure && make
    sudo make install
    CODE
  • ruby --version 명령을 실행해 설치 여부 확인

rubygems 설치

루비 기반의 패키지 관리 프레임웍인 gems 설치

  • gems 다운 받기
  • 압축 해제후 해제 폴더로 이동후 다음 명령어 실행

    ruby setup.rb
    CODE
  • 최신 버전의 gem 사용시 redmine 설치가 되지 않으므로 downgrade (root 권한 필요)

    gem update --system 1.6.2
    CODE
  • 혼란을 방지하기 위해 최신 버전의 gem 을 삭제 (다음 명령후 목록에서 최신 버전 선택)

    gem uninstall rubygems-update
    CODE

ruby on rails 및 ruby 라이브러리 설치

  • rake 설치 (rake 0.9.x 는 미지원)

    gem install rake -v=0.8.7
    CODE
  • Rails 설치 (rails 버전은 다를수 있음)

    gem install rails -v=2.3.11
    CODE
  • Rack 설치

    gem install rack -v=1.1.1
    CODE

     

Database driver 설치

MySQL

MySQL 5.0 or higher (recommended) 

  • 다음 명령어로 MySQL 드라이버 설치

    gem install mysql
    CODE

     

  • 설치시 문제가 있다면 다음 사이트 참고 - Rails Wiki

Redmine 설치

  1. Download and extract or Checkout Redmine
  2. DBMS 계정 생성

    For MySQL

    CREATE DATABASE redmine character SET utf8;
    CREATE user 'redmine'@'localhost' IDENTIFIED BY 'my_password';
    GRANT ALL privileges ON redmine.* TO 'redmine'@'localhost';
    SQL
  3. redmine DB 환경 설정
    1. redmine의 config/database.yml.example 를 config/database.yml 로 복사후 편집.
    2. ruby on rails는 rails app을 구동할 환경을 지정하는 기능이 있음("production", "development" "test")
    3. 셋 중에 구동할 환경을 선택하고 해당 부분을 편집

      Example for a MySQL database:

       production:
      adapter: mysql
      database: redmine
      host: localhost
      username: redmine
      password: my_password
      CODE
  4. Session store 생성
    1. Generate a session store secret. This is required on the trunk version of Redmine at r2493 or above and the released 0.8.7 version or above.

      RAILS_ENV=production rake config/initializers/session_store.rb
      CODE
  5. DB schema 생성
    1. Create the database structure, by running the following command under the application root directory:

      RAILS_ENV=production rake db:migrate
      CODE

      다음과 같은 에러가 발생한다면 libopenssl-ruby 을 설치하거나 ruby 를 openssl 을 사용하게 재빌드해야 한다.

      rake aborted!
      no such file to load – openssl
      (See full trace by running task with --trace)

       ubuntu 에서 libopenssl-ruby 설치 


      apt-get install libopenssl-ruby1.8
      CODE

      Un*x 에서 ruby 재빌드

      $stringEscapeUtils.escapeHtml($body)
      BASH


       

  6. 기본 데이타 insert(update 라면 제외)
    Insert default configuration data in database, by running the following command:

    RAILS_ENV=production rake redmine:load_default_data
    BASH
  7. setting up permissions (Windows 사용자는 skip)
    The user who runs Redmine must have write permission on the following subdirectories: files, log, tmp (create the last one if not present).

    mkdir tmp public/plugin_assets
    sudo chown -R redmine:redmine files log tmp public/plugin_assets
    sudo chmod -R 755 files log tmp public/plugin_assets
    BASH

문제 해결

파일 첨부 사이즈 제한

  • redmine 을 관리자로 접속후 Adminitration->Settings->General을 선택후 Attachment max.size 의 값을 적절하게 설정한다.

구동 오류

  • apache의 fcgi 로 연동해서 사용할 경우 구동이 안 되며 error log 파일에 다음과 같은 로그가 남았을 경우.

    Request exceeded the limit of 10 internal redirects due to probable configuration error.
    Use 'LimitInternalRecursion' to increase the limit if necessary.
    Use 'LogLevel debug' to get a backtrace.
    CODE
  • fcgi 와 cgi 모듈이 충돌해서 발생할 수 있다. public/.htaccess 를 열어서 다음 부분을 주석처리 해 준다.

    <IfModule mod_cgi.c>
    AddHandler cgi-script .cgi
    </IfModule>
    CODE



Repository

  • 설정된 repository 가 제대로 동작하는지 확인

    DB에 등록된 전체 repository 검사

    ruby script/runner "Repository.fetch_changesets" -e production;
    BASH
  • 해당 repository 연결 테스트 (redmine 은 저장소 정보를 xml 받아서 파싱)
svn list --xml 'https://testca.tradesign.net/test_repos1234/test_project/'@HEAD
svn info --xml 'https://testca.tradesign.net/test_repos1234/test_project/'
CODE
  • 저장소 클릭시 다음 메시지가 나오며 목록이 출력 안 될 경우  redmine/log 폴더나 apache 로그등을 뒤져서 정확한 에러 메시지를 알아야 조치가 가능하다.
The entry or revision was not found in the repository 또는 항목이나 리비젼이 저장소에 존재하지 않습니다. 
  • Server certificate verification failed: issuer is not trusted

https에 사용된 CA 인증서를 (p)ermanently? 하게 accet 해야 한다. web server 가 구동되는 계정으로 로그인한후에 cmd 에서 상단의 svn list명령어를 수행한 후에 ca 인증서를 인증해 준다.