본문 바로가기

네트워크

CentOS 7 Redmine(레드마인) 설치 방법

 김고동의 네트워크 

 Redmine 설치 방법

 

vi /etc/sysconfig/selinux 설정 변경 (7번째 줄 enforcing -> disabled)
    1
    2 # This file controls the state of SELinux on the system.
    3 # SELINUX= can take one of these three values:
    4 #     enforcing - SELinux security policy is enforced.
    5 #     permissive - SELinux prints warnings instead of enforcing.
    6 #     disabled - No SELinux policy is loaded.
    7 SELINUX=disabled
    8 # SELINUXTYPE= can take one of three values:
    9 #     targeted - Targeted processes are protected,
    10 #     minimum - Modification of targeted policy. Only selected processes are protected.
    11 #     mls - Multi Level Security protection.
    12 SELINUXTYPE=targeted


reboot

getenforce로 아까 변경한 값이 Disabled로 제대로 설정되었는지 확인

systemctl start firewalld (centos7에서는 iptables가 아닌 firewalld 라는 데몬을 사용해야한다)

firewall-cmd --add-port=3000/tcp

systemctl enable firewalld

systemctl is-enabled firewalld

firewall-cmd --reload (재시작)

# firewall-cmd --state (상태 확인 ex. running)

iptables -nL (iptbales 설정 확인 가능)

# yum groupinstall "Development Tools"

# yum install openssl-devel readline-devel zlib-devel curl-devel libyaml-devel

# yum install httpd httpd-devel

yum install ImageMagick ImageMagick-devel

yum -y install php-mysql

# yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel

# yum -y install httpd libcurl-devel httpd-devel apr-devel apr-util-devel

  (나의 경우깔려있다고 나오긴 했으나 확인 차 입력)

vi /etc/yum.repos.d/MariaDB.repo (vi 접속하여 아래 내용 작성)
[mariadb] 
name = MariaDB 
baseurl = http://yum.mariadb.org/10.4/centos7-amd64 
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB 
gpgcheck=1

yum install MariaDB

yum install MariaDB-server MariaDB-client MariaDB-shared MariaDB-devel

rpm -qa | grep MariaDB (확인)

systemctl enable mariadb

systemctl is-enabled mariadb (확인)

mysql -u root -p
엔터
CREATE DATABASE redmine CHARACTER SET utf8;
GRANT ALL ON redmine.* TO 'redmine'@'localhost' identified BY '원하는 비밀번호';
flush privileges;
exit;

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])

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

# gem install bundler chef ruby-shadow

# gem install ruby-openid

gem install mysql2

gem install rails -V

cd /usr/local/src

wget https://www.redmine.org/releases/redmine-4.1.0.tar.gz

tar xvfz redmine-4.1.0.tar.gz

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 부분을 아래와 같이 수정 후 나머지는 주석 처리)
production: 
adapter: mysql2 
database: redmine 
host: localhost 
username: root 
password: "bellock00" 
encoding: utf8

sudo yum install mysql-devel

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

   (이걸 실행할때 pwd는 항상 redmine-4.1.0 이여야 한다)

bundle exec rake generate_secret_token

RAILS_ENV=production bundle exec rake db:migrate

RAILS_ENV=production bundle exec rake redmine:load_default_data
Select language: ar, az, bg, bs, ca, cs, da, de, el, en, en-GB, es, es-PA, et, eu, fa, fi, fr, 
gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sq, sr, 
sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en] ko <- 이와 같이 ko 추가해주고 엔터

bundle exec rails server webrick -e production -b 0.0.0.0 &
[1] 15866
[root@pool-100-10-10-138 redmine-4.1.0]# => Booting WEBrick
=> Rails 5.2.4.1 application starting in production on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
[2020-04-28 14:46:36] INFO  WEBrick 1.4.2
[2020-04-28 14:46:36] INFO  ruby 2.6.5 (2019-10-01) [x86_64-linux]
[2020-04-28 14:46:36] INFO  WEBrick::HTTPServer#start: pid=15866 port=3000
여기까지 나왔으면 그냥 엔터 쳐주면 된다

# gem install passenger

passenger-install-apache2-module
엔터
엔터 (Ruby에 체크 되어있음)
로딩중 (주의 - 오래 기다려야 함)
엔터
엔터

vi /etc/httpd/conf.d/redmine.conf (vi 접속하여 아래 내용 작성)
LoadModule passenger_module /usr/local/lib/ruby/gems/2.6.0/gems/passenger-6.0.4/buildout/apache2/mod_passenger.so 

PassengerRoot /usr/local/lib/ruby/gems/2.6.0/gems/passenger-6.0.4 
PassengerDefaultRuby /usr/local/bin/ruby 
PassengerDefaultUser apache 
    
ServerName redmine.com 
DocumentRoot /usr/local/redmine/public 
ErrorLog logs/redmine_error_log 
<Directory "/usr/local/src/redmine-4.1.0/public"> 
Options FollowSymLinks 
AllowOverride None 
Require all granted 
 
Options Indexes FollowSymLinks MultiViews 
RailsEnv production 
RailsBaseURI / 

systemctl restart httpd

# http://자기 자신의 IP:3000 으로 접속

 

 

 

 

 

----------------------------------------------------------------------------------------------------------

 

 

 

 

 

죽어라 고생해서 알아 낸 레드마인 설치 방법입니다....

실시했던 환경은 centos 7.7이며, 이미지 파일은 'CentOS-7-x86_64-DVD-1908' 을 사용하였습니다.