Project

General

Profile

Actions

HowTo Install Redmine in a sub-URI on Windows with Apache » History » Revision 2

« Previous | Revision 2/13 (diff) | Next »
Jack Kurzecki, 2009-12-29 04:41
updated with information for deployment of Redmine 0.9 (revision >= r3235)


HowTo Install Redmine in a sub-URI on Windows with Apache

Following the steps below exactly as listed will produce a working Redmine 0.8.7 installation hosted under http://localhost/redmine sub-URI on Windows XP/2003/2008 x86/x64 with Apache HTTP Server 2.2.x, MySQL 5.1.x and Ruby 1.8.7.
This walk-through also applies to installation of the latest Redmine revision. It was tested with Redmine revision r3255 (version 0.9) after updating Rails to version 2.3.5.
The intended audience for this walk-through are Windows users.

Install Apache HTTP server 2.2.x

  1. Download Win32 Binary with or without crypto (depending if you need SSL) from here
  2. Install to C:\webserver\apache

Install MySQL 5.1.x

  1. Download Windows Essentials (x86) from here
    • x64 version could be used for x64 Windows installations, but the x86 version works well on all Windows versions and is recommended.
  2. Install to C:\webserver\MySQL
    • (optional:) Set data files installation directory to C:\webserver\MySQLData

Install MySQL GUI Tools for MySQL 5.0

  1. Download Windows (x86) Installer from here
  2. Install to C:\webserver\MySQL_GUI_Tools

Install Ruby 1.8.7

  • At the time of writing this document the latest version of Ruby was 1.9.1 which does NOT work with Redmine
  • Use Ruby version 1.8.7 only.
  • Since there is no installer package for 1.8.7, we will first install 1.8.6 then copy 1.8.7 binaries on top of it.
  1. Download "rubyinstaller-1.8.6-p383-rc1.exe" from here
  2. Install to C:\webserver\ruby
  3. Open command window, then execue:
    mkdir C:\webserver\railsapps
    cd C:\webserver\railsapps
    gem list
    gem uninstall rails
    gem uninstall actionmailer
    gem uninstall actionpack
    gem uninstall activerecord
    gem uninstall activeresource
    gem uninstall activesupport
    
  4. Download Ruby 1.8.7-p72 Binary "ruby-1.8.7-p72-i386-mswin32.zip" from here
  5. Extract the archive contents to C:\webserver\ruby overwritting the 1.8.6 version
  6. Add "C:\webserver\ruby\bin" to your PATH environment variable if not already included
  7. Download the zlib package from here
    1. extract the zlib1.dll
    2. rename it to zlib.dll
    3. move it to C:\webserver\ruby\bin
  8. Download the iconv package from here
    1. extract iconv.dll
    2. move it to C:\webserver\ruby\bin
  9. Verify Ruby version
    1. in command window, execute:
      ruby -v
      
      • expected output:
        ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-mswin32]
        

Install RubyGems

  • At the time of writting this document the latest version of RubyGems was 1.3.5. Newer versions should work too.
  1. Download "rubygems-1.3.5.zip" from here
  2. Extract the package to C:\webserver\railsapps
  3. Install Ruby Gems
    1. in command window, execute:
      cd C:\webserver\railsapps\rubygems-1.3.5
      ruby setup.rb
      
      • expected output:
        RubyGems 1.3.5 installed
        
    2. in command window, execute:
      cd ..
      gem update --system
      

Additional gems

  • mongrel-service and win32-service gems have to be downloaded manually. Download locations are added to sections below.

Install Rake

  • At the time of writting this document the latest version of Rake was 0.8.7. Newer versions should work too.
  1. Install Rake gem
    1. in command window, execute:
      gem install rake
      • expected output:
        Successfully installed rake-0.8.7
        

Install Rails

  • At the time of writting this document the latest version of Rails was 2.3.5 which does NOT work with Redmine 0.8.7
  • Use Rails version 2.1.2 for Redmine 0.8.7 deployment.
  • Use Rails version 2.3.5 for Redmine revision >= r3235 deployment.
  • Procedure below assumes we will be installing Redmine 0.8.7
  1. Install Rails gems
    1. in command window, execute:
      gem install rails -v=2.1.2
      
      • expected output:
        Successfully installed activesupport-2.1.2
        Successfully installed activerecord-2.1.2
        Successfully installed actionpack-2.1.2
        Successfully installed actionmailer-2.1.2
        Successfully installed activeresource-2.1.2
        Successfully installed rails-2.1.2
        

Install Mongrel

  • At the time of writting this document the latest version of Mongrel was 1.1.5. Newer versions should work too.
  • _Project page_
  1. Install Mongrel gems
    1. in command window, execute:
      gem install mongrel
      
      • expected output:
        Successfully installed gem_plugin-0.2.3
        Successfully installed cgi_multipart_eof_fix-2.5.0
        Successfully installed mongrel-1.1.5-x86-mswin32-60
        

Install mysql gem

  • At the time of writting this document the latest version of mysql gem was 2.8.1. Newer versions should work too.
  • It drastically improves page generation speed.
  1. Install mysql gem
    1. in command window, execute:
      gem install mysql
      
      • expected output:
        Successfully installed mysql-2.8.1
        

