Install Redmine

Package versions:

Ruby 2.3.3
Rails 4.2.*
MySql 5.5
Apache2

Steps:

  1. Install prerequisite from apt
    sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev nodejs libmagickwand-dev libmysqlclient-dev libapr1-dev libaprutil1-dev bison libgdbm-dev
  2. Install apache2, mysql
    sudo apt-get install apache2 mysql-server-5.5 apache2-dev
  3. Prepare database
    CREATE DATABASE redmine CHARACTER SET utf8;
    CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';
    GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
    FLUSH PRIVILEGES;
  4. Install ruby 2.3.3 from source
    wget https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.3.tar.gz
    tar -zxvf ruby-2.3.3.tar.gz
    cd ruby-2.3.3
    ./configure
    make
    sudo make install
    ruby -v
  5. Install rails 4.2.*
    curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
    sudo apt-get install -y nodejs
    sudo gem install rails -v 4.2.7.1
  6. Install bundler
    gem install bundler
  7. Install red mine 3.3.2
    wget 'http://www.redmine.org/releases/redmine-3.3.2.tar.gz'
    tar -zxvf redmine-3.3.2.tar.gz
    sudo mv redmine-3.3.2 /usr/share/
    sudo ln -s /usr/share/redmine-3.3.2 /usr/share/redmine
    cd /usr/share/redmine
    sudo cp config/database.yml.example config/database.yml
    sudo nano config/database.yml

    change database settings
    bundle install --without development test postgresql sqlite
    bundle exec rake generate_secret_token
    RAILS_ENV=production bundle exec rake db:migrate
    RAILS_ENV=production bundle exec rake redmine:load_default_data
    sudo chown -R rogerlin:www-data files log tmp public/plugin_assets
    sudo chmod -R 755 files log tmp public/plugin_assets
  8. Test your installation with Webrick
    bundle exec rails server webrick -e production
  9. Install passenger
    sudo gem install passenger
    sudo passenger-install-apache2-module

    Copy and paste the code generated from passenger into your Apache site configuration file(site.conf)
  10. Configure site configurations
    Add the following code into your site configuration file and restart Apache service.
    PassengerAppRoot /usr/share/redmine
    RailsBaseURI /redmine
    Alias /redmine /usr/share/redmine/public