달력

3

« 2024/3 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

'Window 에서 CentOS7'에 해당되는 글 1

  1. 2015.03.11 Redmine 2.3.1 에서 3.0 으로 업그레이드 (Window 에서 CentOS 7로)
.. .. ..

 

1. CentOS 에 Redmine 설치
 1. SELinux을 disable

vi /etc/sysconfig/selinux 열고 SELINUX의 값을 disabled로 변경한다.
SELINUX=enforcing --> SELINUX=disabled

수정후 CentOS를 재부팅

재부팅한 후 getenforce을 통해 SELinux가 Disabled 되었는지 확인
getenforce 결과값 :Disabled

 

2 port 허가

방화벽 추가(해당 포트는 Redmine 이 사용되는 포트. 80 번으로 사용해도 문제 없다)
firewall-cmd --permanent --zone=public --add-port=3000/tcp

방화벽 확인
cat /etc/firewalld/zones/public.xml

방화벽 재시작(안해도 됨)
systemctl restart firewalld


3. 필요한 도구 설치

1. EPEL 설치 (실패함. 기존에 설치되어 실패로 예상하며 차후 문제 없었음)
rpm -Uvh epel-release "http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm"
or
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

 

2 개발툴 설치
yum groupinstall "Development Tools"


3 Ruby와 Passenger 빌드에 필요한 헤더파일
yum install openssl-devel readline-devel zlib-devel curl-devel libyaml-devel


4 Mysql과 헤더파일
yum install mysql-server mysql-devel


5 Apache과 헤더파일
yum install httpd httpd-devel


6 ImageMagick과 헤더파일
yum install ImageMagick ImageMagick-devel


4. Ruby설치

1. 소스다운로드 (소스 다운 후 설치시 실패함. 원인 파악 안함.)

http://www.ruby-lang.org/ko/downloads/

 

2. 빌드

tar zxvf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194
./configure --disable-install-doc
make
make install
make clean

 

1. yum 방식으로 Ruby 설치(아래 URL 참조)

https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-on-centos-6


 

2. 확인
ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]


5. bundler 설치

gem install bundler --no-rdoc --no-ri


6. Mysql 설정

1. 버젼 확인

-bash-4.2$ mysql --version
mysql  Ver 15.1 Distrib 5.5.41-MariaDB, for Linux (x86_64) using readline 5.1

 

2. 설정값 변경 (변경 안함. 다른 곳에서 변경하는것 같아서 무시)
#vi /etc/my.cnf

[mysql]
default-character-set=utf8를 추가

[mysqld]
character-set-server=utf8를 추가

 

3. 재기동 및 자동으로 서비스 가동
/etc/init.d/mysqld start
chkconfig mysqld on


7. Redmine용 데이터베이스 및 유저생성

mysql -uroot -p
mysql> create database db_redmine default character set utf8;
mysql> grant all on db_redmine.* to user_redmine identified by '********';
mysql> flush privileges;
mysql> exit;


8. Redmine 설치

1. 소스 다운로드 (실패. 없는 URL)
http://rubyforge.org/frs/?group_id=1850

 

1. 소스 다운로드

http://www.redmine.org/projects/redmine/wiki/Download

 

2 소스배치
tar zxvf redmine-2.1.0.tar.gz
mv redmine-2.2.0 설치경로


3 데이터베이스 접속설정
redmine 밑으로 config/database.yml을 vi열어서 아래와 같이 편집한다.
(database.yml.example파일을 참조해서 만든다.)

production:
adapter: mysql2
database: Mysql 에 설정한 Database 명
host: localhost
username: 생성한 redmine용 id
password: **
encoding: utf8

 

4 메일 접속설정 (적용 안함. 차후 필요시 사용)

vi config/configuration.yml 열어서 아래와 같이 설정해 준다.
(config/configuration.yml.example파일 참조)

production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "localhost"
port: 25
domain: 'example.com'

 

5 Gem Package 설치
bundle install --without development test postgresql sqlite

 

9 테이블 생성 및 초기 데이터 입력

rake generate_secret_token
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data
한국어는 ko로 입력한다.

 

10. 서버 가동

#ruby script/rails server webrick -e production

 

11. 확인

브라우저에서 http://localhost:3000으로 접속해 본다.

 

 

 

2. Apache 에서 Redmine 사용하기.

 

1. passenger 설치

sudo gem install passenger
passenger-install-apache2-module

 

2. 설치 완료시 아래와 같은 메시지 확인 (확인용)

 

The Apache 2 module was successfully installed.

