Redmine/Install on Debian Etch

From Debuntu

Jump to: navigation, search

This tutorial will describe how to install Redmine on Debian Etch.

One of the main thing I wanted to do was to install all those Ruby Gems in a separate directory then the global install.

Contents

Introduction

The gems will be installed in /usr/local/redmine-gems/ directory while the redmine site will be in /var/www/redmine.

This install was done on Debian Etch with Redmine 0.9.4.

Redmine will be handled by Apache's mod_fcgid

Requirements

First you need to get a few packages from Debian Backports.

Add to /etc/apt/sources.list

deb http://www.backports.org/debian etch-backports main contrib non-free

And then install:

# apt-get -t etch-backports install ruby irb ruby-dev ri rdoc libopenssl-ruby  libreadline-ruby libruby  rubygems libfcgi-ruby1.8

If you are planning to use git repositories, you can also install git-core from backports:

# apt-get install -t etch-backports install git-core

Now let's go and follow instructions from Redmine Install Manual

Installing Gems

Updating rubygems

There is an issue where debian does not let user updating gems using the standard rubygems package. To workaround this, we will install rubygems-update from gem itself, then we will update it:

# gem install rubygems-update -i /usr/local/redmine-gems/
# GEM_PATH=/usr/local/redmine-gems/ /usr/local/redmine-gems/bin/update_rubygems

Now, we will follow Redmine Install Manual but anytime we have to install a new gem, we will use the -i /usr/local/redmine-gems/ option:

# gem install rails -v=2.3.5 -i /usr/local/redmine-gems
# gem install mysql -i /usr/local/redmine-gems

Installing Redmine

While following the tutorial on installing redmine, you will need to prepend every commands with:

GEM_PATH=/usr/local/redmine-gems/

as for instance:

# GEM_PATH=/usr/local/redmine-gems/ RAILS_ENV=production /usr/local/redmine-gems/bin/rake db:migrate_plugins

Configuring Apache

Now, you need to make sure apache's fcgid module is installed and enabled, along with rewrite:

# a2enmod fcgid
# a2enmod rewrite

Copy dispatch.fcgi and make it executable:

# cp public/dispatch.fcgi.example public/dispatch.fcgi
# chmod 755 public/dispatch.fcgi

And finaly add a configuration like:

## REDMINE ##
<VirtualHost *:80>
  ServerAdmin webmaster@localhost
  ServerName  redmine.debuntu.org
  DocumentRoot /var/www/redmine/public

  DefaultInitEnv RAILS_ENV production
  DefaultInitEnv GEM_PATH /usr/local/redmine-gems/
  <Directory /var/www/redmine/public>
    Options +FollowSymLinks +ExecCGI
    RewriteEngine On
    RewriteRule ^$ index.html [QSA]
    RewriteRule ^([^.]+)$ $1.html [QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
    ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
    AllowOverride None
    #AllowOverride all
    Order allow,deny
    allow from all
  </Directory>
  # Possible values include: debug, info, notice, warn, error, crit,
  # alert, emerg.
  LogLevel warn

  CustomLog /var/log/apache2/redmine.debuntu.org_access.log combined
  ErrorLog /var/log/apache2/redmine.debuntu.org_error.log

  ServerSignature Off
</VirtualHost>
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
Google AdSense