1
|
h1. Installing Redmine using an existing redmine DB + MySQL on CentOS 5
|
2
|
|
3
|
{{>toc}}
|
4
|
|
5
|
h2. Requirements:
|
6
|
|
7
|
* Ruby 1.8.7
|
8
|
* MySQL 4.1 or higher (recommended)
|
9
|
* openssl + openssl-devel
|
10
|
* zlib + zlib-devel
|
11
|
* Lighttpd
|
12
|
* fastcgi
|
13
|
* RubyGems
|
14
|
|
15
|
> # actionmailer (2.3.5)
|
16
|
> # actionpack (2.3.5)
|
17
|
> # activerecord (2.3.5)
|
18
|
> # activeresource (2.3.5)
|
19
|
> # activesupport (2.3.5)
|
20
|
> # cgi_multipart_eof_fix (2.5.0)
|
21
|
> # daemons (1.0.10)
|
22
|
> # fastthread (1.0.7)
|
23
|
> # fcgi (0.8.8)
|
24
|
> # gem_plugin (0.2.3)
|
25
|
> # mongrel (1.1.5)
|
26
|
> # mysql (2.8.1)
|
27
|
> # rack (1.0.1)
|
28
|
> # rails (2.3.5)
|
29
|
> # rake (0.8.7)
|
30
|
> # rmagick (2.0.0)
|
31
|
|
32
|
Lets install all required packages before compiling ruby.
|
33
|
|
34
|
h2. Add rpmforge to depots
|
35
|
|
36
|
<pre>
|
37
|
yum install wget
|
38
|
rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
|
39
|
wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
|
40
|
rpm -ihv rpmforge-release-0.3.6-1.el5.rf.i386.rpm
|
41
|
</pre>
|
42
|
|
43
|
Now we will have the latest software that is not updated on official repos.
|
44
|
|
45
|
h2. Installing all required software from repos:
|
46
|
|
47
|
<pre>
|
48
|
yum install gcc-c++ mysql-server mysql-devel openssl openssl-devel zlib zlib-devel subversion make
|
49
|
</pre>
|
50
|
|
51
|
h2. Start mysql server and change the pasword for user root in mysql (by default its empty):
|
52
|
|
53
|
<pre>
|
54
|
service mysqld start
|
55
|
mysqladmin -u root password newpassword
|
56
|
chkconfig mysqld on
|
57
|
</pre>
|
58
|
|
59
|
Now we should be ready for ruby installation.
|
60
|
|
61
|
h2. Installing Ruby:
|
62
|
|
63
|
<pre>
|
64
|
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
|
65
|
tar zxvf ruby-1.8.7.tar.gz
|
66
|
cd ruby-1.8.7
|
67
|
./configure
|
68
|
make && make install
|
69
|
</pre>
|
70
|
|
71
|
h2. Installing RubyGems:
|
72
|
|
73
|
<pre>
|
74
|
wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
|
75
|
tar zxvf rubygems-1.3.5.tgz
|
76
|
cd rubygems-1.3.5
|
77
|
ruby setup.rb
|
78
|
</pre>
|
79
|
|
80
|
h2. Installing Rails:
|
81
|
|
82
|
<pre>
|
83
|
gem install rails -v=2.3.5
|
84
|
</pre>
|
85
|
|
86
|
h2. Installing Redmine:
|
87
|
|
88
|
<pre>
|
89
|
useradd -M redmine # doesn't create home directory
|
90
|
|
91
|
cd /opt
|
92
|
svn co http://redmine.rubyforge.org/svn/trunk redmine
|
93
|
mkdir /opt/redmine/public/plugin_assets
|
94
|
chown -R redmine:redmine /opt/redmine/public/plugin_assets
|
95
|
cd redmine
|
96
|
chown -R redmine:redmine files log tmp
|
97
|
chmod -R 755 files log tmp
|
98
|
</pre>
|
99
|
|
100
|
h2. Create Database and give access rights
|
101
|
|
102
|
<pre>
|
103
|
mysql -u root -p
|
104
|
create database redmine character set utf8;
|
105
|
create user 'redmine'@'localhost' identified by 'my_password';
|
106
|
grant all privileges on redmine.* to 'redmine'@'localhost';
|
107
|
</pre>
|
108
|
|
109
|
h2. Migrate configuration files:
|
110
|
|
111
|
<pre>
|
112
|
cp /opt/redmine/config/database.yml.example /opt/redmine/config/database.yml
|
113
|
|
114
|
# /opt/redmine/config/database.yml
|
115
|
production:
|
116
|
adapter: mysql
|
117
|
database: redmine
|
118
|
host: localhost
|
119
|
username: redmine
|
120
|
password: mysql_password
|
121
|
encoding: utf8
|
122
|
|
123
|
cp /opt/redmine/config/email.yml.example /opt/redmine/config/email.yml
|
124
|
|
125
|
# /opt/redmine/config/email.yml
|
126
|
production:
|
127
|
delivery_method: :smtp
|
128
|
smtp_settings:
|
129
|
address: 127.0.0.1
|
130
|
port: 25
|
131
|
domain: mail_server_domain
|
132
|
authentication: :none
|
133
|
|
134
|
|
135
|
|
136
|
</pre>
|
137
|
|
138
|
h2. Generate a session store secret:
|
139
|
|
140
|
<pre>
|
141
|
cd /opt/redmine
|
142
|
rake config/initializers/session_store.rb
|
143
|
</pre>
|
144
|
|
145
|
h2. Migrate or Install Database :
|
146
|
|
147
|
<pre>
|
148
|
gem install mysql
|
149
|
On projects : mysqldump --single-transaction --add-drop-table -u root -p redmine | gzip -9 > redmine.sql.gz
|
150
|
On new redmine :
|
151
|
gunzip redmine.sql.gz
|
152
|
mysql -u root -p redmine < redmine.sql
|
153
|
|
154
|
# upgrade the migrated database for the new version
|
155
|
RAILS_ENV=production rake db:migrate
|
156
|
# you will now see the upgrades appear on the screen
|
157
|
# IF INSTALLING FOR FIRST TIME USE
|
158
|
RAILS_ENV=production rake redmine:load_default_data
|
159
|
|
160
|
</pre>
|
161
|
|
162
|
h2. Migrate Files if there are any :
|
163
|
|
164
|
<pre>
|
165
|
On projects : cd /opt/redmine/files
|
166
|
tar -czf /root/files.tar.gz /opt/redmine/files/*
|
167
|
On new redmine :
|
168
|
cp /root/migration/files.tar.gz /opt/redmine/files/
|
169
|
tar -zxvf files.tar.gz
|
170
|
</pre>
|
171
|
|
172
|
h2. Test Server :
|
173
|
|
174
|
h3. On new redmine :
|
175
|
|
176
|
<pre>
|
177
|
cd /opt/redmine
|
178
|
ruby script/server webrick -p 8000 -e production
|
179
|
</pre>
|
180
|
|
181
|
h3. on a local machine
|
182
|
|
183
|
<pre>
|
184
|
http://redmine_server_ip_address:8000/
|
185
|
Login with your current redmine identification, the ldap is already installed
|
186
|
|
187
|
# Configure ldap authentication
|
188
|
Administration
|
189
|
LDAP Authentication
|
190
|
New authentication mode
|
191
|
Name ldap_ServerName
|
192
|
Host ldap_server_ip_address
|
193
|
Port 389
|
194
|
Account cn=ldapuser,o=ldapOrganization
|
195
|
Password xxxxxxxxxxxx
|
196
|
Base DN o=ldapOrganization
|
197
|
On-the-fly user creation # check this if you want users to be added to redmine when the user logs in, check this
|
198
|
|
199
|
|
200
|
|
201
|
On new redmine :
|
202
|
Stop webrick with CTRL-C
|
203
|
</pre>
|
204
|
|
205
|
h2. Install lighttpd
|
206
|
|
207
|
|
208
|
h3. Install packages from Centos
|
209
|
|
210
|
<pre>
|
211
|
yum install lighttpd lighttpd-fastcgi php-cli
|
212
|
|
213
|
vi /etc/php.ini
|
214
|
[...]
|
215
|
cgi.fix_pathinfo = 1
|
216
|
</pre>
|
217
|
|
218
|
h3. Install FastCGI Gem
|
219
|
|
220
|
<pre>
|
221
|
cd /tmp
|
222
|
wget http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz
|
223
|
tar -zxvf fcgi-2.4.0.tar.gz
|
224
|
cd fcgi-2.4.0
|
225
|
./configure --prefix=/usr/local/fcgi --exec-prefix=/usr/local/fcgi
|
226
|
make
|
227
|
make install
|
228
|
|
229
|
gem install fcgi -r -- --with-fcgi-lib=/usr/local/fcgi/lib --with-fcgi-include=/usr/local/fcgi/include
|
230
|
|
231
|
</pre>
|
232
|
|
233
|
h3. Set Permissions & Create Log Directories
|
234
|
|
235
|
<pre>
|
236
|
chown redmine:redmine -R /var/log/lighttpd
|
237
|
mkdir /var/log/redmine
|
238
|
chown redmine:redmine -R /var/log/redmine
|
239
|
</pre>
|
240
|
|
241
|
h3. Enable dispatch.fgci
|
242
|
|
243
|
<pre>
|
244
|
cd /opt/redmine
|
245
|
cp dispatch.fcgi.example dispatch.fcgi
|
246
|
chown redmine:redmine -R /opt/redmine/public/plugin_assets
|
247
|
</pre>
|
248
|
|
249
|
|
250
|
|
251
|
h2. Lighttpd vhost
|
252
|
|
253
|
<pre>
|
254
|
$HTTP["host"] =~ "redmine\.somecompany\.(eu|fr|net|com)$" {
|
255
|
server.document-root = "/opt/redmine/public/"
|
256
|
server.use-ipv6 = "disable"
|
257
|
fastcgi.debug = 1
|
258
|
alias.url = ()
|
259
|
server.indexfiles = ( "dispatch.fcgi" )
|
260
|
server.error-handler-404 = "/dispatch.fcgi"
|
261
|
server.errorlog = "/var/log/redmine/redmine-error.log"
|
262
|
accesslog.filename = "/var/log/redmine/redmine-access.log"
|
263
|
server.follow-symlink = "enable"
|
264
|
|
265
|
url.rewrite-once = (
|
266
|
"^/(.*\..+(?!html))$" => "$0",
|
267
|
"^/(.*)\.(.*)" => "$0",
|
268
|
)
|
269
|
|
270
|
fastcgi.server = (
|
271
|
".fcgi" => ( "redmine" => (
|
272
|
"socket" => "/opt/redmine/tmp/sockets/redmine.socket",
|
273
|
"bin-path" => "/usr/local/bin/ruby /opt/redmine/public/dispatch.fcgi",
|
274
|
"min-procs" => 1,
|
275
|
"max-procs" => 4,
|
276
|
"idle-timeout" => 120,
|
277
|
"check-local" => "disable",
|
278
|
"bin-environment" => ( "RAILS_ENV" => "production" ),
|
279
|
))
|
280
|
)
|
281
|
}
|
282
|
</pre>
|
283
|
|
284
|
h2. Test the lighttpd configuration
|
285
|
|
286
|
<pre>
|
287
|
|
288
|
[root@projects ~]# lighttpd -t -f /etc/lighttpd/lighttpd.conf
|
289
|
Syntax OK
|
290
|
|
291
|
</pre>
|
292
|
|
293
|
h2. Install the init script
|
294
|
|
295
|
<pre>
|
296
|
cp /etc/init.d/lighttpd /etc/init.d/redmine
|
297
|
chkconfig redmine on
|
298
|
</pre>
|
299
|
|
300
|
|
301
|
h2. Start the redmine server
|
302
|
|
303
|
/etc/init.d/redmine start
|
304
|
|
305
|
|
306
|
h2. Install ImageMagick
|
307
|
|
308
|
<pre>
|
309
|
yum install tcl-devel libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel
|
310
|
cd /root/source
|
311
|
wget http://image_magick.veidrodis.com/image_magick/ImageMagick-6.3.2-9.tar.gz
|
312
|
|
313
|
tar -zxvf ImageMagick-6.3.2-9.tar.gz
|
314
|
cd ImageMagick-6.3.2
|
315
|
./configure --prefix=/usr/local --with-bzlib=yes --with-fontconfig=yes --with-freetype=yes --with-gslib=yes
|
316
|
--with-gvc=yes --with-jpeg=yes --with-jp2=yes --with-png=yes --with-tiff=yes
|
317
|
make clean
|
318
|
make
|
319
|
make install
|
320
|
gem install rmagick -v=2.0 --no-rdoc --no-ri
|
321
|
</pre>
|
322
|
|
323
|
h2. Install the redmine basecamp theme
|
324
|
|
325
|
<pre>
|
326
|
mkdir /opt/redmine.old/public/themes/basecamp
|
327
|
mv basecamp.tar.gz basecamp
|
328
|
cd /opt/redmine.old/public/themes/basecamp/
|
329
|
tar -zxvf basecamp.tar.gz
|
330
|
mkdir -p /opt/redmine/public/themes/basecamp
|
331
|
cp -Rp stylesheets /opt/redmine/public/themes/basecamp/
|
332
|
</pre>
|
333
|
|
334
|
h2. Install postfix
|
335
|
|
336
|
|
337
|
<pre>
|
338
|
yum install postfix
|
339
|
/etc/postfix/main.cf
|
340
|
relayhost = smtp_server_address:smtp port
|
341
|
chkconfig postfix on
|
342
|
/etc/init.d/postfix start
|
343
|
Add the public address as a host in the networks table on proxmox
|
344
|
</pre>
|
345
|
|
346
|
|
347
|
|
348
|
|