Redmine 2.5 installation guide on Debian Wheezy with MariaDB

RedmineRedmine express installation guide & configuration for Debian Wheezy 7 with Apache/2.2.x, 10.0.x-MariaDB, PHP 5.4.4 (DSO) backend without loaded SCM.

Here is original guide which I’ve modiffied to my idea: http://martin-denizet.com/install-redmine-2-5-x-with-git-and-subversion-on-debian-with-apache2-rvm-and-passenger/ (Thanks Martin).

This is just for my personal purposes. I’m not responsible for any harm on your server as this guide is public.

Article assumes you have fully loaded (installed and configured) Apache2.2, MariaDB and PHP 5.4 with needed loaded modules for apache like ssl, rewrite and also ports.conf configured and at least 1 virtualhost to prevent some errors.

========== REDMINE INSTALLATION BEGIN ==========

- We will work under sudo root account
$ sudo -i

- Installing Ruby (we need 2.0 version instead of 2.1+ because it's not supported by Redmine)
# aptitude update && aptitude safe-upgrade
# aptitude install curl
# curl -sSL https://get.rvm.io | bash -s stable --ruby=2.0.0
# su
	- We need to reload user variables provile (/etc/profile.d), because of ruby shell script was added (if rvm doesn't work, relog your ssh/user session)
# rvm list
	- To check that we have installed ruby-2.0.0-p481
# aptitude install imagemagick libmagickwand-dev
	- Dependency for Redmine (not needed but I recommend it)
# aptitude install subversion
# cd /opt/
# mkdir redmine
# cd redmine/
# svn co http://svn.redmine.org/redmine/branches/2.5-stable current
# cd current/
# mkdir -p tmp tmp/pdf public/plugin_assets
# chown -R www-data:www-data files log tmp public/plugin_assets
# chmod -R 755 files log tmp public/plugin_assets
# mysql -u root -p
mysql> CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password123';
mysql> CREATE DATABASE redmine CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> GRANT ALL PRIVILEGES ON redmine.* To 'redmine'@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> EXIT;
# cp config/configuration.yml.example config/configuration.yml
# cp config/database.yml.example config/database.yml
# vi config/database.yml
	- (WARNING: NUMBERS BEFORE ARE NUMBERS OF LINES, DON'T COPY IT!)

				6 production:
				7 adapter: mysql2
				8 database: redmine
				9 host: localhost
				10 username: redmine
				11 password: "my_password123"
				12 encoding: utf8

# aptitude install libmariadbclient-dev
	- Needed dependency for MariaDB 10.0.x instead of MySQL 5.5.x as ruby will count with MySQL tools as default.
# gem install mysql2
# bundle install --without development test
# bundle exec rake generate_secret_token
# RAILS_ENV=production bundle exec rake db:migrate
# RAILS_ENV=production bundle exec rake redmine:load_default_data

# gem install passenger
# aptitude install apache2-threaded-dev libapr1-dev libaprutil1-dev libcurl4-openssl-dev
	- Dependency for passenger
# passenger-install-apache2-module
	- All preparation checks must be passed. Otherwise it won't compile passenger module and won't generate loading of module for apache.

				--------------------------------------------
				Almost there!
				Please edit your Apache configuration file, and add these lines:

				   LoadModule passenger_module /usr/local/rvm/gems/ruby-2.0.0-p481/gems/passenger-4.0.50/buildout/apache2/mod_passenger.so
				   <IfModule mod_passenger.c>
				     PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p481/gems/passenger-4.0.50
				     PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.0.0-p481/wrappers/ruby
				   </IfModule>

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

				Press ENTER to continue.
				--------------------------------------------

# vi /etc/apache2/conf.d/passenger.conf
	- Don't Copy & P configuration below, copy generated by installation passenger-install-apache2-module as shown above (you can have downloaded another version than me). We need to create passenger.conf for Apache to load newly installed module

				LoadModule passenger_module /usr/local/rvm/gems/ruby-2.0.0-p481/gems/passenger-4.0.50/buildout/apache2/mod_passenger.so
				<IfModule mod_passenger.c>
					PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p481/gems/passenger-4.0.50
					PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.0.0-p481/wrappers/ruby
				</IfModule>

# aptitude install libapache-dbi-perl libapache2-mod-perl2 libdbd-mysql-perl
	- If you'll need in future to enable Repository browsing, we need to install perl modules for Apache2 and also symlink module for authentication.
# ln -s /opt/redmine/current/extra/svn/Redmine.pm /usr/lib/perl5/Apache2/
# mkdir /etc/apache2/ssl
# openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/redmine.key -out /etc/apache2/ssl/redmine.crt
 - Common name = redmine.contoso.com
# a2enmod headers perl ssl
# wget https://sabrnet.wzk.cz/wp-content/uploads/sites/4/2016/07/redmine.contoso.com_.txt
# mv redmine.contoso.com_.txt /etc/apache2/sites-available/redmine.contoso.com.conf
# a2ensite redmine.contoso.com.conf
# service apache2 restart

We need to configure mail notofications via PHP Sendmail instead of SMTP auth
	# vi /opt/redmine/current/config/configuration.yml
		- Comment out everything instead of email_delivery and delivery_method change to sendmail (WARNING: NUMBERS BEFORE ARE NUMBERS OF LINES, DON'T COPY IT!)

				 80 # default configuration options for all environments
				 81 default:
				 82   # Outgoing emails configuration (see examples above)
				 83   email_delivery:
				 84     delivery_method: :sendmail
				 85     #smtp_settings:
				 86     #  address: smtp.example.net
				 87     #  port: 25
				 88     #  domain: example.net
				 89     #  authentication: :login
				 90     #  user_name: "[email protected]"
				 91     #  password: "redmine"

DONE!

========== /REDMINE INSTALLATION END ==========

 

Here you can show redmine.contoso.com apache config file Рremember to rename extension .txt to .conf as Apache2 need it and also configure it for your specific server environment.

Few useful RVM commands:

rvm list #shows actual ruby version
rvm list known #shows available ruby versions for each platform and notify for old stable version to upgrade RVM
rvm get stable #upgrade to latest stable version of RVM

Information about Repository SCM for redmine: I have loaded perl redmine module for SVN apache listing for future, but actually I don’t have configured directory in apache redmine.contoso.conf as it’s needed (just loaded perl module as it’s unnecessary). If you wish fully working SCM for repos, look here for configurated apache redmine site to svn: https://gist.githubusercontent.com/martin-denizet/11080033/raw/redmine.vhost

1 thought on “Redmine 2.5 installation guide on Debian Wheezy with MariaDB

  1. Pingback: Upgrade Redmine version from 2.5 to 3.1 | SabrNET

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.