Redmine + PostgreSQL インストール (作成中 2014/11/29)
こんばんは!!
Redmineを使う機会があったので、
下記のURLを参考にインストールを実施してみます。
# DBの設定以外は下記URLの内容をそのまま実施
環境 バージョン
CentOS 6.5
# cat /etc/redhat-release CentOS release 6.5 (Final)
1. selinuxの無効化
# vi /etc/sysconfig/selinux (修正) # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - SELinux is fully disabled. SELINUX=disabled (再起動) # reboot # getenforce Disabled
2. ファイアウォールの設定追加(80ポートの解放)
# vi /etc/sysconfig/iptables (追加) -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT (iptables再起動) # service iptables restart iptables: チェインをポリシー ACCEPT へ設定中filter [ OK ] iptables: ファイアウォールルールを消去中: [ OK ] iptables: モジュールを取り外し中: [ OK ] iptables: ファイアウォールルールを適用中: [ OK ]
3. EPELリポジトリの登録
# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm を取得中 準備中... ########################################### [100%] (省略) # yum repolist epel Extra Packages for Enterprise Linux 6 - x86_64 11,226
# yum groupinstall "Development Tools"
5.RubyとPassengerのビルドに必要なヘッダファイルなどのインストール
# yum -y install openssl-devel readline-devel zlib-devel curl-devel libyaml-devel
6.PostgreSQLのインストール
PostgreSQL 9.4 インストール - Marlock Homes Diary
7.Apacheとヘッダファイルのインストール
# yum -y install httpd httpd-devel
8.ImageMagickとヘッダファイル・日本語フォントのインストール
# yum -y install ImageMagick ImageMagick-devel ipa-pgothic-fonts
9.Rubyのインストール
9.1.ダウンロード
# cd /usr/local/src/ # wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p598.tar.gz
9.2.ビルド
# tar xvzf ruby-2.0.0-p598.tar.gz # cd ruby-2.0.0-p598 # ./configure --disable-install-doc # make # make install # cd ..
9.3.インストール確認
# ruby -v ruby 2.0.0p598 (2014-11-13 revision 48408) [x86_64-linux]
10.Redmine用データベース作成
# su - postgres $ createdb redmine_db
11.Redmineのインストール
# cd /usr/local/src/ # curl -O http://www.redmine.org/releases/redmine-2.5.0.tar.gz # tar xvf redmine-2.5.0.tar.gz # mv redmine-2.5.0 /var/lib/redmine
12.データベースへの接続設定
# vi /var/lib/redmine/config/database.yml
production: adapter: postgresql database: redmine_db host: localhost username: postgres password: "postgres"
13.設定ファイル config/configuration.yml の作成
# vi /var/lib/redmine/config/configuration.yml production: email_delivery: delivery_method: :smtp smtp_settings: address: "localhost" port: 25 domain: '[fqdnを設定]' rmagick_font_path: /usr/share/fonts/ipa-pgothic/ipagp.ttf
14.bundlerのインストール
# gem install bundler --no-rdoc --no-ri
15.Gemパッケージのインストール
# bundle install --without development test
16.Redmineの初期設定とデータベースのテーブル作成
bundle exec rake generate_secret_token RAILS_ENV=production bundle exec rake db:migrate
17.Passengerのインストール
# bundle install --without development test
18.PassengerのApache用モジュールのインストール
# passenger-install-apache2-module # passenger-install-apache2-module --snippet LoadModule passenger_module /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.53/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.53 PassengerDefaultRuby /usr/local/bin/ruby </IfModule>
18.1. Apacheの設定
# vi /etc/httpd/conf.d/passenger.conf LoadModule passenger_module /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.53/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/local/lib/ruby/gems/2.0.0/gems/passenger-4.0.53 PassengerDefaultRuby /usr/local/bin/ruby </IfModule>
19. Apache起動
# service httpd start httpd を起動中: [ OK ]
20. サブディレクトリでRedmineを実行
20.1. シンボリックリンクの作成
# ln -s /var/lib/redmine/public /var/www/html/redmine
20.2. Apacheへの設定追加
(追加) RackBaseURI /redmine
20.3. Apache再起動
# service httpd configtest
Syntax OK
# service httpd graceful
以上でredmaineのインストールは完了。
以下にアクセス。