This article is co-authored by Jérôme Warnier, from work mostly done by him with my occasional support. Kudos go to him.
We couldn’t find any valuable manual to install Redmine 2.1 on Debian Squeeze, and we sure met a lot of resistance along the way, so we came up with the following step-by-step guide…
Sources of inspiration
We used the following resources as a starting point. Thanks to their respective authors.
- http://madpropellerhead.com/random/20100820-installing-redmine-on-debian-with-apache (outdated, for Lenny)
- http://www.redmine.org/projects/redmine/wiki/RedmineInstall
- http://hodza.net/2012/03/15/howto-install-redmine-on-debian-6-squeeze-ruby-on-rails-apache2-passenger/
- http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Debian_with_Ruby-on-Rails_and_Apache2-Passenger
Assumptions
We take as given that:
- We are using a Debian Squeeze installation
- We have root access to this machine
- There is public access to the machine itself (public IP)
- We are able to define a public domain (or subdomain) name for this Redmine installation
- We have access to define a database (we chose MySQL) user for Redmine (this is important to avoid security risks in sharing accounts with another web system). We also assume that we already have a MySQL server installation
- We will be using Apache 2’s modPassenger (and Apache 2 is already installed on the server)
- We will be using redmine.example.com; so every time you see this below, replace it by your own domain
Warming up
We will first need to install basic packages:
apt-get install ruby rubygems libruby libapache2-mod-passenger
Download the latest version of Redmine (2.1.0 in our case) and untar it, then move it to /usr/local/share
ln /usr/local/share/redmine-2.1.0 /usr/local/share/redmine
chown -R root:root /usr/local/share/redmine-2.1.0
Install development libraries for MySQL:
apt-get install libmysqlclient-dev
Install development libs for Imagick:
apt-get install libmagickcore-dev libmagickwand-dev (install shitload of packages)
Running the Gem stuff
Install Bundler (removing useless module, which would otherwise create dependencies):
gem install bundler
cd /usr/local/share/redmine/
/var/lib/gems/1.8/bin/bundle install --without development test postgresql sqlite
Configuration
Copy config/database.yml.example to config/database.yml and edit this file in order to configure your database settings for “production” environment.
Example for a MySQL database using ruby1.8 or jruby:
production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: my_password
Generate a session store secret:
/var/lib/gems/1.8/bin/rake generate_secret_token
Generate the database structure:
RAILS_ENV=production /var/lib/gems/1.8/bin/rake db:migrate
Generate default configuration data:
RAILS_ENV=production /var/lib/gems/1.8/bin/rake redmine:load_default_data
(using “es” for Spanish language in terminal prompt)
Setup config file in config/configuration.yml
Change database_ciphr_key: *******
/var/lib/gems/1.8/bin/rake db:encrypt RAILS_ENV=production
Apache
Setup Apache’s VirtualHost config
# 8080 in this case is because we use a reverse proxy before Apache. Otherwise use :80
<VirtualHost *:8080>
ServerName redmine.example.com
DocumentRoot /usr/local/share/redmine/public
<Directory /usr/local/share/redmine/public>
AllowOverride all
Options -MultiViews
</Directory>
</VirtualHost>
There’s technically nothing special with the Apache config, given we use modPassenger, which makes Apache automatically detect Ruby files and interpret them with the right module… Just pointing to the right directory is enough.
Once you enable this virtual host (a2ensite redmine.example.com) and reload Apache (/etc/init.d/apache2/reload), you should see your site running on http://redmine.example.com.
The default login/password is admin/admin (don’t forget to change this).
10 Comments
David
24 September, 2012 at 4:57 pm -thank you very much for your post. Please link it in the Redmine wiki!
Yannick Warnier
26 September, 2012 at 9:51 am -Done! Now present on the Redmine wiki: http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_210_on_Debian_Squeeze_with_Apache_Passenger
Migrating from Redmine 1 to Redmine 2.1.0 on Debian Squeeze « BeezNest Open-Source specialists
26 September, 2012 at 6:57 am -[…] First: see previous post to install Redmine 2.1.0 (just don’t execute the second half of data filling and stuff: http://beeznest.wordpress.com/2012/09/20/installing-redmine-2-1-on-debian-squeeze-with-apache-modpas… […]
Bruce Wolfe
8 October, 2012 at 11:57 pm -On Debian Squeeze:
In Configuration,
“Generate a session store secret: /var/lib/gems/1.8/bin/rake generate_secret_token”
returns an error:
“bash: /var/lib/gems/1.8/bin/rake: No such file or directory”
All that is in “../bin” is “bundle” which is duplicate of the “redmine/public”
It is installed from the repo, apt-get install rake: “rake is already the newest version.”
And, it is listed as a gem install, gem list –local: “rake (0.9.2.2, 0.8.3)
Searching the web, http://stackoverflow.com/questions/1664974/rake-command-not-found , last comment gave the answer to find the correct path: gem env
!==>CORRECT PATH is /usr/lib/ruby/gems/1.8/gems/rake-0.9.2.2/bin/rake – /usr/lib/ruby/gems/1.8 true
– :verbose => true
– :benchmark => false
– :backtrace => false
– :bulk_threshold => 1000
– REMOTE SOURCES:
– http://rubygems.org/
emi
21 December, 2012 at 12:59 am -how to update this install?
Cesar perales
14 January, 2013 at 7:33 pm -On ubuntu 12.04, bundle path is /var/lib/gems/1.8/gems/bundler-X.X.X/bin/bundle.
Running:
/var/lib/gems/1.8/gems/bundler-1.2.3/bin/bundle install –without development test postgresql sqlite
returns this error:
/var/lib/gems/1.8/gems/bundler-X.X.X/bin/bundle:2:in `require’: no such file to load — bundler (LoadError)
from /var/lib/gems/1.8/gems/bundler-1.2.3/bin/bundle:2
this its fixed loading the missing file in the bundle file:
#!/usr/bin/env ruby
$LOAD_PATH << "/var/lib/gems/1.8/gems/bundler-1.1.5/lib/" (added line)
require 'bundler'
Cesar perales
16 March, 2013 at 12:04 am -Just to correct my previous comment:
from /var/lib/gems/1.8/gems/bundler-1.2.3/bin/bundle:2
and
$LOAD_PATH << "/var/lib/gems/1.8/gems/bundler-1.1.5/lib/" (added line)
Should be:
from /var/lib/gems/1.8/gems/bundler-X.X.X/bin/bundle:2
and
$LOAD_PATH << "/var/lib/gems/1.8/gems/bundler-X.X.X/lib/" (added line)
where X.X.X is you bundler version.
nothing
24 April, 2013 at 1:11 am -I have a little problem : error 500 on /admin and /my/setting page … No log (no apache or in /usr/local/share/redmine/log). What should I do ?
nothing
24 April, 2013 at 1:34 am -Found : I must use “PassengerDefaultUser ” in apache conf, and do “chown -R webserveruser.webservergroup /usr/local/share/redmine”
CDuv
11 July, 2013 at 5:58 pm -When accessing to http://redmine.example.com:8080 I get a Phusion Passenger error page saying:
—–8<—–
Ruby (Rack) application could not be started
A source file that the application requires, is missing.
It is possible that you didn't upload your application files correctly. Please check whether all your application files are uploaded.
A required library may not installed. Please install all libraries that this application requires.
Further information about the error may have been written to the application's log file. Please check it in order to analyse the problem.
Error message:
cannot load such file — bundler
Exception class:
LoadError
Application root:
/usr/local/share/redmine
—–8<—–
(Redmine log "/usr/local/share/redmine/log/production.log" is empty)
OS: Debian 7.1 (wheezy)
Redmine: version 2.3.1
Ruby: v1.9.3p448
Passenger packages:
* libapache2-mod-passenger v3.0.13debian-1
* ruby-passenger v3.0.13
Comments are closed.