Project

General

Profile

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

Kaj Ailomaa, 2010-11-27 15:47

1 1 Kaj Ailomaa
h1. HowTo Install Redmine on Debian Squeeze with Postgresql Ruby-on-Rails and Apache2-Passenger
2
3
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.
4
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.
5
6
First we become root and install some needed packages:
7
<pre>
8
su
9
apt-get install postgresql-8.4 apache2 subversion rake rubygems libopenssl-ruby libpgsql-ruby libapache2-mod-passenger
10 3 Kaj Ailomaa
gem install -v=2.3.5 rails
11 1 Kaj Ailomaa
</pre>
12
Before configuring redmine we need to create a user and a database in postresql. Be sure to replace <password> with your password.
13
<pre>
14
su postgres
15
psql
16
postgres=# CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD '<password>' NOINHERIT VALID UNTIL 'infinity';
17
postgres=# CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine;
18 2 Kaj Ailomaa
postgres=# \q
19
exit
20 1 Kaj Ailomaa
</pre>
21
Now, let's download redmine and configure it
22
<pre>
23
cd tmp
24
svn co http://redmine.rubyforge.org/svn/branches/1.0-stable redmine-1.0
25
mv redmine-1.0/ /var/lib/redmine
26
cd /var/lib/redmine
27
</pre>
28
First some database stuff. Replace <password> with your password.
29
<pre>
30
echo "production:
31
 adapter: postgresql
32
 database: redmine
33
 host: localhost
34
 username: redmine
35
 password: <password>
36
 encoding: utf8
37
 schema_search_path: public" > config/database.yml
38
39
RAILS_ENV=production rake config/initializers/session_store.rb
40
rake generate_session_store
41
RAILS_ENV=production rake db:migrate
42
RAILS_ENV=production rake redmine:load_default_data 
43
</pre>
44
Finally, we setup Apache. A symbolic link to the www dir and ownership given to www-data.
45
<pre>
46
ln -s /var/lib/redmine/public /var/www/redmine
47
chown -R www-data:www-data /var/www/redmine
48
</pre>
49
We enable the site and restart apache.
50
<pre>
51
echo "RailsBaseURI /redmine" > /etc/apache2/sites-available/redmine
52
a2ensite redmine
53
/etc/init.d/apache2 restart
54
</pre>
55
56
That's it.