Project

General

Profile

HowTo Install Redmine in a sub-URI on Windows with Apache » History » Version 1

Jack Kurzecki, 2009-12-14 09:24
Complete installation walkthrough - Zero-to-Redmine on Windows with Apache

1 1 Jack Kurzecki
h1. HowTo Install Redmine in a sub-URI on Windows with Apache
2
3
{{>toc}}
4
5
bq. Following the steps below exactly as listed will produce a working Redmine 0.8.7 installation hosted under http://localhost/redmine sub-URI on Windows XP/2003 x86/x64 with Apache HTTP Server 2.2.x, MySQL 5.1.x and Ruby 1.8.7. I was also able to get Redmine revision 3171 working by updating rails to version 2.3.4.  It took a lot of time to find all the pieces of information and put them together, so I hope this will especially help Windows users. Addtional tasks after this walkthrough could include: [[HowTo configure Redmine for advanced Subversion integration]].
6
7
h2. Install Apache HTTP server 2.2.x
8
9
# Download "Win32 Binary" with or without crypto (depending if you need SSL) from "here":http://httpd.apache.org/download.cgi
10
# Install to C:\webserver\apache
11
12
h2. Install MySQL 5.1.x
13
14
# Download "Windows Essentials (x86)" from "here":http://dev.mysql.com/downloads/mysql/5.1.html#win32
15
# Install to C:\webserver\MySQL
16
# (_optional:_) Set data files installation directory to C:\webserver\MySQLData
17
18
h2. Install MySQL GUI Tools for MySQL 5.0
19
20
# Download "Windows (x86) Installer" from "here":http://dev.mysql.com/downloads/gui-tools/5.0.html
21
# Install to C:\webserver\MySQL_GUI_Tools
22
23
h2. Install Ruby 1.8.7
24
25
* _At the time of writting this document the latest version of Ruby was 1.9.1 which does *NOT* work with Redmine_
26
* *Use Ruby version 1.8.7 only*.
27
* Since there is no installer package for 1.8.7, we will first install 1.8.6 then copy 1.8.7 binaries on top of it.
28
29
# Download "RubyInstaller 1.8.6.rc1" from "here":http://rubyforge.org/frs/?group_id=167
30
# Install to C:\webserver\ruby
31
# Open command window, then execue: <pre>
32
mkdir C:\webserver\railsapps
33
cd C:\webserver\railsapps
34
gem list
35
gem uninstall rails
36
gem uninstall actionmailer
37
gem uninstall actionpack
38
gem uninstall activerecord
39
gem uninstall activeresource
40
gem uninstall activesupport
41
</pre>
42
# Download "Ruby 1.8.7-p72 Binary" from "here":http://www.ruby-lang.org/en/downloads/
43
#* extract to C:\webserver\ruby overwritting the 1.8.6 version
44
#* _add "C:\webserver\ruby\bin" to your PATH environment variable if not already included_
45
# Download the zlib package from "here":http://www.zlib.net/zlib123-dll.zip
46
#* extract the zlib1.dll
47
#* rename it to zlib.dll
48
#* move it to C:\webserver\ruby\bin
49
# Download the iconv package from "here":http://sourceforge.net/project/showfiles.php?group_id=25167&package_id=51458
50
#* extract iconv.dll
51
#* move it to C:\webserver\ruby\bin
52
# Verify Ruby version
53
#* in command window, execute: <pre>
54
ruby -v
55
</pre>
56
#** expected output:<pre>
57
ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-mswin32]
58
</pre>
59
60
h2. Install RubyGems
61
62
* _At the time of writting this document the latest version of RubyGems was 1.3.5. Newer versions should work too._
63
64
# Download "rubygems-1.3.5.zip" from "here":http://rubyforge.org/frs/?group_id=126
65
#* extract the package to C:\webserver\railsapps
66
#* in command window, execute: <pre>
67
cd C:\webserver\railsapps\rubygems-1.3.5
68
ruby setup.rb
69
</pre>
70
#** expected output:<pre>
71
RubyGems 1.3.5 installed
72
</pre>
73
#* in command window, execute: <pre>
74
cd ..
75
gem update --system
76
</pre>
77
78
h2. Additional gems
79
80
_mongrel-service and win32-service gems have to be downloaded manually. Download locations are added to sections below._
81
82
h3. Install Rake
83
84
* _At the time of writting this document the latest version of Rake was 0.8.7. Newer versions should work too._
85
86
#* in command window, execute: <pre>
87
gem install rake</pre>
88
#** expected output:<pre>
89
Successfully installed rake-0.8.7
90
</pre>
91
92
h3. Install Rails
93
94
* _At the time of writting this document the latest version of Rails was 2.3.5 which does *NOT* work with Redmine_
95
* *Use Rails version 2.1.2 for Redmine 0.8.7 deployment.*
96
* _Use Rails version 2.3.4 for Redmine revision 2887+ deployment._
97
* _Procedure below assumes we will be installing Redmine 0.8.7_
98
99
#* in command window, execute: <pre>
100
gem install rails -v=2.1.2
101
</pre>
102
#** expected output:<pre>
103
Successfully installed activesupport-2.1.2
104
Successfully installed activerecord-2.1.2
105
Successfully installed actionpack-2.1.2
106
Successfully installed actionmailer-2.1.2
107
Successfully installed activeresource-2.1.2
108
Successfully installed rails-2.1.2
109
</pre>
110
111
h3. Install Mongrel
112
113
* _At the time of writting this document the latest version of Mongrel was 1.1.5. Newer versions should work too._
114
* "_Project page_":http://rubyforge.org/projects/mongrel/
115
116
#* in command window, execute: <pre>
117
gem install mongrel
118
</pre>
119
#** expected output:<pre>
120
Successfully installed gem_plugin-0.2.3
121
Successfully installed cgi_multipart_eof_fix-2.5.0
122
Successfully installed mongrel-1.1.5-x86-mswin32-60
123
</pre>
124
125
h3. Install mysql gem
126
127
* _At the time of writting this document the latest version of mysql gem was 2.8.1. Newer versions should work too._
128
* It drastically improves page generation speed.
129
130
#* in command window, execute: <pre>
131
gem install mysql
132
</pre>
133
#** expected output:<pre>
134
Successfully installed mysql-2.8.1
135
</pre>
136
137
h3. Install mongrel-service + win32-service gems
138
139
* _At the time of writting this document the latest version of win32-service was 0.7 which does *NOT* work with Ruby 1.8.7_
140
* *Use win32-service version 0.5.2 for Redmine 0.8.7 deployment.*
141
142
# Download mongrel-service 0.3.4 ("project page":http://rubyforge.org/frs/?group_id=1306)
143
# Move mongrel_service-0.3.4-i386-mswin32.gem to C:\webserver\railsapps
144
# Download win32-service 0.5.2 from "HERE":http://files.ruby.inoack.com/win32utils/win32-service-0.5.2-mswin32.gem
145
# Move win32-service-0.5.2-mswin32.gem to C:\webserver\railsapps
146
# Install the gem
147
#* in command window, execute: <pre>
148
cd C:\webserver\railsapps
149
gem install mongrel_service
150
</pre>
151
#** expected output:<pre>
152
Successfully installed gem win32-service-0.5.2-mswin32
153
Successfully installed gem mongrel_service-0.3.4-i386-mswin32
154
</pre>
155
156
157
h2. Install Redmine
158
159
* _Procedure below assumes we will be installing Redmine 0.8.7, but it also works with revision 3171+_
160
161
# Download "Redmine" from "here":http://rubyforge.org/frs/?group_id=1850
162
# Extract the archive to C:\webserver\railsapps\redmine
163
# Log into MySQL using GUI Tools as "root"
164
#* Open a new script tab and execute the following script: <pre>
165
create database redmine character set utf8;
166
create user 'redmine'@'localhost' identified by 'my_password';
167
grant all privileges on redmine.* to 'redmine'@'localhost';
168
</pre>
169
# Copy C:\webserver\railsapps\redmine\config\database.yml.example to C:\webserver\railsapps\redmine\config\database.yml
170
# Edit "config\database.yml" file in order to configure your database settings for "production" environment.
171
#* set hostname, username and password to the velues entered in the SQL script above.
172
#* save and close the file.
173
# Create default tables and populate with data
174
#* in command window, execute: <pre>
175
cd redmine
176
rake config\initializers\session_store.rb
177
set RAILS_ENV=production
178
rake db:migrate
179
rake redmine:load_default_data
180
</pre>
181
# _Procedure below assumes we will be hosting Redmine under http://localhost/redmine:_
182
# Edit "config\environment.rb" file in order to configure Redmine to work as a sub-URI (Apache configuration listed below).
183
#* add the following line at the bottom of the file:<pre>
184
Redmine::Utils::relative_url_root = "/redmine" 
185
</pre>
186
#* save and close the file.
187
188
h2. Setup windows services
189
190
# Create windows services
191
#* in command window, execute: <pre>
192
mongrel_rails service::install -N mongrel_redmine_3001 -D "Mongrel serving Redmine on 3001" -p 3001 -e production -c C:\webserver\railsapps\redmine
193
mongrel_rails service::install -N mongrel_redmine_3002 -D "Mongrel serving Redmine on 3002" -p 3002 -e production -c C:\webserver\railsapps\redmine
194
mongrel_rails service::install -N mongrel_redmine_3003 -D "Mongrel serving Redmine on 3003" -p 3003 -e production -c C:\webserver\railsapps\redmine
195
</pre>
196
# Start windows services, which in turn will start mongrel servers
197
#* in command window, execute: <pre>
198
net start mongrel_redmine_3001
199
net start mongrel_redmine_3002
200
net start mongrel_redmine_3003
201
</pre>
202
# Go to the Windows Services list and set all "Mongrel serving Redmine on 300#" services to start automatically
203
#* in command window, execute: <pre>
204
services.msc /s
205
</pre>
206
207
208
h2. Configure Apache 2.2.x as proxy to Mongrel cluster
209
210
* _Procedure below assumes we will be hosting Redmine under http://localhost/redmine:_
211
212
# Open C:\webserver\apache\conf\httpd.conf
213
# At the bottom of this file add the following line: <pre>
214
Include conf/httpd-proxy-mongrel.conf
215
</pre>
216
# Create a file C:\webserver\apache\conf\httpd-proxy-mongrel.conf
217
# Enter the following: <pre>
218
LoadModule proxy_module modules/mod_proxy.so
219
LoadModule proxy_http_module modules/mod_proxy_http.so
220
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
221
222
ProxyPass /redmine balancer://it_cluster
223
ProxyPassReverse /redmine balancer://it_cluster
224
225
226
<Proxy balancer://it_cluster>
227
	BalancerMember http://127.0.0.1:3001
