Project

General

Profile

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

Yovav Cohen Tene, 2013-07-13 13:37

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 3 Yovav Cohen Tene
wget http://rubyforge.org/frs/download.php/76448/redmine-2.1.0.tar.gz
30
tar -xvf redmine-2.1.0.tar.gz
31
mv redmine-2.1.0 /usr/local/share/redmine-2.1.0
32
ln -s /usr/local/share/redmine-2.1.0 /usr/local/share/redmine
33 1 Yannick Warnier
chown -R root:root /usr/local/share/redmine-2.1.0
34
</pre>
35
36
Install development libraries for MySQL:
37
<pre>
38
apt-get install libmysqlclient-dev
39
</pre>
40
41
Install development libs for Imagick:
42
<pre>
43
apt-get install libmagickcore-dev libmagickwand-dev (install shitload of packages)
44
</pre>
45
46
h2. Running the Gem stuff
47
48
Install Bundler (removing useless module, which would otherwise create dependencies):
49
<pre>
50
gem install bundler
51
cd /usr/local/share/redmine/
52 3 Yovav Cohen Tene
bundle install --without development test postgresql sqlite
53 1 Yannick Warnier
</pre>
54
55
h2. Configuration
56
57 3 Yovav Cohen Tene
Open a mysql session
58
<pre>
59
 CREATE DATABASE redmine CHARACTER SET utf8;
60
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';
61
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
62 4 Yovav Cohen Tene
</pre>
63 3 Yovav Cohen Tene
64 1 Yannick Warnier
Copy config/database.yml.example to config/database.yml and edit this file in order to configure your database settings for "production" environment.
65 3 Yovav Cohen Tene
<pre>
66
mv config/database.yml.example config/database.yml
67
</pre>
68 1 Yannick Warnier
Example for a MySQL database using ruby1.8 or jruby:
69
<pre>
70
production:
71
  adapter: mysql
72
  database: redmine
73
  host: localhost
74
  username: redmine
75
  password: my_password
76
</pre>
77
78
Generate a session store secret:
79
<pre>
80 3 Yovav Cohen Tene
rake generate_secret_token
81 1 Yannick Warnier
</pre>
82
83
Generate the database structure:
84
<pre>
85 3 Yovav Cohen Tene
RAILS_ENV=production rake db:migrate
86 1 Yannick Warnier
</pre>
87
88
Generate default configuration data:
89
<pre>
90 3 Yovav Cohen Tene
RAILS_ENV=production rake redmine:load_default_data
91 1 Yannick Warnier
</pre>
92
(using “es” for Spanish language in terminal prompt)
93
94
Setup config file in config/configuration.yml
95
96
Change database_ciphr_key: *******
97
<pre>
98 3 Yovav Cohen Tene
rake db:encrypt RAILS_ENV=production
99 1 Yannick Warnier
</pre>
100
101
h2. Apache
102
103
Setup Apache’s VirtualHost config
104 3 Yovav Cohen Tene
<pre>
105
vim /etc/apache/site-available/redmine.example.com
106
</pre>
107
and insert the following text:
108 1 Yannick Warnier
<pre>
109
# 8080 in this case is because we use a reverse proxy before Apache. Otherwise simply use "*:80"
110
111
<VirtualHost *:8080>
112
 ServerName redmine.example.com
113
 DocumentRoot /usr/local/share/redmine/public
114
 <Directory /usr/local/share/redmine/public>
115
   AllowOverride all
116
   Options -MultiViews
117
 </Directory>
118
</VirtualHost>
119
</pre>
120
121
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.
122
123 2 Jonas Halbe
If you can't create or edit Users, delete the chache folder in /opt/redmine 
124
125 1 Yannick Warnier
The default login/password is admin/admin (don't forget to change this).
126
127
h2. Sources of inspiration
128
129
We used the following resources as a starting point. Thanks to their respective authors.
130
131
* http://madpropellerhead.com/random/20100820-installing-redmine-on-debian-with-apache (outdated, for Lenny)
132
* http://www.redmine.org/projects/redmine/wiki/RedmineInstall
133
* http://hodza.net/2012/03/15/howto-install-redmine-on-debian-6-squeeze-ruby-on-rails-apache2-passenger/
134
* http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Debian_with_Ruby-on-Rails_and_Apache2-Passenger