HowTo install Redmine on Debian with Passenger » History » Version 1

Holger Just, 2010-07-18 20:43

1 1 Holger Just
h1. HowTo install Redmine on Debian with Passenger
2 1 Holger Just
3 1 Holger Just
{{>toc}}
4 1 Holger Just
5 1 Holger Just
*This is work in progress. Please see the guide on [[HowTo_Install_Redmine_on_Debian_with_Ruby-on-Rails_and_Apache2-Passenger]] for now.*
6 1 Holger Just
7 1 Holger Just
This guide is going to explain how to install Redmine 0.9.x, 1.0.x, or trunk for a production setup on a Debian 5.0.x "Lenny".
8 1 Holger Just
9 1 Holger Just
Although, there exists a "Redmine package":http://packages.debian.org/lenny-backports/redmine in lenny-backports and above, I would recommend to not use it for now, as it patches Redmine to run on various older libraries (foremost Rails). If you run Squeeze, it should be easier to use the provided package. However, you are more flexible and probably get better support in the forums or in IRC when you use the redmine.org provided package. This is obviously the preferred method of deployment here.
10 1 Holger Just
11 1 Holger Just
h2. What we are going to do here?
12 1 Holger Just
13 1 Holger Just
At first, we need to make sure to meet the general requirements on [[RedmineInstall]]. At the time of writing, this included:
14 1 Holger Just
15 1 Holger Just
* Ruby 1.8.7 (preferred), 1.8.6 is also okay. Redmine is still not fully compatible with Ruby 1.9.x and JRuby
16 1 Holger Just
* Rubygems 1.3.1 or higher
17 1 Holger Just
* Rails 2.3.5 with dependencies
18 1 Holger Just
* Rack 1.0.1. Version 1.1 is not supported with Rails 2.3.5
19 1 Holger Just
20 1 Holger Just
Finally, we are going to install Apache 2.2 or Nginx together with passenger and set them up with redmine.
21 1 Holger Just
22 1 Holger Just
We are now walking through to install all these packages.
23 1 Holger Just
24 1 Holger Just
h2. Install Ruby
25 1 Holger Just
26 1 Holger Just
At first, we install the base ruby. Luckily, Debian Lenny ships with ruby 1.8.7 by default:
27 1 Holger Just
28 1 Holger Just
<pre>
29 1 Holger Just
aptitude install ruby1.8 irb1.8 rdoc1.8 ri1.8 libreadline-ruby1.8 libopenssl-ruby1.8
30 1 Holger Just
</pre>
31 1 Holger Just
32 1 Holger Just
h2. Setup lenny-packports to install passenger and some requirements from debian packages
33 1 Holger Just
34 1 Holger Just
This step is not necessary if you run a newer Debian distribution than Lenny. So if you run Squeeze or Sid, just skip this.
35 1 Holger Just
36 1 Holger Just
At first, we are adding the official @lenny-backports@ repository to our @sources.list@. This repository provides newer or additional packages compiled to run with Debian Lenny. Most of the time, it will include the software versions from the current testing distribution.
37 1 Holger Just
38 1 Holger Just
<pre>
39 1 Holger Just
echo "deb http://www.backports.org/debian lenny-backports main" >> /etc/apt/sources.list
40 1 Holger Just
aptitude reload
41 1 Holger Just
</pre>
42 1 Holger Just
43 1 Holger Just
Next we are going to instruct APT to prefer the current Debian stable release over the backports packages. Additionally, we are pinning some packages from backports such that these are installed and preferred over the stable release versions.
44 1 Holger Just
45 1 Holger Just
<pre>
46 1 Holger Just
cat <<EOF > /etc/apt/preferences
47 1 Holger Just
Package: *
48 1 Holger Just
Pin: release o=Debian,a=stable
49 1 Holger Just
Pin-Priority: 101
50 1 Holger Just
51 1 Holger Just
Package: *
52 1 Holger Just
Pin: release a=lenny-backports
53 1 Holger Just
Pin-Priority: 1
54 1 Holger Just
55 1 Holger Just
Package: rubygems
56 1 Holger Just
Pin: release a=lenny-backports
57 1 Holger Just
Pin-Priority: 999
58 1 Holger Just
59 1 Holger Just
Package: rubygems1.8
60 1 Holger Just
Pin: release a=lenny-backports
61 1 Holger Just
Pin-Priority: 999
62 1 Holger Just
63 1 Holger Just
Package: rake
64 1 Holger Just
Pin: release a=lenny-backports
65 1 Holger Just
Pin-Priority: 999
66 1 Holger Just
67 1 Holger Just
Package: librack-ruby1.8
68 1 Holger Just
Pin: release a=lenny-backports
69 1 Holger Just
Pin-Priority: 999
70 1 Holger Just
EOF
71 1 Holger Just
</pre>