動作
Redmine 1.1.0 + Apache + Passenger 在 Red Hat 上安裝至子 URI¶
本指南將引導您在 Red Hat Linux 上安裝新的 Redmine v. 1.1.0,包括在 Apache 上使用 Passenger。 以下是安裝假設:
- 您已安裝並執行 MySQL 伺服器
- 您已安裝並執行 Apache Web 伺服器
安裝 Ruby 和必要的 gem¶
- 取得並安裝 Ruby
- 取得並安裝 Gem
gem install rails -v=2.3.5
gem install -v=0.4.2 i18n
gem install mysql
gem install rake -v=0.8.3
gem install rack -v=1.0.1
gem install RedCloth
gem install passenger
passenger-install-apache2-module
安裝 Redmine¶
- 取得 Redmine 並將其解壓縮到某個位置
export REDMINE_HOME=您放置 REDMINE 的位置
cd $REDMINE_HOME
rake generate_session_store
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data
(選擇 "en" 作為語言)ruby script/server webrick -e production
(用於測試 Redmine 是否在 WEBrick 上運作,測試後關閉)
設定 Apache 以執行 Redmine¶
cd $REDMINE_HOME
chown -R apache:apache files log tmp vendor
cd $REDMINE_HOME/public
mv dispatch.cgi.example dispatch.cgi
mv dispatch.fcgi.example dispatch.fcgi
mv dispatch.rb.example dispatch.rb
- 編輯 dispatch.cgi 並加入以下幾行
#!/usr/local/bin/ruby
require /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/dispatcher.rb
- 編輯
$REDMINE_HOME/config/environment.rb
並在底部加入以下內容:Redmine::Utils::relative_url_root = "/redmine"
- 編輯
/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>
sudo ln -s $REDMINE_HOME/public 您的現有文件根目錄/redmine
- 修改
$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 個版本