2014 - DEBIAN7 + Redmine2.3.2
The Slovak original of this document: 2014 - DEBIAN7 + Redmine2.3.2 (slovensky).
|=-------------------------------------------------=[ Redmine ]=----------------------------------------------=| +--------------------------------------------------------------------------------------------------------------+ | | | OS: Debian 7.3.0 | | App: Redmine 2.3.4 | | DB: MySQL , PostgreSQL | | WWW: Nginx | | | +--------------------------------------------------------------------------------------------------------------+ |=-------------------------------------------------=[ LH 2014 ]=----------------------------------------------=|
Preparation
Download Redmine (version 2.3.4 | 2.3.2) and unpack it
--------------------------------------------------------------------------------------------------------
# mkdir -p /var/www/pm
# cd /var/www/pm
# wget http://www.redmine.org/releases/redmine-2.3.4.tar.gz
# wget http://files.rubyforge.vm.bytemark.co.uk/redmine/redmine-2.3.2.tar.gz
# tar -xzf ./redmine-2.3.4.tar.gz
# tar -xzf ./redmine-2.3.2.tar.gz
# rm ./redmine-2.3.4.tar.gz
# rm ./redmine-2.3.2.tar.gz
# mv redmine-2.3.4 redmine
# mv redmine-2.3.2 redmine
Set the hostname and FQDN of the machine
--------------------------------------------------------------------------------------------------------
# hostname pm.employer.exampleInstallation - Ruby and its components
Install Ruby and the required libraries
--------------------------------------------------------------------------------------------------------
# apt-get install build-essential ruby1.9.1-dev libmysqlclient-dev libmagickwand-dev rake
[1] Install the GEM "Bundler"
[2] Install all the packages Redmine needs
--------------------------------------------------------------------------------------------------------
[0]# cd /var/www/pm/redmine
[1]# gem install bundler
[2]# bundle install --without development test
Generate a random key/token
--------------------------------------------------------------------------------------------------------
# rake generate_secret_token
Install the GEM "Phusion Passenger"
--------------------------------------------------------------------------------------------------------
# gem install passengerInstallation and configuration - Database - Mysql
Installing the MySQL server and its components
--------------------------------------------------------------------------------------------------------
# apt-get install mysql-server mysql-client mysql-common
--------------------------------------------------------------------------------------------------------
New password for the MySQL "root" user: <mysql_root_password>
Log in as the user "root" and create the database
--------------------------------------------------------------------------------------------------------
# mysql -u root -p
Enter password: <mysql_root_password>
mysql> CREATE DATABASE redmine CHARACTER SET utf8;
mysql> CREATE USER 'redmine'@'localhost' IDENTIFIED BY '<redmine_db_password>';
mysql> GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
mysql> quit
Configure Redmine to work with the database
--------------------------------------------------------------------------------------------------------
# cd /var/www/pm/redmine/config
# cp ./database.yml.example ./database.yml
# nano ./database.yml
--------------------------------------------------------------------------------------------------------
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: <redmine_db_password>
encoding: utf8
schema_search_path: public
Finish the database configuration
--------------------------------------------------------------------------------------------------------
# cd /var/www/pm/redmine/
# chmod 600 ./config/database.yml
# RAILS_ENV=production rake db:migrate
# RAILS_ENV=production rake redmine:load_default_dataInstallation and configuration - Database - PostgreSQL
Installing the PostgreSQL server
--------------------------------------------------------------------------------------------------------
# apt-get install postgresql
Create and configure the database
--------------------------------------------------------------------------------------------------------
# su - postgres
# psql
--------------------------------------------------------------------------------------------------------
CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD '<redmine_db_password>' NOINHERIT VALID UNTIL 'infinity';
CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine TEMPLATE=template0;
\q
--------------------------------------------------------------------------------------------------------
# exit
Configure Redmine to work with the database
--------------------------------------------------------------------------------------------------------
# cd redmine/config
# cp ./database.yml.example ./database.yml
# nano ./database.yml
--------------------------------------------------------------------------------------------------------
production:
adapter: postgresql
database: redmine
host: localhost
username: redmine
password: <redmine_db_password>
encoding: utf8
schema_search_path: public
Finish the database configuration
--------------------------------------------------------------------------------------------------------
# chmod 600 ./database.yml
# cd ..
# RAILS_ENV=production rake db:migrate
# RAILS_ENV=production rake redmine:load_default_dataInstallation - Redmine
Final Redmine settings
--------------------------------------------------------------------------------------------------------
# adduser redmine
# cd /var/www/pm/
# chown -R redmine:redmine *
# cd redmine
# mkdir -p tmp tmp/pdf public/plugin_assets
# chmod -R 755 files log tmp public/plugin_assets
[1] Install the required/needed components
[2] Install the Nginx web server with Passenger support
--------------------------------------------------------------------------------------------------------
[1]# apt-get install libcurl4-openssl-dev libssl-dev
[2]# passenger-install-nginx-module
[1] Install the control scripts for Nginx (since we installed, or rather run, Nginx through Passenger)
[2] Edit the start script so that it points to the nginx binary managed by Passenger (quick and dirty)
--------------------------------------------------------------------------------------------------------
[1]# apt-get install nginx-extras
[2]# nano /etc/init.d/nginx
--------------------------------------------------------------------------------------------------------
DAEMON=/opt/nginx/sbin/nginx
...
start)
--exec $DAEMON -- $DAEMON_OPTS -c /opt/nginx/conf/nginx.conf || true
...
stop)
...
/usr/bin/killall nginx
--------------------------------------------------------------------------------------------------------
Setting up the web server - nginx
--------------------------------------------------------------------------------------------------------
# nano /opt/nginx/conf/nginx.conf
--------------------------------------------------------------------------------------------------------
user redmine;
server {
listen 80;
server_name pm.employer.example;
root /var/www/pm/redmine/public/;
access_log /var/www/pm/redmine/log/access.log;
error_log /var/www/pm/redmine/log/error.log;
index index.html;
location / {
passenger_enabled on;
allow all;
}
}
--------------------------------------------------------------------------------------------------------
Restart the Nginx web server
--------------------------------------------------------------------------------------------------------
# /etc/init.d/nginx restartInstallation - Redmine plugins - BackLog -> http://www.redminebacklogs.net/
[1] Install the package "git" +
[2] the other required libraries
--------------------------------------------------------------------------------------------------------
[1]# apt-get install git
[2]# apt-get install libxslt1-dev
[1] Move into the "plugins" directory and install the plugin "backlog"
[2] Create a clone with the GIT client
[3] Move into the directory "redmine_backlogs" and
[4] list the available versions
[5] Install the chosen version
--------------------------------------------------------------------------------------------------------
[1]# cd /var/www/pm/redmine/plugins
[2]# git clone git://github.com/backlogs/redmine_backlogs.git
[3]# cd redmine_backlogs
[4]# git tag
[5]# git checkout v1.0.6
Make sure the "rake" tasks are run in the production environment
--------------------------------------------------------------------------------------------------------
# cd /var/www/pm/redmine/
# RAILS_ENV=production
# export RAILS_ENV
Install the required GEM packages
--------------------------------------------------------------------------------------------------------
# gem install holidays thin open-uri-cached fastercsv yard shoulda redcarpet mocha prawn inifile chronic
# gem install ZenTest -v 4.5.0
# gem install autotest-rails
# gem install faye-websocket -v 0.4.7
# gem install poltergeist -v 1.0
# gem install cucumber-rails culerity database_cleaner
# gem install rspec -v 2.11.0
# gem install rspec-rails -v 2.11.0
# gem install simplecov -v 0.6
# gem install ruby-prof spork
# gem install timecop -v 0.3.5
# gem install cucumber -v 1.1.0
Configure Backlogs
--------------------------------------------------------------------------------------------------------
# cd /var/www/pm/redmine/
# bundle exec rake db:migrate
# bundle exec rake tmp:cache:clear
# bundle exec rake tmp:sessions:clear
# bundle exec rake redmine:backlogs:installInstallation - Redmine plugins - eKanban -> https://github.com/samchen2009/ekanban
Download the plugin "ekanban" into the plugin directory
--------------------------------------------------------------------------------------------------------
# cd /var/www/pm/redmine/plugins
# wget https://github.com/samchen2009/ekanban/archive/master.zip
# unzip ./master.zip
# rm ./master.zip
# mv ./ekanban-master ./ekanban
Install the plugin
--------------------------------------------------------------------------------------------------------
# cd /var/www/pm/redmine/plugins
# bundle install
# rake redmine:plugins:migrate RAILS_ENV=production
Restart the Nginx web server
--------------------------------------------------------------------------------------------------------
# /etc/init.d/nginx restartCurrent practice (checked 2026-10)
noteThe article above is kept as it was written in 2014. This section lists what has changed since and what to do instead today.
- Versions: Debian 7 lost its long term support at the end of May 2018 and Redmine 2.3 is long unsupported. When checked, redmine.org maintained the 7.0, 6.1 and 6.0 branches and listed 5.1 and older as unsupported; Redmine 7.0 needs Ruby 3.2 or newer, not
ruby1.9.1-dev, which Debian no longer has. Debian stable also ships aredminepackage. - Download: the tarballs are fetched over plain HTTP, one of them from a RubyForge mirror, and are not verified. Download from
https://www.redmine.org/releases/and compare the SHA256 sum published on the Download page. - Bundler and rake:
bundle install --without development testis replaced by abundle configsetting, and the rake tasks are run throughbundle exec(see below). - Database: Redmine's guide creates the MySQL database with
CHARACTER SET utf8mb4, notutf8. In Debiandefault-mysql-servernow installs MariaDB. - Passenger and nginx:
passenger-install-nginx-modulecompiled a second nginx into/opt/nginx, and the article then patches/etc/init.d/nginxto start it. Today Phusion provides an APT repository withlibnginx-mod-http-passenger, a module for the distribution's own nginx, which is managed by systemd as usual. Redmine's guide itself runs the application with Puma. - Ownership:
chown -R redmine:redmine *makes the whole tree writable by the user the application runs as. Redmine's guide gives that user write access only tofiles,log,tmpandpublic/assets. - HTTPS: the server block listens on port 80 only, so Redmine logins travel in clear. Serve it on
listen 443 sslwith a certificate and redirect port 80 there. - Plugins:
git clone git://github.com/...no longer works, GitHub switched the unencrypted git protocol off on 15 March 2022; use thehttps://URL. redmine_backlogs has no tag newer than the v1.0.6 used here and ekanban was last pushed in 2015; both were written for Redmine 2.x, so test them before planning an upgrade around them.
$ bundle config set --local without 'development test' $ bundle install $ bundle exec rake generate_secret_token $ RAILS_ENV=production bundle exec rake db:migrate
Sources: