Project

General

Profile

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

Kaj Ailomaa, 2010-11-27 15:41

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