操作
Redmine 1.1.0 + Apache + Passenger在Red Hat上安装到子URI¶
本指南将指导您在Red Hat Linux上安装新的Redmine v. 1.1.0,包括在Apache上使用Passenger。以下是一些假设
- 您有一个MySQL服务器正在运行
- 您有一个Apache Web服务器正在运行
安装Ruby和所需宝石¶
- 获取并安装Ruby
- 获取并安装宝石
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 YOUR_EXISTING_DOCUMENT_ROOT/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次修订