Redmine Server Installation

You will need to install various requirements to run redmine (ruby, rails, mysql, etc).  Please visit http://www.redmine.org/wiki/redmine/RedmineInstall for details.

  1. Download redmine software from http://www.redmine.org/wiki/redmine/Download
  2. Unpack the redmine software
    # tar -xzf redmine
  3. mv the redmine-0.8.3 folder to /srv/redmin
    # mv redmin-0.8.3 /srv/redmin
  4. Create the emply database and account for redmine
    # mysql -uroot -p
    > create database redmine;
    > grant all on redmin.* to 'redmine'@'localhost' identified by 'secretpassword'
  5. Copy and edit the database.yml config file
    # cp /srv/redmine/config/database.yml.example /srv/redmine/config/database.yml
    # vi /srv/redmine/config/database.yml
    Change the database name, host, username, and password as needed
  6. Create the database structure
    # cd /srv/redmine/
    # rake db:migrate RAILS_ENV="production"
  7. Insert default config data
    # rake redmine:load_default_data RAILS_ENV="production"
  8. Copy and edit the email.yml config file
    # cp /srv/redmine/config/email.yml.example /srv/redmine/config/email.yml
    Change the address to localhost, domain to your from domain and authentication to login (comment out username and password for non authenticated send)
  9. Create the redmine init.d script (change the 192.168.1.1 address to the ip you are listening on)
    #!/usr/bin/env ruby
    #
    # Copyright (c) 1996, 1997, 1998 S.u.S.E. GmbH
    # Copyright (c) 1998, 1999, 2000, 2001 SuSE GmbH
    # Copyright (c) 2002, 2003 SuSE Linux AG
    #
    # Authors: Rolf Haberrecker <rolf@suse.de>, 2001
    #          Peter Poeml <poeml@suse.de>, 2002, 2003, 2004, 2005
    #
    #
    # /etc/init.d/apache2
    #
    ### BEGIN INIT INFO
    # Provides:                     redmine
    # Required-Start:               $local_fs $remote_fs $network
    # X-UnitedLinux-Should-Start:   $named $time postgresql sendmail mysql ypclient dhcp radiusd
    # Required-Stop:                $local_fs $remote_fs $network
    # X-UnitedLinux-Should-Stop:
    # Default-Start:                3 5
    # Default-Stop:                 0 1 2 6
    # Short-Description:            Redmine
    # Description:                  Start the redmine daemon Apache
    ### END INIT INFO

    require "fileutils"
    include FileUtils

    require "rubygems"

    begin
    gem 'mongrel'
    rescue => e
    puts "Error: daemon mode of redmine requires mongrel installed"
    exit 1
    end

    def redmine_path
    "/srv/redmine"
    end

    def redmine_user
    "root"
    end

    command = ARGV.shift

    case command
    when 'start'
    system "su - #{redmine_user} -c 'cd #{redmine_path}; mongrel_rails start -d -e production -p 80 -a 192.168.1.1'"
    #system "su - #{redmine_user} -c 'cd #{redmine_path}; mongrel_rails start -d -e production'"
    #script/server webrick -e production
    exit 0
    when 'stop'
    system "cd #{redmine_path}; mongrel_rails stop"
    system "rm -f #{redmine_path}/log/mongrel.pid"

    exit 0
    when 'restart'
    system "/etc/init.d/redmine stop"
    system "/etc/init.d/redmine start"
    exit 0
    else
    p "Usage: /etc/init.d/redmine start|stop|restart"
    exit 1
    end

  10. Register and start redmine
    # chkconfig redmine on
    # ln -s /etc/init.d/redmine /usr/sbin/rcredmine
    # rcredmine start
  11. Browse to the webpage and login with the username admin and password of admin
  12. Go to Admin & Settings to modify the application settings.

Leave a Reply