Install mongrel-service + win32-service gems

  • At the time of writting this document the latest version of win32-service was 0.7 which does NOT work with Ruby 1.8.7
  • Use only win32-service version 0.5.2 for Redmine deployment.
  1. Download mongrel-service 0.3.4 (project page)
  2. Move mongrel_service-0.3.4-i386-mswin32.gem to C:\webserver\railsapps
  3. Download win32-service 0.5.2 from HERE
  4. Move win32-service-0.5.2-mswin32.gem to C:\webserver\railsapps
  5. Install the gem
    1. in command window, execute:
      cd C:\webserver\railsapps
      gem install mongrel_service
      
      • expected output:
        Successfully installed gem win32-service-0.5.2-mswin32
        Successfully installed gem mongrel_service-0.3.4-i386-mswin32
        

Install Redmine

  • Procedure below assumes we will be installing Redmine 0.8.7, but it also works with revision >= r3235
  1. Download "Redmine" from here
  2. Extract the archive to C:\webserver\railsapps\redmine
  3. Log into MySQL using GUI Tools as "root"
    • Open a new script tab and execute the following script:
      create database redmine character set utf8;
      create user 'redmine'@'localhost' identified by 'my_password';
      grant all privileges on redmine.* to 'redmine'@'localhost';
      
  4. Copy C:\webserver\railsapps\redmine\config\database.yml.example to C:\webserver\railsapps\redmine\config\database.yml
  5. Edit "config\database.yml" file in order to configure your database settings for "production" environment.
    • set hostname, username and password to the velues entered in the SQL script above.
    • save and close the file.
  6. Create default tables and populate with data
    1. in command window, execute:
      cd redmine
      rake config\initializers\session_store.rb
      set RAILS_ENV=production
      rake db:migrate
      rake redmine:load_default_data
      
  7. Procedure below assumes we will be hosting Redmine under http://localhost/redmine:
  8. Edit "config\environment.rb" file in order to configure Redmine to work as a sub-URI (Apache configuration listed below).
    • This is a preferred way of setting up the application prefix. Mongrel_rails service "--prefix" directive does NOT work with Rails 2.3.x
    • add the following line at the bottom of the file:
      Redmine::Utils::relative_url_root = "/redmine" 
      
    • save and close the file.

Setup windows services

  1. Create windows services
    1. in command window, execute:
      mongrel_rails service::install -N mongrel_redmine_3001 -D "Mongrel serving Redmine on 3001" -p 3001 -e production -c C:\webserver\railsapps\redmine
      mongrel_rails service::install -N mongrel_redmine_3002 -D "Mongrel serving Redmine on 3002" -p 3002 -e production -c C:\webserver\railsapps\redmine
      mongrel_rails service::install -N mongrel_redmine_3003 -D "Mongrel serving Redmine on 3003" -p 3003 -e production -c C:\webserver\railsapps\redmine
      
  2. Start windows services, which in turn will start mongrel servers
    1. in command window, execute:
      net start mongrel_redmine_3001
      net start mongrel_redmine_3002
      net start mongrel_redmine_3003
      
  3. Go to the Windows Services list and set all "Mongrel serving Redmine on 300#" services to start automatically
    1. in command window, execute:
      services.msc /s
      

Configure Apache 2.2.x as proxy to Mongrel cluster

  1. Open C:\webserver\apache\conf\httpd.conf
  2. At the bottom of this file add the following line:
    Include conf/httpd-proxy-mongrel.conf
    
  3. Create a file C:\webserver\apache\conf\httpd-proxy-mongrel.conf
  4. Enter the following:
    LoadModule proxy_module modules/mod_proxy.so
    LoadModule proxy_http_module modules/mod_proxy_http.so
    LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
    
    ProxyPass /redmine balancer://redmine_cluster
    ProxyPassReverse /redmine balancer://redmine_cluster
    
    <Proxy balancer://redmine_cluster>
        BalancerMember http://127.0.0.1:3001
        BalancerMember http://127.0.0.1:3002
        BalancerMember http://127.0.0.1:3003
    </Proxy>
    
  5. Restart the apache service.

DONE!

Apendix

  • Check if you have all the necessary gems installed for Redmine 0.8.7
    • in command window, execute:
      gem list
      
      • expected output:
        actionmailer (2.1.2)
        actionpack (2.1.2)
        activerecord (2.1.2)
        activeresource (2.1.2)
        activesupport (2.1.2)
        cgi_multipart_eof_fix (2.5.0)
        gem_plugin (0.2.3)
        mongrel (1.1.5)
        mongrel_service (0.3.4)
        mysql (2.8.1)
        rails (2.1.2)
        rake (0.8.7)
        win32-service (0.5.2)
        
  • Check if you have all the necessary gems installed for Redmine revision r3235 +
    • in command window, execute:
      gem list
      
      • expected output:
        actionmailer (2.3.5)
        actionpack (2.3.5)
        activerecord (2.3.5)
        activeresource (2.3.5)
        activesupport (2.3.5)
        cgi_multipart_eof_fix (2.5.0)
        gem_plugin (0.2.3)
        mongrel (1.1.5)
        mongrel_service (0.3.4)
        mysql (2.8.1)
        rack (1.0.1)
        rails (2.3.5)
        rake (0.8.7)
        win32-service (0.5.2)
        

Updated by Jack Kurzecki about 14 years ago · 2 revisions