7-1. [CentOS7] 레드마인 (Redmine) 설치 -1
- -
[CentOS7] 레드마인 (Redmine) 설치 -1
안녕하세요. 갓대희 입니다. 이번 포스팅은 [ Redmine 설치 ] 입니다. :)
레드마인을 2가지 방법으로 설치해 보았다.
첫번째, bitnami 레드마인으로 필요한 모듈을 한번에 같이 설치, 설정하는 방법. ( 해당 파일의 실행을로 모든것 을 세팅 bitnami-redmine-3.4.3-2-linux-x64-installer.run )
두번째, 직접 compile 하여 설치하는 방법
두번째 방법이 개인적으로 더 괜찮았다. 해당 방법으로 직접설치 하다록 해보겠다.
▶ mysql VS maria DB
MYSQL은 글로벌 IT업체 오라클의 소유다. 오라클은 썬마이크로시스템즈를 인수하면서 MYSQL도 손에 넣었다.
그러나 오라클이 썬을 인수한 후 MYSQL에 대한 정책을 폐쇄적으로 가져가는 것 아니냐는 우려를 불러일으킨 조치들이 많이 취해졌다.
오라클이 자사 기존 DB 사업 보호를 위해 MYSQL에 대한 지원을 줄이고, 결국 고사시킬 것이란 관측도 적지 않았다.
실제로 MYSQL을 사용하던 구글, 위키피디아 등 대형 인터넷 서비스 기업들도 속속 마리아DB로 갈아타는 움직임을 보였다.
이 와중에 MYSQL 변종 제품들이 관심을 끌기 시작했다. 마리아DB가 대표적이다.
mysql 개발자가 나와 mariadb를 만들었다고 한다. 이후 제약, 규약 없이 mariadb가 좀더 확장, 개발 될것츠로 보인다. 우연히 나도 mariadb로 진행.
▶ 1. mariadb 설치
yum -y install mariadb-server mariadb
1-1. 서비스 시작 및 재부팅 시 자동실행 설정
서비스 시작 : systemctl start mariadb.service
재부팅 시 자동실행 설정 : systemctl enable mariadb.service
1-2. 서비스 초기화(db root 계정 pw 설정)
[root@goddaehee ~]# mysql_secure_installation <<<---- mysql 기본 보안 명령어(초기 설치 후 보안적용 방법)
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): <<<---- Enter 입력(pw 초기 설정이므로 엔터로 넘어간다)
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] <<<---- Enter 입력(root pw 설정? yes or Enter)
New password: <<<---- PW 입력
Re-enter new password: <<<---- PW 입력
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] <<<---- Enter 입력(익명사용자 삭제? yes or Enter)
... Success!
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] <<<---- Enter 입력(mysql 원격 접속 권한제한)
... Success!
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] <<<---- Enter 입력(test DB 삭제 여부)
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] <<<---- Enter 입력
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
1-3. mysql테이블 생성 및 redmine 계정 생성
[root@goddaehee ~]# mysql -uroot -p
Enter password: <<<---- 1번에서 mariadb root PW 입력
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 5.5.56-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> CREATE DATABASE redmine CHARACTER SET utf8 COLLATE utf8_general_ci; <<<--- redmine DB 생성
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> CREATE USER 'redmine'@'%' IDENTIFIED BY 'alswl1234'; <<<---- redmine DB의 user(redmine)와 pw 생성
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'%'; <<<---- redmine에게 모든 권한 부여
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> FLUSH PRIVILEGES; <<<---- 설정 적용
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit
Bye
▶ 2. PHP설치
2-1. yum -y install php
2-2.1. PHP 설치
yum -y install php-mysql
2-2.2. PHP 공통 모듈 설치
yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel
2-3. 아파치 재시작
systemctl restart httpd.service
나와 같은 경우 service httpd restart
▶ 3. Redmine 의존성 라이브러리 설치
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
▶ 4. Ruby 설치(Mac OS는 Ruby 언어로 구성되어 있음)
yum -y install ruby ruby-devel ruby-irb ruby-rdoc ruby-ri
4-1. rubygem 설치(gem : 리눅스의 yum과 같은 것)
yum -y install rubygems
gem update <<<--- 안되면 --system 붙여서 진행
gem update --system
yum -y install gcc gcc-c++ make
4-2. rails 설치
gem install rails -V
4-3. 컴파일 설치 <<<---- 루비 tar 파일 다운로드 받을 경로로 이동
cd /tmp/lib
wget http://cache.ruby-lang.org/pub/ruby/ruby-2.5.0.tar.gz
tar xvf ruby-2.5.0.tar.gz
mv ruby-2.5.0.tar.gz /usr/local
cd /usr/local/ruby-2.5.0
./configure
make && make install
4-4. 루비 버젼 확인
[root@goddaehee ruby-2.5.0]# ruby -v
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]
4-5. bundler 설치
gem install bundler --no-rdoc --no-ri
▶ 5. Redmine 설치
cd /var/www/html
wget http://www.redmine.org/releases/redmine-3.4.4.tar.gz <<< 원하는 버전 다운로드 : http://www.redmine.org/releases/
tar xvzf http://www.redmine.org/releases/redmine-3.4.4.tar.gz
mv redmine-3.4.4 redmine
cd redmine
5.1 database 설정 및 mysql 계정 정보 입력
cp ./config/database.yml.example config/database.yml
vi ./config/database.yml
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: "비번입력"
encoding: utf8
* 사용자 계정으로 할 것
5.2 Redmine Gem 설치
bundle install --without development test
5.3 세션 변조 방지를 위한 Key 를 생성
bundle exec rake generate_secret_token
5.4 디비 스키마 셋팅
bundle exec rake db:migrate RAILS_ENV=production
5.5 기본언어 한국어로 설정
bundle exec rake redmine:load_default_data RAILS_ENV=production REDMINE_LANG=ko
5.6 Redmine Apahce 연동 모듈 설치
gem install passenger
[root@goddaehee build]# passenger-install-apache2-module
Welcome to the Phusion Passenger Apache 2 module installer, v5.1.12.
This installer will guide you through the entire installation process. It
shouldn't take more than 3 minutes in total.
Here's what you can expect from the installation process:
1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.
3. You'll learn how to deploy a Ruby on Rails application.
Don't worry if anything goes wrong. This installer will advise you on how to
solve any problems.
Press Enter to continue, or Ctrl-C to abort. <<<--- Enter 입력
--------------------------------------------
Installation through RPMs recommended
It looks like you are on a Red Hat or CentOS operating system, with SELinux
enabled. SELinux is a security mechanism for which special Passenger-specific
configuration is required. We supply this configuration as part of
our Passenger RPMs.
However, Passenger is currently installed through gem or tarball and does not
include any SELinux configuration. Therefore, we recommend that you:
1. Uninstall your current Passenger install.
2. Reinstall Passenger through the RPMs that we provide:
https://www.phusionpassenger.com/library/install/apache/yum_repo/
What would you like to do?
Press Ctrl-C to exit this installer so that you can install RPMs (recommended)
-OR-
Press Enter to continue using this installer anyway
--------------------------------------------
Which languages are you interested in?
Use <space> to select.
If the menu doesn't display correctly, press '!'
‣ ⬢ Ruby <<<--- 느낌표 입력 후, 방향키로 Ruby 지정 후 Enter 입력
⬢ Python
⬡ Node.js
⬡ Meteor
--------------------------------------------
Checking for required software...
* Checking for C compiler...
Found: yes
Location: /usr/bin/cc
* Checking for C++ compiler...
Found: yes
Location: /usr/bin/c++
* Checking for Curl development headers with SSL support...
Found: yes
curl-config location: /usr/bin/curl-config
Header location: /usr/include/curl/curl.h
Version: libcurl 7.29.0
Usable: yes
Supports SSL: yes
* Checking for Zlib development headers...
Found: yes
Location: /usr/include/zlib.h
* Checking for Apache 2...
Found: yes
Location of httpd: /usr/sbin/httpd
Apache version: 2.4.6
* Checking for Rake (associated with /usr/bin/ruby)...
Found: yes
Location: /usr/bin/ruby /usr/local/bin/rake
* Checking for OpenSSL support for Ruby...
Found: yes
* Checking for RubyGems...
Found: yes
* Checking for Ruby development headers...
Found: yes
Location: /usr/include/ruby.h
YAML safe loading is not available. Please upgrade psych to a version that supports safe loading (>= 2.0).
* Checking for rack...
Found: yes
* Checking for OpenSSL development headers...
Found: yes
Location: /usr/include/openssl/ssl.h
* Checking for Apache 2 development headers...
Found: no
* Checking for Apache Portable Runtime (APR) development headers...
Found: no
* Checking for Apache Portable Runtime Utility (APU) development headers...
Found: no
Some required software is not installed.
But don't worry, this installer will tell you how to install them.
Press Enter to continue, or Ctrl-C to abort.
--------------------------------------------
Installation instructions for required software
* To install Apache 2 development headers:
Please install it with yum install httpd-devel
* To install Apache Portable Runtime (APR) development headers:
Please install it with yum install apr-devel
* To install Apache Portable Runtime Utility (APU) development headers:
Please install it with yum install apr-util-devel
If the aforementioned instructions didn't solve your problem, then please take
a look at our documentation for troubleshooting tips:
https://www.phusionpassenger.com/library/install/apache/
https://www.phusionpassenger.com/library/admin/apache/troubleshooting/
나와 같이 이전 아파치부터 설치한 경우 여기서 위와 같이 나오지 않고 정상 설치 완료.. 그렇지 않은경우 위와같이 노출.
[root@goddaehee build]# yum -y install httpd-devel apr-develapr-util-devel <<<--- 위에서 필요하다고 하는 패키지 설치
[root@goddaehee build]# passenger-install-apache2-module <<--- 다시진행
아래 내용 복사해서 apache conf 설정 시 추가
LoadModule passenger_module /usr/local/lib/ruby/gems/2.5.0/gems/passenger-5.1.12/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/lib/ruby/gems/2.5.0/gems/passenger-5.1.12
PassengerDefaultRuby /usr/local/bin/ruby
</IfModule>
5.7 Apache configure 폴더에 .conf 파일 추가
vi /etc/httpd/conf.d/redmine.conf
나와 같은 경우 내가 설치한 apache 폴더의 기본 httpd.conf 파일에 추가.
Listen 8081
LoadModule passenger_module /usr/local/share/gems/gems/passenger-5.1.12/buildout/apache2/mod_passenger.so
LoadModule passenger_module /usr/local/lib/ruby/gems/2.5.0/gems/passenger-5.1.12/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/lib/ruby/gems/2.5.0/gems/passenger-5.1.12
PassengerDefaultRuby /usr/local/bin/ruby
</IfModule>
<VirtualHost *:8081>
#ServerName your.server.com
#ServerAlias www.your.server.com
DocumentRoot /var/www/html/redmine/public
<Directory /var/www/html/redmine/public>
AllowOverride all
Options -Multiviews
Require all granted
</Directory>
</VirtualHost>
※ virtual host 설정시 실제 동작하게 될 위치를 redmine 내의 public 디렉토리를 기준으로 설정
5.8. redmine 설치 폴더의 권한 변경 <<<--- 권한변경을 안하면 사용자 추가 기능 등 몇몇 기능에 대해서 권한이 없어 500 에러 발생
cd /var/www/html
chown -R apache:apache redmine
5.9. 방화벽 포트 추가
firewall-cmd --permanent --zone=public --add-port=8005/tcp
firewall-cmd --reload
firewall-cmd --list-ports
5.10. 아파치 재시작
systemctl restart httpd.service
나와 같은 경우 service httpd restart
6. Redmine 접속
http://ip주소:8081
초기아이디 / password = admin/admin
'4.Linux' 카테고리의 다른 글
7-3 [CentOS7] 레드마인 (Redmine) 플러그인 설치 (ckeditor) (1) | 2018.01.30 |
---|---|
7-2 [CentOS7] 레드마인 (Redmine) 테마 변경 (0) | 2018.01.26 |
6. [CentOS7] 아파치와 톰캣 연동하기 (mod_jk) & 로드밸런스 설정 (1) | 2018.01.25 |
5. [CentOS7] 톰캣(Tomcat) 다중으로 설치 (0) | 2018.01.25 |
4. [CentOS7] 컴파일 하여 아파치(Apache) 설치 (0) | 2018.01.23 |
소중한 공감 감사합니다