#freeze
~
~
''目次''
#contents
~
----
*環境の構築 [#fcc03e63]
下記の通り順繰りやっていけばOK。~
+[[CentOS 6.5]] をインストール~
~
+[[OS時刻の同期設定>http://www.abetake.com/index.php?CentOS#sd5bdf44]]~
~
+''OpenSSL''はyumで最新にする。~
2014/03/04現在は1.0.1e~
 # rpm -q openssl
 openssl-1.0.1e-16.el6_5.4.i686
~
+[[OpenSSH 6.5p1(RPM)]]~
~
+[[PostgreSQL 9.3(RPM)]]~
~
インストール後に下記。
~
++''Redmine用ユーザーとDBの作成''
 # su - postgres
 $ createuser -S -D -R redmine
 $ createdb redmine --owner=redmine --template=template0 --encoding='UTF-8' --lc-collate='C' --lc-ctype='C'
~
++''pg_hba.confの編集''
 $ 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 に変更
~
++''pg_hba.confの編集後は再起動''
 # /etc/rc.d/init.d/postgresql-9.3 restart
~
+[[Apache 2.2.26(RPM)]]~
~
+[[Subversion 1.8.8(RPM)]]~
~
+[[Ruby 2.0.0(RPM)]]~
最新の2.1.1を使用しようと思ったが、[[バグの情報:http://www.redmine.org/projects/redmine/wiki/RedmineInstall#fn1]]があり2.0.0とした。~
~
+必要なものを yum でインストール
 # yum install -y libxml2 libxml2-devel libxslt libxslt-devel
~
*Redmine のインストール [#x837428d]
+ダウンロード~
 # 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
~
+シンボリックリンク作成~
以下のようにしておくとサブディレクトリとしてRedmineにアクセスできる。~
 # ln -s /home/htdocs/redmine-2.5.0 /home/htdocs/redmine 
 # ln -s /home/htdocs/redmine/public /var/www/htdocs/redmine
~
+所有権変更~
これをやっておかないと「Internal Error」。
 # chown -R apache:apache /home/htdocs 
 # chown -R apache:apache /var/www/htdocs/redmine
~
+database.ymlの作成~
 # cd /home/htdocs/redmine-2.5.0/config
 # vi database.yml
以下を記述する。
 production:
   adapter: postgresql
   database: redmine
   host: localhost
   username: redmine
   password: "redmine"
   encoding: utf8
~
+configuration.ymlの作成~
 # 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"
~
※「POP before SMTP」でメール通知する場合は上記の設定ではメール通知できない。~
→参考:[[RedmineでPOP before SMTP で通知メールを送るための設定:http://www.abetake.com/index.php?Redmine#i2a9a637]]~
~
+PostgreSQL用のGemをインストール~
 # 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
~
+Redmineで使用するGemをインストール~
Redmineのインストールディレクトリで以下のコマンドを実行。
 # 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. 
~
※Redmine 2.3より、bundlerは config/database.yml を参照して適切なデータベースアダプタをインストールするようになった為、2.2までのように --without オプションは必要はなし。~
~
+初期設定とデータベースのテーブル作成~
セッションデータ改竄防止用鍵の生成とテーブル作成を行う。~
Redmineのインストールディレクトリで以下のコマンドを実行。
 # bundle exec rake generate_secret_token
 # RAILS_ENV=production bundle exec rake db:migrate
~
+Passengerのインストール~
 # 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
~
+Apache用モジュールのインストール
 # passenger-install-apache2-module
※途中で下記のように環境チェックが行われ、''not found''が無ければインストールされる。~
''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!
 
 --------------------------------------------
~
インストールが完了した際に表示されるPassenger用のApache設定を保存しておく。
~
 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!
~
+Apacheの設定~
Passenger用の設定ファイルを作成する。
 # 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 /redmine
Passenger用の設定ファイルをインクルード。
 # vi /etc/httpd/conf/httpd.conf
 
 以下の記述を追記。
 Include conf/extra/httpd-passenger.conf
~
+Apache再起動~
 # /etc/rc.d/init.d/httpd restart
 httpd を停止中:                                            [  OK  ]
 httpd を起動中:                                            [  OK  ]
~
*設定、等 [#j59dc280]
+これをしないと[管理]-[情報]ページで『Plugin assetsディレクトリに書き込み可能』に!マークが付いたままになる。
~
 # chown -R apache:apache /home/htdocs/redmine/public/plugin_assets
~
+Redmineからの通知メール設定でPOPbeforeSMTP認証の場合の対応
~
~
[[RedmineでPOP before SMTP で通知メールを送るための設定:http://www.abetake.com/index.php?Redmine#i2a9a637]]を参照。
~
*プラグイン導入 [#k5eccb90]
~
Redmineのプラグインのインストールに使用する''Git''をインストールしておく。~
 # yum install git
~
プラグインのインストールはpluginsディレクトリにプラグインを展開するだけだが、DBを使用するプラグインでは下記の実行が必要。
~
 # rake redmine:plugins:migrate RAILS_ENV=production
DBを使用しないプラグインでも上記コマンドによる影響はないので、インストール後は毎回上記コマンドを実行しとけばOK。~
~
**Redmine HTTP Basic Authentication [#o4e9eeb7]
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
~
**Redmine Code Review plugin [#x865a9b2]
リポジトリ表示からコードレビューを追加できる。~
(参考:[[r-labs - Code Review>http://www.r-labs.org/projects/r-labs/wiki/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
~

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS