目次
下記の通り順繰りやっていけばOK。
# rpm -q openssl openssl-1.0.0-25.el6_3.1.i686
# su - postgres $ createuser -S -D -R redmine $ createdb redmine --owner=redmine --template=template0 --encoding='UTF-8' --lc-collate='C' --lc-ctype='C'
# "local" is for Unix domain socket connections only local all all peer → trust に変更 # IPv4 local connections: host all all 127.0.0.1/32 ident → trust に変更 # IPv6 local connections: host all all ::1/128 ident → trust に変更
# yum install -y libxml2 libxml2-devel libxslt libxslt-devel
# wget -P /usr/local/src http://rubyforge.org/frs/download.php/76867/redmine-2.3.0.tar.gz
# cd /usr/local/src # tar zxvf redmine-2.3.0.tar.gz
# mkdir /home/htdocs # mv redmine-2.3.0 /home/htdocs
# ln -s /home/htdocs/redmine-2.3.0 /home/htdocs/redmine # ln -s /home/htdocs/redmine/public /var/www/htdocs/redmine
# cd /home/htdocs/redmine-2.3.0/config # vi database.yml以下を記述する。
production: adapter: postgresql database: redmine host: localhost username: redmine password: "redmine" encoding: utf8
# cd /home/htdocs/redmine-2.3.0/config # cp configuration.yml.example configuration.yml # vi configuration.yml環境に合わせて設定する。
# default configuration options for all environments default: # Outgoing emails configuration (see examples above) email_delivery: delivery_method: :smtp smtp_settings: address: smtp.hogehoge.com port: 25 domain: hogehoge.com authentication: :login user_name: "redmine@hogehoge.com" password: "redmine"
# gem install pg -- --with-pg-config=/usr/pgsql-9.2/bin/pg_config Building native extensions. This could take a while... Successfully installed pg-0.15.0 1 gem installed Installing ri documentation for pg-0.15.0... unable to convert "\xC5" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to EUC-JP for Contributors.rdoc, skipping unable to convert "\xC5" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to EUC-JP for History.rdoc, skipping unable to convert "\xEF" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to EUC-JP for ext/pg.c, skipping Installing RDoc documentation for pg-0.15.0... unable to convert "\xC5" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to EUC-JP for Contributors.rdoc, skipping unable to convert "\xC5" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to EUC-JP for History.rdoc, skipping unable to convert "\xEF" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to EUC-JP for ext/pg.c, skipping
# bundle install※Redmine 2.3より、bundlerは config/database.yml を参照して適切なデータベースアダプタをインストールするようになった為、2.2までのように --without オプションは必要はなし。
# bundle exec rake generate_secret_token # RAILS_ENV=production bundle exec rake db:migrate
# gem install passenger --no-rdoc --no-ri
# passenger-install-apache2-module※途中で下記のように環境チェックが行われ、not foundが無ければインストールされる。
-------------------------------------------- Checking for required software... * GNU C++ compiler... found at /usr/bin/g++ * Curl development headers with SSL support... found * OpenSSL development headers... found * Zlib development headers... found * Ruby development headers... found * OpenSSL support for Ruby... found * RubyGems... found * Rake... found at /usr/local/bin/rake * rack... found * Apache 2... found at /usr/sbin/httpd * Apache 2 development headers... found at /usr/sbin/apxs * Apache Portable Runtime (APR) development headers... found at /usr/bin/apr-1-config * Apache Portable Runtime Utility (APU) development headers... found at /usr/bin/apu-1-config --------------------------------------------
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/1.9.1/gems/passenger-3.0.19/ext/apache2/mod_passenger.so PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19 PassengerRuby /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!
# cd /etc/httpd/conf/extra/ # vi httpd-passenger.conf以下を記述。 (※以下の3行は直前に表示されていた設定)
LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19/ext/apache2/mod_passenger.so PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.19 PassengerRuby /usr/local/bin/ruby RailsBaseURI /redminePassenger用の設定ファイルをインクルード。
# vi /etc/httpd/conf/httpd.conf 以下の記述を追記。 Include conf/extra/httpd-passenger.conf
# /etc/rc.d/init.d/httpd restart httpd を停止中: [ OK ] httpd を起動中: [ OK ]
# chown -R apache:apache /home/htdocs/redmine/public/plugin_assetsこれをしないと[管理]-[情報]ページで『Plugin assetsディレクトリに書き込み可能』に!マークが付いたままになる。
Redmineのプラグインのインストールに使用するGit,mercurialをインストールしておく。
→Gitのインストール
# yum install mercurial
プラグインのインストールはpluginsディレクトリにプラグインを展開するだけだが、DBを使用するプラグインでは下記の実行が必要。
# rake redmine:plugins:migrate RAILS_ENV=production
DBを使用しないプラグインでも上記コマンドによる影響はないので、インストール後は毎回上記コマンドを実行しとけばOK。
Basic認証でRedmineにログインできるようになる。
インストールしてHttpdを再起動するとプラグインがデフォルトで有効になり、RedmineユーザーにBasic認証ユーザーと同じ名前が登録されていないと何も出来なくなる。
前以ってBasic認証ユーザーと同じ名前のRedmine管理者を登録しておく必要がある。
(調べてないので詳細は不明だが、Redmine管理者をインストール前に作っておくのが楽。)
# cd /home/htdocs/redmine/plugins # git clone http://github.com/pburgisser/redmine_http_basic_authentication.git # rake redmine:plugins:migrate RAILS_ENV=production # /etc/rc.d/init.d/httpd restart
リポジトリ表示からコードレビューを追加できる。
(参考:r-labs - Code Review)
# cd /home/htdocs/redmine/plugins # hg clone https://bitbucket.org/haru_iida/redmine_code_review # rake redmine:plugins:migrate RAILS_ENV=production # /etc/rc.d/init.d/httpd restart
※Redmine 2.3 では動作しない模様。
用語集プラグイン。
(参考:r-labs - Glossary)
# cd /usr/local/src # wget http://iij.dl.sourceforge.jp/rp-glossary/53770/rp-glossary-0.6.1.zip # unzip rp-glossary-0.6.1.zip # mv redmine_glossary /home/htdocs/redmine/plugins # cd /home/htdocs/redmine/plugins # rake redmine:plugins:migrate RAILS_ENV=production # /etc/rc.d/init.d/httpd restart