Please edit your Apache configuration file, and add these lines:

   LoadModule passenger_module /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.23/buildout/apache2/mod_passenger.so
   PassengerRoot /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.23
   PassengerDefaultRuby /usr/local/bin/ruby

After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!

Press ENTER to continue.


--------------------------------------------
Deploying a Ruby on Rails application: an example

Suppose you have a Rails application in /somewhere. Add a virtual host to your
Apache configuration file and set its DocumentRoot to /somewhere/public:

   <VirtualHost *:80>
      ServerName www.yourhost.com
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot /somewhere/public
      <Directory /somewhere/public>
         # This relaxes Apache security settings.
         AllowOverride all
         # MultiViews must be turned off.
         Options -MultiViews
      </Directory>
   </VirtualHost>

And that's it! You may also want to check the Users Guide for security and
optimization tips, troubleshooting and other useful information:

  /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.23/doc/Users guide Apache.html
  http://www.modrails.com/documentation/Users%20guide%20Apache.html

Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl) :-)
https://www.phusionpassenger.com

Phusion Passenger is a trademark of Hongli Lai & Ninh Bui.

 

3. Apache 에 Redmine 인식 시키기

1. Apache 설정파일 열기

vi /etc/httpd/conf/httpd.conf

 

2. 2번에 굵은 글씨로 써둔 부분 가장 아래에 첨부하기   

LoadModule passenger_module /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.23/buildout/apache2/mod_passenger.so

PassengerRoot /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.23
PassengerDefaultRuby /usr/local/bin/ruby

 

   <VirtualHost *:80>
      ServerName www.yourhost.com
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot /somewhere/public
      <Directory /somewhere/public>
         # This relaxes Apache security settings.
         AllowOverride all
         # MultiViews must be turned off.
         Options -MultiViews
      </Directory>
   </VirtualHost>

 

이때 주의해야 할 점은 /somewhere/public 이라는 경로를 redmine_home/public 로 변경해야 된다.(2개 변경) 

 

3. 아파치 재시작

service httpd restart  // centos

 

4. 확인

http://localhost:80 

 

 

 

3. Redmine 2.3.1->3.0 업그레이드

(아래 사이트 참조함)

 (http://www.redmine.or.kr/projects/community/wiki/%EC%97%85%EA%B7%B8%EB%A0%88%EC%9D%B4%EB%93%9C )

 

1. 백업 (아래 두가지 항목만 옮기면 끝난다.)

1.1 파일 백업
REDMINE_ROOT/files에 있는 파일을 백업해 준다.

1.2 DB 백업
mysqldump -u <username> -p<password> <redmine_database> | gzip > /path/to/backup/db/redmine_`date +%y_%m_%d`.gz

 

2. Redmine 3.0 설치

1번(CentOS 에 Redmine 설치) 방법대로 진행

 

3. Redmine 동기화

1. config/database.yml을 설정한다
redmine 1.4버전 이상의 redmine과 ruby1.9버전을 이용하는 경우는 mysql2로 변경해서 사용한다.

 

2. 파일 복사
백업해 둔 파일을 새로운 버전 files에 복사한다.

 

3. bundle install
cd REDMINE_HOME
bundle install --without development test postgresql sqlite rmagick

 

4. 토큰 발행

rake generate_secret_token

 

5. DB 마이그레이션 (이 작업을 완료하면 기존 DB 데이터를 신규 DB 구조로 변경하여 사용할수 있도록 함)
rake db:migrate RAILS_ENV=production

 

6. 플러그인의 DB 마이그레이션
rake redmine:plugins:migrate RAILS_ENV=production

 

7.  클린업
rake tmp:cache:clear
rake tmp:sessions:clear

 

etc.DB마이그레이션이 실패한 경우 원래대로 돌리고 싶은 경우

1 DB생성하기
mysqladmin -u root -p<password> create 데이터베이스명

 

.2 복구하기
mysql -u root -p<password> 데이터베이스명 < 백업해둔 파일(물론 압축은 풀어 놓아야 한다)

 

 

'I.lib() > I.lib(etc)' 카테고리의 다른 글

vsftp 설정 정보  (0) 2015.05.19
바른손 청첩장 샘플 후기  (0) 2015.04.20
[펌] Eclipse 로 C언어 짜기  (0) 2015.01.08
Wireshark pcap 파일 분할  (0) 2015.01.07
초보 개발자가 오픈소스에 기여하는 5단계  (0) 2014.11.17
.
:
Posted by .07274.