Project

General

Profile

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

Jack Kurzecki, 2009-12-29 04:41
updated with information for deployment of Redmine 0.9 (revision >= r3235)

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