228
	BalancerMember http://127.0.0.1:3002
229
	BalancerMember http://127.0.0.1:3003
230
</Proxy>
231
</pre>
232
# Restart the apache service.
233
234
235
236
237
*DONE!*
238
239
240
241
h3. Apendix
242
243
* Check if you have all the necessary gems installed for Redmine 0.8.7
244
** in command window, execute: <pre>
245
gem list
246
</pre>
247
#** expected output:<pre>
248
actionmailer (2.1.2)
249
actionpack (2.1.2)
250
activerecord (2.1.2)
251
activeresource (2.1.2)
252
activesupport (2.1.2)
253
cgi_multipart_eof_fix (2.5.0)
254
gem_plugin (0.2.3)
255
mongrel (1.1.5)
256
mongrel_service (0.3.4)
257
mysql (2.8.1)
258
rails (2.1.2)
259
rake (0.8.7)
260
win32-service (0.5.2)
261
</pre>
262
263
* Check if you have all the necessary gems installed for Redmine revision 2887+
264
** in command window, execute: <pre>
265
gem list
266
</pre>
267
#** expected output:<pre>
268
actionmailer (2.3.4)
269
actionpack (2.3.4)
270
activerecord (2.3.4)
271
activeresource (2.3.4)
272
activesupport (2.3.4)
273
cgi_multipart_eof_fix (2.5.0)
274
gem_plugin (0.2.3)
275
mongrel (1.1.5)
276
mongrel_service (0.3.4)
277
mysql (2.8.1)
278
rack (1.0.1)
279
rails (2.3.4)
280
rake (0.8.7)
281
win32-service (0.5.2)
282
</pre>