[Ubuntu] How to install Redmine2.5.X on Ubuntu12.04LTS?

[Ubuntu] How to install Redmine2.5.X on Ubuntu12.04LTS?

o Ubuntu LTS 12.04 64-bit
o Apache 2.2
o MySQL 5
o Ruby 1.9.3
o Redmine 2.5.X

[Installation Guide]
1. Install some tools:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get -y install git-core git-doc git-gui gitk
$ git --version
$ sudo apt-get install tasksel
$ sudo apt-get install libtool
$ sudo apt-get install build-essential
$ sudo apt-get install curl
$ sudo apt-get install libmagickwand-dev
$ sudo apt-get install subversion
$ sudo apt-get install apache2
$ sudo apt-get install libapache2-mod-ruby

2. Install RVM and Ruby:
[Note] Do not use “sudo apt-get” instruction to install ruby
—Install Ruby with RVM

$ curl -L https://get.rvm.io | bash -s stable

—Set rvm to path, add below line into .bashrc or .bash_profile

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

—Source the file

$ source ~/.rvm/scripts/rvm
$ rvm requirements

—Install Ruby

$ rvm install 1.9.3
$ rvm use 1.9.3

—Install Latest RubyGems

$ rvm rubygems current


$ ruby -v
ruby 1.9.3p547 (2014-05-14 revision 45962) [x86_64-linux]

$ gem -v

3. Install Rails and Bundle dependencies:

$ gem install rails
$ gem install bundler

4. Install MySQL:

$ sudo apt-get install mysql-server
$ sudo apt-get install mysql-client
$ sudo apt-get install libmysqlclient-dev
$ gem install mysql2
$ cd /etc/mysql/conf.d/
$ sudo vi characterset.cnf


$ sudo service mysql restart

5. Create an empty database and accompanying user for redmine:

$ mysql -u root -p

mysql> show variables like 'character_set%';
mysql> CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';
mysql> GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
mysql> exit;

6. Install Redmine 2.5.X:

$ svn co http://svn.redmine.org/redmine/branches/2.5-stable redmine
$ cd ~/redmine
$ bundle install --without development test postgresql sqlite

7. Setting redmin by MySQL and testing:
—File system permissions

$ sudo usermod -a -G www-data YOUR_USERNAME
$ sudo chgrp www-data /var/www
$ sudo chmod -R 775 /var/www
$ sudo chmod g+s /var/www
$ mkdir public/plugin_assets
$ sudo chown -R YOUR_USERNAME:www-data files log tmp public/plugin_assets config.ru
$ sudo chmod -R 755 files log tmp public/plugin_assets

—Database connection configuration

$ cp ./config/database.yml.example ./config/database.yml
$ sudo vim ./config/database.yml

adapter: mysql2
database: redmine
host: localhost
username: redmine
password: my_password

—Session store secret generation

$ rake generate_secret_token

—Database schema objects creation

$ RAILS_ENV=production rake db:migrate

—Database default data set

$ RAILS_ENV=production rake redmine:load_default_data

—Test the installation

$ ruby script/about
$ ruby script/rails server webrick -e production

Open the browser:

—Logging into the application
Use default administrator account to log in:
login: admin
password: admin

8. Install and setting Apache Passenger:

$ gem install passenger --no-rdoc --no-ri
$ passenger-install-apache2-module
$ cd /etc/apache2/mods-available
$ sudo vim passenger.conf

—Add the following lines into passenger.conf

LoadModule passenger_module /home/YOUR_USERNAME/.rvm/gems/ruby-1.9.3-p547/gems/passenger-4.0.44/buildout/apache2/mod_passenger.so 
  <IfModule mod_passenger.c> 
    PassengerRoot /home/YOUR_USERNAME/.rvm/gems/ruby-1.9.3-p547/gems/passenger-4.0.4
    PassengerDefaultRuby /home/YOUR_USERNAME/.rvm/gems/ruby-1.9.3-p547/wrappers/ruby

—Add the following lines into passenger.load

$ sudo vi passenger.load

LoadModule passenger_module /home/YOUR_USERNAME/.rvm/gems/ruby-1.9.3-p547/gems/passenger-4.0.44/buildout/apache2/mod_passenger.so 
  <IfModule mod_passenger.c> 
    PassengerRoot /home/YOUR_USERNAME/.rvm/gems/ruby-1.9.3-p547/gems/passenger-4.0.4
    PassengerDefaultRuby /home/YOUR_USERNAME/.rvm/gems/ruby-1.9.3-p547/wrappers/ruby

—Do another settings

$ cd /etc/apache2/mods-enabled
$ sudo ln -s /etc/apache2/mods-available/passenger.conf
$ sudo ln -s /etc/apache2/mods-available/passenger.load

—Modify default

$ sudo vim /etc/apache2/sites-available/default

DocumentRoot /home/YOUR_USERNAME/redmine/public
  <Directory /home/YOUR_USERNAME/redmine/public/>

$ sudo service apache2 restart

[Screen Shot]




How to install Redmine?

How to install Redmine on Ubuntu12.04?

How to Install Ruby on Rails on Ubuntu 12.04 LTS (Precise Pangolin) with RVM??

Installed Ruby 1.9.3 with RVM but command line doesn’t show ruby -v

Setting Apache 2 Web Server on Ubuntu 12.04

(Visited 60 times, 1 visits today)

One thought on “[Ubuntu] How to install Redmine2.5.X on Ubuntu12.04LTS?

  1. hi
    thanks for the tutotial is so great, but I have a problem I´ve followed the tutorial and when I try to execute the sentences below —Session store secret generation I have the next error “Could not find gem ‘rails (=3.2.19) ruby’ in the gems available on this machine.”
    Do you how can I solve this problem?? or if I miss some step?

Comments are closed.

Comments are closed.