Introduction
Redmine is a web application for project management, written entirely using Ruby on Rails, and released under the terms of GPLv2.
Some of its features include:
- Multiple projects support.
- Flexible issue tracking system.
- Documents, news, and files management.
- Per project wiki.
- Per project forums.
- SCM integration.
- Multiple LDAP authentication support.
Getting started
First of all, there are a lot of dependencies required. On the server, execute the command:
# yum install zlib-devel patch curl-devel ImageMagick-devel openssl-devel httpd-devel libtool apr-devel apr-util-devel bzip2 mysql-devel ftp wget gcc-c++ autoconf readline readline-devel zlib libyaml-devel libffi-devel make automake bison iconv-devel subversion
Install Ruby
Redmin 3.2.x requires Ruby 2.2. So, first you’ll want to install Ruby Version Manager which allows managing of multiple ruby environments.
# gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 # curl -L https://get.rvm.io | bash -s stable --ruby=2.2.5
The last command will download and execute a BASH script for installing and configuring Ruby 2.2.5.
This will take some time. Once it is complete, execute the following commands for adding rvm to the .bashrc file and reload automatically.
First:
# source /usr/local/rvm/scripts/rvm
Next, edit
adding the following lines:
[[ -s "/usr/local/rvm/scripts/rvm" ]] source "/usr/local/rvm/scripts/rvm"
Reload
.
Next, check Ruby and RVM versions:
# ruby -v
which, in my case, gives the output:
and
# rvm -v
which gives the output:
Configure MySQL
First, install (if not yet present) MySQL
# rpm -Uvh https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm # yum repolist # yum install mysql-server
Run it:
# systemctl start mysqld
During installation process, MySQL generated a temporary password, which is stored in
; access it:
# grep 'temporary password' /var/log/mysqld.log
It will return a temporary password, which will be used for logging into mysql shell:
# mysql -u root -p
Next:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'my_new_strong_password';
Create a new database for Redmine:
mysql> CREATE DATABASE redmine SET utf8; mysql> CREATE USER 'redmineuser'@localhost' IDENTIFIED BY 'user_strong_password'; mysql> GRANT ALL PRIVILEGES ON redmine.* TO 'redmineuser'@'localhost' IDENTIFIED BY 'user_strong_password'; mysql> FLUSH PRIVILEGES; mysql> EXIT;
Phusion Passenger and Nginx
Phusion Passenger, as stated in its official website, is an application server that acting as a process manager, reverse proxy and by providing operations tools, enables you to quickly launch and easily maintain Ruby, Node.js, Python and Meteor apps.
Install it with the
command:
# gem install passenger --no-ri --no-rdoc
Then, execute:
# passenger-install-nginx-module
You will be asked for some information, and then it will install Nginx. The default installation directory is
. Of course, you can change it. In it, edit
.
On line 23, paste the following content:
Save and close the file. Next, create a
directory for Virtual Host configuration files.
# mkdir -p /opt/nginx/conf/vhost
In this directory, create a
file. The paste the following into that file:
server { listen 80; server_name www.redmine.me; root /var/www/redmine/public; passenger_enabled on; client_max_body_size 10m; # Max attachemnt size # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }
If you want to use Nginx with
, create the file
, and then paste the following into that file:
[Unit] Description=The NGINX HTTP and reverse proxy server After=syslog.target network.target remote-fs.target nss-lookup.target [Service] Type=forking PIDFile=/opt/nginx/logs/nginx.pid ExecStartPre=/opt/nginx/sbin/nginx -t ExecStart=/opt/nginx/sbin/nginx ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target
After saving and exiting, you can start Nginx:
# systemctl daemon-reload # systemctl start nginx
Install Redmine
Now, it’s possible to install Redmine in
# cd /var/www/ # svn co https://svn.redmine.org/redmine/branches/3.2-stable redmine
In the newly created
folder, execute the following commands:
# cp config/configuration.yml.example config/configuration.yml # cp config/database.yml.example config/database.yml
Next, edit
:
production: adapter: mysql2 database: redmine host: localhost username: redmineuser password: "user_strong_password" encoding: utf8
Always in
directory:
# mkdir -p tmp tmp/pdf public/plugin_assets # chown -R nobody:nobody files log tmp public/plugin_assets # chmod -R 775 files log tmp public/plugin_assets
Next, install Bundler to manage gems dependencies:
# gem install bundler
And then:
# bundle install --without development test
Generate a secret token:
# bundle exec rake generate_secret_token
and create database structure:
# RAILS_ENV=production bundle exec rake db:migrate # RAILS_ENV=production bundle exec rake redmine:load_default_data
After that, restart nginx and visit the domain name with a browser, in which you’ll use a Dashboard (after logging in) for creating and managing projects.
Our work is done!