Install the Redmine project management application on Debian 4.0 Etch
Redmine is a project management application written in Ruby (using the now famous Ruby on Rails framework). Having already tried Trac, and used for some time Bugzilla, i've been seduced by the simplicity and the functionalities of this software. If you want a powerfull project manager, with a bug tracker, forums, wiki, project time line management and some other functionalities, Redmine is for YOU ! I just love it :D
Warning
This guide use exclusively LigHTTPd. I have done this choice for many reasons : ease of install, light memory usage, but also because I was not wanting to use the Apache proxy module.
If you really want to use Apache 2, I encourage you to read this guide : Mongrel : Apache best practice deployment.
A part of the following guide is still valid, but you will have to think and understand what you are doing in order to know witch it is :D.
Dependencies
Before anything else, you need to install Redmine dependencies :
/usr/bin/apt-get install ruby rake librmagick-ruby subversion libmysql-ruby mysql-client rubygemsWe also install LigHTTPd and the FastCGI Ruby library :
/usr/bin/apt-get install lighttpd libfcgi-ruby1.8
The LigHTTPd configuration is created later in this guide, since it depends of the install path of Redmine.
Installation
First, enter the URL of the version of Redmine you want to install (you can find a list of Redmine downloads in the Redmine RubyForge):
SOURCE_URL=http://rubyforge.org/frs/download.php/34650/redmine-0.7.0_RC1.tar.gz
And download the Redmine sources archive :
/usr/bin/wget $SOURCE_URL \
--output-document=/tmp/redmine.tar.gz
Untar the downloaded file to an appropriate folder :
/bin/tar --directory /tmp -xzf /tmp/redmine.tar.gz
And move the new folder to its final emplacement :
/bin/mv /tmp/redmine-* /opt/redmine
You can now delete the downloaded file :
/bin/rm /tmp/redmine.tar.gz
Before configuring Redmine, you need to create a MySQL database.
If you have followed my MySQL database creation guide, you can jump this step. Otherwise, run the following command lines updated with the informations of your database :
MYSQL_DB=REDMINE
MYSQL_USERNAME=redmine
MYSQL_USERPWD=mot_de_passe
Then, configure Redmine to use this new database :
/bin/echo "# MySQL database configuration
production:
adapter: mysql
database: $MYSQL_DB
host: localhost
username: $MYSQL_USERNAME
password: $MYSQL_USERPWD" > /opt/redmine/config/database.yml
Once this done, go into your Redmine installation folder :
cd /opt/redmine
Create the database tables :
/usr/bin/rake db:migrate RAILS_ENV="production"
And update its contents :
/usr/bin/rake redmine:load_default_data RAILS_ENV="production"
At this time, you are asked to choose the install language.
We now clean up a little the default permissions since they are really too much permissive.
/bin/chmod -R go-w /var/www/redmine
We create a new Redmine folder in /var/lib :
/bin/mkdir --parent /var/lib/redmine
We move concerned folders to this new emplacement :
/bin/mv /opt/redmine/log /var/lib/redmine
/bin/mv /opt/redmine/tmp /var/lib/redmine
/bin/mv /opt/redmine/files /var/lib/redmine
We create symbolic links to replace the moved folders :
/bin/ln -s /var/lib/redmine/log /opt/redmine/log
/bin/ln -s /var/lib/redmine/tmp /opt/redmine/tmp
/bin/ln -s /var/lib/redmine/files /opt/redmine/files
We now change theses folders permissions in order to make them writable by the HTTP server :
/bin/chown -R www-data:www-data /var/lib/redmine
Notifications configuration
Redmine is able to send email notification for some events. But the default SMTP configuration does not work out of the box. We need to comment some parameters so that it work in a standard environment (this depends of your local SMTP server configuration). Simply run this command line :
/bin/sed -i \
-e 's/\(.*domain\)/#\1/' \
-e 's/\(.*authentication\)/#\1/' \
-e 's/\(.*user_name\)/#\1/' \
-e 's/\(.*password\)/#\1/' \
/opt/redmine/config/environment.rb
The resulting environment.rb file should now contain the following lines for the email send configuration:
# SMTP server configuration
config.action_mailer.smtp_settings = {
:address => "127.0.0.1",
:port => 25,
# :domain => "somenet.foo",
# :authentication => :login,
# :user_name => "redmine@somenet.foo",
# :password => "redmine",
}
It is configured to connect to the local SMTP server without using login.
Note : If this configuration does not work (you can test it from the notifications administration page of Redmine), i encourage you to manually edit the file /opt/redmine/config/environment.rb to replace the default STMP server by the one your Internet service provider.
HTTP server configuration
Now that we have installed Redmine, we need to configure our HTTP server in order to access it.
First, create the Redmine FastCGI dispatch file :
/bin/cp /opt/redmine/public/dispatch.fcgi.example /opt/redmine/public/dispatch.fcgi
We update our hosts file to that redmine is a name for 127.0.0.1 :
/bin/sed -i -e 's/\(127\.0\.0\.1.*\)/\1 redmine/' /etc/hosts
We create a virtual host configuration for Redmine in LigHTTPd :
echo '## Redmine virtual hosting
server.modules += ( "mod_simple_vhost" , "mod_rewrite" , "mod_fastcgi" )
$HTTP["host"] == "redmine" {
server.document-root = "/opt/redmine/public/"
server.follow-symlink = "enable"
alias.url = ()
server.indexfiles = ( "dispatch.fcgi" )
server.error-handler-404 = "/dispatch.fcgi"
url.rewrite-once = (
"^/(.*\..+(?!html))$" => "$0",
"^/(.*)\.(.*)" => "$0",
)
fastcgi.server = (
".fcgi" => (
"redmine" => (
"bin-path" => "/usr/bin/ruby /opt/redmine/public/dispatch.fcgi",
"socket" => "/tmp/redmine.socket",
"min-procs" => 1,
"max-procs" => 4,
"idle-timeout" => 120,
"check-local" => "disable",
"bin-environment" => ( "RAILS_ENV" => "production" ),
)
)
)
}' > /etc/lighttpd/conf-available/10-redmine.conf
We enable the new virtual host :
/usr/sbin/lighty-enable-mod redmine
And we reload LigHTTPd configuration :
/etc/init.d/lighttpd force-reload
You can now access Redmine by using this URL :
Repositories watching
By default, Redmine download repositories informations only when you visit the "Repository" tab of your project. For this download to be done regularly, uncheck the "Autofetch commits" option in Redmine configuration, and create the needed cron script with the following command lines :
/bin/echo '#!/bin/sh
#
# Cron script to update Redmine repositories informations.
/usr/bin/ruby /opt/redmine/script/runner "Repository.fetch_changesets" -e production' \
| /usr/bin/tee /etc/cron.hourly/redmine-repositories
/bin/chmod +x /etc/cron.hourly/redmine-repositories
DST management (aka. summer and winter time)
In its default configuration, Redmine does not support automatic DST. In order to enable it, you need to install a plugin. In order to do this, you must install tzinfo for Ruby:
/usr/bin/gem install tzinfo --remote
Then, go to the root of your Redmine install:
cd /opt/redmine
And install the needed plugin:
/usr/bin/ruby script/plugin install tzinfo_timezone
Going deeper
I encourage you to read the Redmine guide.
In my opinion, i find Redmine so simple that you can learn it by simply exploring its configuration menus.
If you don't have a Subversion repository, I encourage you to create one... (at the present time, i'm too lazy to do a Google search for you :D)
Thanks
- Thanks to Redmine developers.
- Thanks to the writers of the guide Installing Redmine.
- Thanks to NiLuJe for his post Ruby on Rails et Typo sous Lighttpd.
- Thanks to eMerzh for his post Redmine, un gestionnaire de projet peu connu.
Guide
Mongrel Apache deployment page obsolete
Redmine in Ubuntu Jaunty 9.04
I have created a howto for ubuntu 9.04 about how to install Redmine.
http://wiki.ousli.org/index.php/RedmineUbuntu
Hope this helps
Installed Redmine+SVN
http://billing.sourcerepo.com/aff.php?aff=067
Install
Some notes:
1) Remind the user they need to install MySQL clients and server first.
2) Please show the actual end result of the SMTP config. Your script didn't work for me.
3) You mention "cp /var/www/redmine/public/dispatch.fcgi.example" but you haven't put anything into /var/www/redmine yet according to your instructions. My install didn't put anything there at least.