项目

通用

个人资料

操作

Redmine 1.1.0 + Apache + Passenger在Red Hat上安装到子URI

本指南将指导您在Red Hat Linux上安装新的Redmine v. 1.1.0,包括在Apache上使用Passenger。以下是一些假设

  • 您有一个MySQL服务器正在运行
  • 您有一个Apache Web服务器正在运行

安装Ruby和所需宝石

  1. 获取并安装Ruby
  2. 获取并安装宝石
  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 YOUR_EXISTING_DOCUMENT_ROOT/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次修订