How to install Redmine on Ubuntu 10.XX step by step

Summary: In this article i explain how to install Redmine on Ubuntu 10.x. Redmine version 1.1.2
Following the steps bellow and see how easly and step by step you are going to install and configure redmine on your local machine:
Step-1:  Update you ubuntu Machine

sudo apt-get update

Step-2: Install the dependencies before starting the actual installation.

sudo apt-get install ruby1.8-dev rubygems1.8 libmysql-ruby libmysqlclient-dev rake libopenssl-ruby libapache2-mod-passenger imagemagick libmagickcore-dev libmagickwand-dev

Step-3: Install Rails the compatible version is 2.3.5

sudo gem install rails -v=2.3.5

if it requires the Ruby version v >= 1.3.1

Then follow the steps:

Step-3-a: Install the following packages for ruby

sudo aptitude install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 libreadline-ruby1.8 libruby1.8 libopenssl-ruby sqlite3 libsqlite3-ruby1.8

We need to create some symlinks from the install to locations every programmer would look for

sudo ln -s /usr/bin/ruby1.8 /usr/bin/ruby
sudo ln -s /usr/bin/ri1.8 /usr/bin/ri
sudo ln -s /usr/bin/rdoc1.8 /usr/bin/rdoc
sudo ln -s /usr/bin/irb1.8 /usr/bin/irb

Check Ruby Version
Step-3-b: If you want to check ruby version use the following command

ruby -v

####################### Rubygems ###################

Now we have to install RubyGems  which is a package manager for the Ruby programming language. It is designed to easily manage the installation of gems, and a server for distributing them.

You can download latest rubygems.

Step-3-c: Download the rubygem, extract and install

wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz
tar xzvf rubygems-1.3.1.tgz
cd rubygems-1.3.1

Install rubygem using the following command

sudo ruby setup.rb

This will complete the rubygem installation.

Now create a symbolic link using the following command

sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

Check gem version using the following command

gem -v

Update gem packages using the following command

sudo gem update –system

Step-3-d: Now repeat the step 3

gem install rails -v=3.2.5

you will see some warnings like No definition for X. Ignore those, they mean that some documentation was not installed, and we can live with that.

Step-4: Install Mysql Gem

sudo gem install mysql

Step-5:

sudo gem install ruby-openid

Step-6:

sudo gem install i18n -v=0.4.2

This Gem is critical whenever you will update the server you have to revert this gem back to 0.4.2 version otherwise your application will be breaking.
Step-7:

sudo gem install passenger

Step-8:

sudo gem install rmagick

you will see some warnings like No definition for X. Ignore those, they mean that some documentation was not installed, and we can live with that.

Step-9: Enter into the MySQL console as root:

mysql -u root -p

password:

Step-10: Inside the MySQL console, execute these commands:

>create database redmine character set utf8;
>create user ‘redmine’@’localhost’ identified by ‘redmine@123’;
>grant all privileges on redmine.* to ‘redmine’@’localhost’;

exit from mysql.
Remember to change myPassword with your actual password. This is the one that will be used for the user redmine in the database redmine at localhost.

Step-11: Execute the following commands to download redmine 1.1.2.

server@root# wget http://rubyforge.org/frs/download.php/74419/redmine-1.1.2.tar.gz

download completed
then

tar -xvzf redmine-1.1.2.tar.gz

Step-12:

 cd redmine-1.1.2

Now setup the database configuration file to match our current environment:

cp config/database.yml.example config/database.yml

vim config/database.yml

production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: redmine@123
encoding: utf8

development:
adapter: mysql
database: redmine_development
host: localhost
username: redmine
password: redmine@123
encoding: utf8

save and exit!

Step-13: Generate session and db migration:

rake generate_session_store

If you have a problem by installing Redmine 1.2.2:

rake aborted!
uninitialized constant Gem::SyckDefaultKey
then run the following command:
sudo gem update –system 1.3.7
rake generate_session_store

sudo mkdir /opt/redmine
cd /opt/redmine
sudo cp -r ~/redmine-1.1.2 .
cd redmine-1.1.2
sudo RAILS_ENV=production rake db:migrate
sudo RAILS_ENV=production rake redmine:load_default_data

Note: Press enter to accept the default language (English) and then execute the following:

Step-14: Now do the following

sudo chown -R www-data:www-data files log tmp public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets
sudo nano /etc/apache2/mods-available/passenger.conf

Add this line inside the tag:

PassengerDefaultUser www-data

Step-15: Now let’s configure apache:

sudo nano /etc/apache2/sites-available/default

Just before the closing tag, , add the following:

RailsEnv production
RailsBaseURI /redmine

Step-16: Now we put a link to our application to be accessible from apache and restart it:

sudo ln -s /opt/redmine/redmine-1.1.2/public /var/www/redmine
sudo /etc/init.d/apache2 restart

Step-17: All done well, now open your browser and type:

http://localhost/redmine
username: admin
password: admin

Thats it!

Leave a Reply

Your email address will not be published. Required fields are marked *