Project

General

Profile

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

Евгений Греков, 2014-04-08 13:59
need ruby-dev

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 7 Евгений Греков
apt-get install ruby ruby-dev rubygems libruby libapache2-mod-passenger
26 1 Yannick Warnier
</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 6 Knut Krüger
#maybe you have to use
54 5 Knut Krüger
/var/lib/gems/1.8/bin/bundle install --without development test postgresql sqlite
55 1 Yannick Warnier
</pre>
56
57
h2. Configuration
58
59 3 Yovav Cohen Tene
Open a mysql session
60
<pre>
61
 CREATE DATABASE redmine CHARACTER SET utf8;
62
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'my_password';
63
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
64 4 Yovav Cohen Tene
</pre>
65 3 Yovav Cohen Tene
66 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.
67 3 Yovav Cohen Tene
<pre>
68
mv config/database.yml.example config/database.yml
69
</pre>
70 1 Yannick Warnier
Example for a MySQL database using ruby1.8 or jruby:
71
<pre>
72
production:
73
  adapter: mysql
74
  database: redmine
75
  host: localhost
76
  username: redmine
77
  password: my_password
78
</pre>
79
80
Generate a session store secret:
81
<pre>
82 3 Yovav Cohen Tene
rake generate_secret_token
83 1 Yannick Warnier
</pre>
84
85
Generate the database structure:
86
<pre>
87 3 Yovav Cohen Tene
RAILS_ENV=production rake db:migrate
88 1 Yannick Warnier
</pre>
89
90
Generate default configuration data:
91
<pre>
92 3 Yovav Cohen Tene
RAILS_ENV=production rake redmine:load_default_data
93 1 Yannick Warnier
</pre>
94
(using “es” for Spanish language in terminal prompt)
95
96
Setup config file in config/configuration.yml
97
98
Change database_ciphr_key: *******
99
<pre>
100 3 Yovav Cohen Tene
rake db:encrypt RAILS_ENV=production
101 1 Yannick Warnier
</pre>
102
103
h2. Apache
104
105
Setup Apache’s VirtualHost config
106 3 Yovav Cohen Tene
<pre>
107
vim /etc/apache/site-available/redmine.example.com
108
</pre>
109
and insert the following text:
110 1 Yannick Warnier
<pre>
111
# 8080 in this case is because we use a reverse proxy before Apache. Otherwise simply use "*:80"
112
113
<VirtualHost *:8080>
114
 ServerName redmine.example.com
115
 DocumentRoot /usr/local/share/redmine/public
116
 <Directory /usr/local/share/redmine/public>
117
   AllowOverride all
118
   Options -MultiViews
119
 </Directory>
120
</VirtualHost>
121
</pre>
122
123
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.
124
125 2 Jonas Halbe
If you can't create or edit Users, delete the chache folder in /opt/redmine 
126
127 1 Yannick Warnier
The default login/password is admin/admin (don't forget to change this).
128
129
h2. Sources of inspiration
130
131
We used the following resources as a starting point. Thanks to their respective authors.
132
133
* http://madpropellerhead.com/random/20100820-installing-redmine-on-debian-with-apache (outdated, for Lenny)
134
* http://www.redmine.org/projects/redmine/wiki/RedmineInstall
135
* http://hodza.net/2012/03/15/howto-install-redmine-on-debian-6-squeeze-ruby-on-rails-apache2-passenger/
136
* http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Debian_with_Ruby-on-Rails_and_Apache2-Passenger