專案

一般

個人檔案

動作

Redmine 1.1.0 + Apache + Passenger 在 Red Hat 上安裝至子 URI

本指南將引導您在 Red Hat Linux 上安裝新的 Redmine v. 1.1.0,包括在 Apache 上使用 Passenger。 以下是安裝假設:

  • 您已安裝並執行 MySQL 伺服器
  • 您已安裝並執行 Apache Web 伺服器

安裝 Ruby 和必要的 gem

  1. 取得並安裝 Ruby
  2. 取得並安裝 Gem
  3. gem install rails -v=2.3.5
  4. gem install -v=0.4.2 i18n
  5. gem install mysql
  6. gem install rake -v=0.8.3
  7. gem install rack -v=1.0.1
  8. gem install RedCloth
  9. gem install passenger
  10. passenger-install-apache2-module

安裝 Redmine

  1. 取得 Redmine 並將其解壓縮到某個位置
  2. export REDMINE_HOME=您放置 REDMINE 的位置
  3. cd $REDMINE_HOME
  4. rake generate_session_store
  5. RAILS_ENV=production rake db:migrate
  6. RAILS_ENV=production rake redmine:load_default_data (選擇 "en" 作為語言)
  7. ruby script/server webrick -e production (用於測試 Redmine 是否在 WEBrick 上運作,測試後關閉)

設定 Apache 以執行 Redmine

  1. cd $REDMINE_HOME
  2. chown -R apache:apache files log tmp vendor
  3. cd $REDMINE_HOME/public
  4. mv dispatch.cgi.example dispatch.cgi
  5. mv dispatch.fcgi.example dispatch.fcgi
  6. mv dispatch.rb.example dispatch.rb
  7. 編輯 dispatch.cgi 並加入以下幾行
    • #!/usr/local/bin/ruby
    • require /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/dispatcher.rb
  8. 編輯 $REDMINE_HOME/config/environment.rb 並在底部加入以下內容:Redmine::Utils::relative_url_root = "/redmine"
  9. 編輯 /etc/httpd/httpd.conf 並加入以下幾行
       LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.2/ext/apache2/mod_passenger.so
       PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.2
       PassengerRuby /usr/local/bin/ruby
    
    <VirtualHost *>
      ServerName YOUR_SERVER
      DocumentRoot YOUR_EXISTING_DOCUMENT_ROOT
      RailsEnv production
      RailsBaseURI /redmine
      PassengerDefaultUser apache
    </VirtualHost>
    
  10. sudo ln -s $REDMINE_HOME/public 您的現有文件根目錄/redmine
  11. 修改 $REDMINE_HOME/config/environment.rb 並加入以下內容
    # The below line is already in the file
    Rails::Initializer.run do |config|
      # A bunch of stuff
      config.action_controller.relative_url_root = '/redmine'    # add this line here!
    end
    

參考資料

Neil McFarlane 更新於 超過 13 年 前 · 2 個版本