Install Redmine on Ubuntu Server

Redmine is a flexible project management web application. Written using the Ruby on Rails framework, it is cross-platform and cross-database.

There are few step to install Redmine on Ubuntu Server.

Step 1-: Install apache, mysql-server and required packages.

$ sudo apt-get install update
$ sudo apt-get install -y mysql-server libmysqlclient-dev apache2 libcurl4-openssl-dev apache2-threaded-dev libapr1-dev libaprutil1-dev bundler

Step 2-: Create a database for Redmine Application.

$ mysql -u root -p'yourpass' -e "create database redmine"

Step 3-: Download latest Redmine from www.redmine.org and configure database.yml .

$ cd /var/www/html/
$ wget http://www.redmine.org/releases/redmine-3.2.3.tar.gz
$ tar -xvf redmine-3.2.3.tar.gz
$ mv redmine-3.2.3 redmine
$ cd redmine
$ cp config/database.yml.example config/database.yml
$ nano config/database.yml

Configure the database in database.yml file like below.

# Default setup is given for MySQL with ruby1.9.
# Examples for PostgreSQL, SQLite3 and SQL Server can be found at the end.
# Line indentation must be 2 spaces (no tabs).

production:
adapter: mysql2
database: redmine
host: localhost
username: root
password: "yourpassword"
encoding: utf8

development:
adapter: mysql2
database: redmine
host: localhost
username: root
password: "yourpassword"
encoding: utf8

Step 4-:  Redmine Dependencies Installation.

$ gem install bundle
$ bundle install --without rmagick
$ bundle exec rake generate_secret_token
$ RAILS_ENV=production bundle exec rake db:migrate

Step 5-: Apache Configuration and production setup.

$ sudo a2nmod rewrite
$ sudo gem install passenger
$ sudo passenger-install-apache2-module

You will get output like below-:

Please edit your Apache configuration file, and add these lines:

LoadModule passenger_module /var/lib/gems/2.1.0/gems/passenger-5.0.28/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /var/lib/gems/2.1.0/gems/passenger-5.0.28
PassengerDefaultRuby /usr/bin/ruby2.1
</IfModule>

After you restart Apache, you are ready to deploy any number of web
applications on Apache, with a minimum amount of configuration!

Open Virtualhost file and configure it.

$ sudo nano /etc/apache2/sites-available/000-default.conf

Paste the line like above output.

LoadModule passenger_module /var/lib/gems/2.1.0/gems/passenger-5.0.28/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /var/lib/gems/2.1.0/gems/passenger-5.0.28
PassengerDefaultRuby /usr/bin/ruby2.1
</IfModule>

and also set the DocumentRoot in virtualhost file.

DocumentRoot /home/sysadmin/redmine/public/
$ sudo service apache2 restart

AllowOverride all configuration on apache.conf

nano /etc/apache2/apache2.conf

Configure like below-:

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>

Demo-:

http://redmine.gotechnies.com/
Username- admin
Password -admin

Leave a Reply