HowTo Install Redmine on Debian Squeeze with Postgresql Ruby-on-Rails and Apache2-Passenger » History » Version 7

« Previous - Version 7/11 (diff) - Next » - Current version
Kaj Ailomaa, 2010-11-27 16:27


HowTo Install Redmine on Debian Squeeze with Postgresql Ruby-on-Rails and Apache2-Passenger

This howto is similar to the HowTo Install Redmine on Debian with Ruby-on-Rails and Apache2-Passenger, but a little shorter and uses Postgresql instead of Mysql as the database server.
It should be noted that Redmine and all it's dependencies are available as packages in Debians' repo's, so there is no need to download Redmine from svn as we will do in this howto.

First we become root and install some needed packages:

su
apt-get install postgresql-8.4 apache2 subversion rake rubygems libopenssl-ruby libpgsql-ruby libapache2-mod-passenger
gem install -v=2.3.5 rails

Before configuring redmine we need to create a user and a database in Postresql. Be sure to replace <password> with your password.
su postgres
psql
postgres=# CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD '<password>' NOINHERIT VALID UNTIL 'infinity';
postgres=# CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine;
postgres=# \q
exit

Now, let's download Redmine and configure it
cd /tmp
svn co http://redmine.rubyforge.org/svn/branches/1.0-stable redmine-1.0
mv redmine-1.0/ /var/lib/redmine
cd /var/lib/redmine

First some database stuff. Replace <password> with your password.
echo "production:
 adapter: postgresql
 database: redmine
 host: localhost
 username: redmine
 password: <password>
 encoding: utf8
 schema_search_path: public" > config/database.yml

RAILS_ENV=production rake config/initializers/session_store.rb
rake generate_session_store
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data 

Finally, we setup Apache. A symbolic link to the www dir and ownership given to www-data.
ln -s /var/lib/redmine/public /var/www/redmine
chown -R www-data:www-data /var/www/redmine

We enable the site and restart Apache.
echo "RailsBaseURI /redmine" > /etc/apache2/sites-available/redmine
a2ensite redmine
/etc/init.d/apache2 restart

That's it. You will find Redmine at either:

localhost/redmine
your-ip/redmine or
your-domain/redmine

Log in with user: admin, password: admin