Project

General

Profile

HowTo Install Redmine 210 on Debian Squeeze with Apache Passenger » History » Version 2

Jonas Halbe, 2013-05-10 16:20

1 1 Yannick Warnier
h1. HowTo Install Redmine 210 on Debian Squeeze with Apache Passenger
2
3
_This manual was originally posted here: http://beeznest.wordpress.com/2012/09/20/installing-redmine-2-1-on-debian-squeeze-with-apache-modpassenger/_
4
5
This article is co-authored by Jérôme Warnier, from work mostly done by him with my occasional support. Kudos go to him.
6
7
We couldn't find any valuable manual to install Redmine 2.1 on Debian Squeeze, and we sure met a lot of resistance along the way, so we came up with the following step-by-step guide...
8
9
h2. Assumptions
10
11
We take as given that:
12
13
* We are using a Debian Squeeze installation
14
* We have root access to this machine
15
* There is public access to the machine itself (public IP)
16
* We are able to define a public domain (or subdomain) name for this Redmine installation
17
* We have access to define a database (we chose MySQL) user for Redmine (this is important to avoid security risks in sharing accounts with another web system). We also assume that we already have a MySQL server installation
18
* We will be using Apache 2's modPassenger (and Apache 2 is already installed on the server)
19
* We will be using redmine.example.com; so every time you see this below, replace it by your own domain
20
21
h2. Warming up
22
23
We will first need to install basic packages:
24
<pre>
25
apt-get install ruby rubygems libruby libapache2-mod-passenger
26
</pre>
27
Download the latest version of Redmine (2.1.0 in our case) and untar it, then move it to /usr/local/share
28
<pre>
29
ln /usr/local/share/redmine-2.1.0 /usr/local/share/redmine
30
chown -R root:root /usr/local/share/redmine-2.1.0
31
</pre>
32
33
Install development libraries for MySQL:
34
<pre>
35
apt-get install libmysqlclient-dev
36
</pre>
37
38
Install development libs for Imagick:
39
<pre>
40
apt-get install libmagickcore-dev libmagickwand-dev (install shitload of packages)
41
</pre>
42
43
h2. Running the Gem stuff
44
45
Install Bundler (removing useless module, which would otherwise create dependencies):
46
<pre>
47
gem install bundler
48
cd /usr/local/share/redmine/
49
/var/lib/gems/1.8/bin/bundle install --without development test postgresql sqlite
50
</pre>
51
52
h2. Configuration
53
54
Copy config/database.yml.example to config/database.yml and edit this file in order to configure your database settings for "production" environment.
55
Example for a MySQL database using ruby1.8 or jruby:
56
<pre>
57
production:
58
  adapter: mysql
59
  database: redmine
60
  host: localhost
61
  username: redmine
62
  password: my_password
63
</pre>
64
65
Generate a session store secret:
66
<pre>
67
/var/lib/gems/1.8/bin/rake generate_secret_token
68
</pre>
69
70
Generate the database structure:
71
<pre>
72
RAILS_ENV=production /var/lib/gems/1.8/bin/rake db:migrate
73
</pre>
74
75
Generate default configuration data:
76
<pre>
77
RAILS_ENV=production /var/lib/gems/1.8/bin/rake redmine:load_default_data
78
</pre>
79
(using “es” for Spanish language in terminal prompt)
80
81
Setup config file in config/configuration.yml
82
83
Change database_ciphr_key: *******
84
<pre>
85
/var/lib/gems/1.8/bin/rake db:encrypt RAILS_ENV=production
86
</pre>
87
88
h2. Apache
89
90
Setup Apache’s VirtualHost config
91
92
<pre>
93
# 8080 in this case is because we use a reverse proxy before Apache. Otherwise simply use "*:80"
94
95
<VirtualHost *:8080>
96
 ServerName redmine.example.com
97
 DocumentRoot /usr/local/share/redmine/public
98
 <Directory /usr/local/share/redmine/public>
99
   AllowOverride all
100
   Options -MultiViews
101
 </Directory>
102
</VirtualHost>
103
</pre>
104
105
Once you enable this virtual host (a2ensite redmine.example.com) and reload Apache (/etc/init.d/apache2/reload), you should see your site running on http://redmine.example.com.
106
107 2 Jonas Halbe
If you can't create or edit Users, delete the chache folder in /opt/redmine 
108
109 1 Yannick Warnier
The default login/password is admin/admin (don't forget to change this).
110
111
h2. Sources of inspiration
112
113
We used the following resources as a starting point. Thanks to their respective authors.
114
115
* http://madpropellerhead.com/random/20100820-installing-redmine-on-debian-with-apache (outdated, for Lenny)
116
* http://www.redmine.org/projects/redmine/wiki/RedmineInstall
117
* http://hodza.net/2012/03/15/howto-install-redmine-on-debian-6-squeeze-ruby-on-rails-apache2-passenger/
118
* http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Debian_with_Ruby-on-Rails_and_Apache2-Passenger