目次
下記の通り順繰りやっていけばOK。
# rpm -q openssl openssl-1.0.1e-16.el6_5.4.i686
# su - postgres $ createuser -S -D -R redmine $ createdb redmine --owner=redmine --template=template0 --encoding='UTF-8' --lc-collate='C' --lc-ctype='C'
$ vi /var/lib/pgsql/9.3/data/pg_hba.conf 〜(略)〜 # "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 に変更
# /etc/rc.d/init.d/postgresql-9.3 restart
# yum install -y libxml2 libxml2-devel libxslt libxslt-devel
# wget -P /usr/local/src http://www.redmine.org/releases/redmine-2.5.0.tar.gz
# cd /usr/local/src # tar zxvf redmine-2.5.0.tar.gz
# mkdir /home/htdocs # mv redmine-2.5.0 /home/htdocs
# ln -s /home/htdocs/redmine-2.5.0 /home/htdocs/redmine # ln -s /home/htdocs/redmine/public /var/www/htdocs/redmine
# chown -R apache:apache /home/htdocs # chown -R apache:apache /var/www/htdocs/redmine
# cd /home/htdocs/redmine-2.5.0/config # vi database.yml以下を記述する。
production: adapter: postgresql database: redmine host: localhost username: redmine password: "redmine" encoding: utf8
# cd /home/htdocs/redmine-2.5.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.3/bin/pg_config Fetching: pg-0.17.1.gem (100%) Building native extensions with: '--with-pg-config=/usr/pgsql-9.3/bin/pg_config' This could take a while... Successfully installed pg-0.17.1 invalid options: -f fivefish (invalid options are ignored) Parsing documentation for pg-0.17.1 unable to convert "\xF0" from ASCII-8BIT to UTF-8 for lib/pg_ext.so, skipping Installing ri documentation for pg-0.17.1 1 gem installed
# bundle install
Fetching gem metadata from https://rubygems.org/......... Fetching additional metadata from https://rubygems.org/.. Resolving dependencies... Using rake (10.1.1) Using i18n (0.6.9) Using multi_json (1.9.0) Using activesupport (3.2.17) Using builder (3.0.0) Using activemodel (3.2.17) Using erubis (2.7.0) Using journey (1.0.4) Using rack (1.4.5) Using rack-cache (1.2) Using rack-test (0.6.2) Using hike (1.2.3) Using tilt (1.4.1) Using sprockets (2.2.2) Using actionpack (3.2.17) Using mime-types (1.25.1) Using polyglot (0.3.4) Using treetop (1.4.15) Using mail (2.5.4) Using actionmailer (3.2.17) Using arel (3.0.3) Using tzinfo (0.3.38) Using activerecord (3.2.17) Using activeresource (3.2.17) Using awesome_nested_set (2.1.6) Using bundler (1.5.3) Using mini_portile (0.5.2) Using nokogiri (1.6.1) Using xpath (2.0.0) Using capybara (2.1.0) Using ffi (1.9.3) Using childprocess (0.5.1) Using coderay (1.1.0) Using rack-ssl (1.3.3) Using json (1.8.1) Using rdoc (3.12.2) Using thor (0.18.1) Using railties (3.2.17) Using jquery-rails (2.0.3) Using metaclass (0.0.4) Using mocha (1.0.0) Using net-ldap (0.3.1) Using pg (0.17.1) Using ruby-openid (2.3.0) Using rack-openid (1.4.2) Using rails (3.2.17) Using redcarpet (2.3.0) Installing rmagick (2.13.2) Installing rubyzip (1.1.0) Installing websocket (1.0.7) Installing selenium-webdriver (2.40.0) Installing shoulda-context (1.0.2) Installing shoulda-matchers (1.4.1) Installing shoulda (3.3.2) Installing yard (0.8.7.3) Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
# bundle exec rake generate_secret_token # RAILS_ENV=production bundle exec rake db:migrate
# gem install passenger --no-rdoc --no-ri
Fetching: daemon_controller-1.2.0.gem (100%) Successfully installed daemon_controller-1.2.0 Fetching: passenger-4.0.37.gem (100%) Building native extensions. This could take a while... Successfully installed passenger-4.0.37 2 gems installed
# passenger-install-apache2-module※途中で下記のように環境チェックが行われ、not foundが無ければインストールされる。
-------------------------------------------- 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: somewhere, not sure where Version: libcurl 7.19.7 Usable: yes Supports SSL: yes * Checking for OpenSSL development headers... Found: yes Location: true * Checking for Zlib development headers... Found: yes Location: true * Checking for Apache 2... Found: yes Location of httpd: /usr/sbin/httpd Apache version: 2.2.26 * Checking for Apache 2 development headers... Found: yes Location of apxs2: /usr/sbin/apxs * Checking for Rake (associated with /usr/bin/ruby)... Found: yes Location: /usr/bin/ruby /usr/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/ruby-2.0.0/ruby.h * Checking for rack... Found: yes * Checking for Apache Portable Runtime (APR) development headers... Found: yes Location: /usr/bin/apr-1-config Version: 1.5.0 * Checking for Apache Portable Runtime Utility (APU) development headers... Found: yes Location: /usr/bin/apu-1-config Version: 1.5.3 -------------------------------------------- Sanity checking Apache installation... All good! --------------------------------------------
Almost there! Please edit your Apache configuration file, and add these lines: LoadModule passenger_module /usr/lib/ruby/gems/2.0.0/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/lib/ruby/gems/2.0.0/gems/passenger-4.0.37 PassengerDefaultRuby /usr/bin/ruby </IfModule> After you restart Apache, you are ready to deploy any number of web applications on Apache, with a minimum amount of configuration!
# cd /etc/httpd/conf/extra/ # vi httpd-passenger.conf以下を記述。 (※以下の行は直前に表示されていた設定)
LoadModule passenger_module /usr/lib/ruby/gems/2.0.0/gems/passenger-4.0.37/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/lib/ruby/gems/2.0.0/gems/passenger-4.0.37 PassengerDefaultRuby /usr/bin/ruby </IfModule> 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
Redmineのプラグインのインストールに使用するGitをインストールしておく。
# yum install git
プラグインのインストールは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 git://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 # wget https://bitbucket.org/haru_iida/redmine_code_review/downloads/redmine_code_review-0.6.3.zip # unzip redmine_code_review-0.6.3.zip # chown -R apache:apache redmine_code_review # rake redmine:plugins:migrate RAILS_ENV=production # /etc/rc.d/init.d/httpd restart