Project

General

Profile

InstallRedmineOnDebianStableApacheMysqlPassenger » History » Version 29

Peter Mueller, 2016-10-31 14:40

1 4 Jan Niggemann (redmine.org team member)
h1. Preface
2 1 Jan Niggemann (redmine.org team member)
3 29 Peter Mueller
Last updated: Oct. 31st, 2016 (Redmine 3.3 on Deb. 8 (64 Bits))
4 1 Jan Niggemann (redmine.org team member)
5 27 Peter Mueller
(only this Wiki was updated)
6
7 10 Jan Niggemann (redmine.org team member)
Download a PDF of the original document from my site: http://files.hz6.de/redmine/InstallingRedmine_EN.pdf
8
*Deutsche Version* unter http://files.hz6.de/redmine/InstallingRedmine_DE.pdf
9 1 Jan Niggemann (redmine.org team member)
10 4 Jan Niggemann (redmine.org team member)
*After reading this guide you should have a working redmine instance*.
11
If this is not the case or if a step fails, please post details on the forums and refer to this wiki page. Make sure to include the output of @gem env@ and / or @RAILS_ENV=production /opt/redmine/script/about@.
12
If this guide has issues, please "contact me":http://www.redmine.org/users/55460 or correct it yourself.
13
14 3 Jan Niggemann (redmine.org team member)
h2. About this guide
15 1 Jan Niggemann (redmine.org team member)
16 21 Jan Niggemann (redmine.org team member)
This is a step-by-step guide to install redmine on "Debian stable" (called Wheezy at the moment of writing).
17 3 Jan Niggemann (redmine.org team member)
It is written for people who are familiar with Debian, the shell, MySQL, Apache and Linux in general.
18 10 Jan Niggemann (redmine.org team member)
To keep this guide short, it does not explain every step in detail.
19 1 Jan Niggemann (redmine.org team member)
20 23 Jan Niggemann (redmine.org team member)
*The versions, filenames and paths in this document are subject to frequent change. I'll do my best to keep them up-to-date, but please check anyway.*
21 3 Jan Niggemann (redmine.org team member)
22 4 Jan Niggemann (redmine.org team member)
*%{color:red}Please note:%* I'm assuming that you know how to use the tools at hand. If that's not the case (eg. you don't know how to create a new database or you don't know how to restart apache) please use the search engine of your choice and come back afterwards.
23
24 3 Jan Niggemann (redmine.org team member)
h1. Chapter 1: Install ruby, rails, gems and passenger
25 1 Jan Niggemann (redmine.org team member)
26
{{collapse(Read chapter 1)
27
28
h2. 1.1 Prepare your system
29
30 28 Peter Mueller
<pre>apt-get install gcc build-essential zlib1g zlib1g-dev zlibc libzlib-ruby libssl-dev libyaml-dev libcurl4-openssl-dev apache2-mpm-prefork apache2-prefork-dev libapr1-dev libxslt-dev checkinstall
31
apt-get build-dep ruby
32
</pre>
33 1 Jan Niggemann (redmine.org team member)
34 23 Jan Niggemann (redmine.org team member)
h2. 1.2 download, build and install ruby
35 1 Jan Niggemann (redmine.org team member)
36 27 Peter Mueller
double check for compliance with here:
37
38
http://www.redmine.org/projects/redmine/wiki/RedmineInstall
39
40 1 Jan Niggemann (redmine.org team member)
<pre>cd ~
41 27 Peter Mueller
# wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p547.tar.gz
42
# tar xvfz ruby-1.9.3-p547.tar.gz
43
# cd ruby-1.9.3-p547
44
wget ftp://ftp.ruby-lang.org/pub/ruby/2.2/ruby-2.2.4.tar.gz
45
tar xvfz ruby-2.2.4.tar.gz
46
cd ruby-2.2.4
47 1 Jan Niggemann (redmine.org team member)
./configure --enable-pthread --prefix=/usr/local
48 27 Peter Mueller
</pre>
49 1 Jan Niggemann (redmine.org team member)
50 27 Peter Mueller
* read and check the output carefully :)
51
* add if needed missed packages
52
53
<pre>
54
make 
55
su
56
checkinstall --type=debian --install=yes --fstrans=no --pakdir='~'</pre>
57
58 1 Jan Niggemann (redmine.org team member)
h2. 1.3 check if ruby works
59
60
Expected output: @ruby 1.9.3p547 (2013-06-27 revision 41675) [i686-linux]@
61
<pre>ruby –v</pre>
62 4 Jan Niggemann (redmine.org team member)
63 1 Jan Niggemann (redmine.org team member)
h2. 1.4 make ruby support OpenSSL
64 8 Jan Niggemann (redmine.org team member)
65 1 Jan Niggemann (redmine.org team member)
<pre>cd ext/openssl/
66
ruby extconf.rb
67
make && checkinstall --type=debian --install=yes --fstrans=no --pakdir='~'</pre>
68 4 Jan Niggemann (redmine.org team member)
69 1 Jan Niggemann (redmine.org team member)
h2. 1.5 gem installed?
70 11 Jan Niggemann (redmine.org team member)
71
Ruby 1.9 comes with RubyGems by default, so by now @gem@ should be installed. If correctly installed, the following command will output a version number like @1.8.2x@:
72 1 Jan Niggemann (redmine.org team member)
<pre>gem -v</pre>
73
We can now install rdoc:
74
<pre>gem install rdoc</pre>
75
76
h2. 1.6 install rails
77
78 27 Peter Mueller
check with here:
79
80
https://rubygems.org/gems/rails/versions
81
http://www.redmine.org/projects/redmine/wiki/RedmineInstall
82
83
and force the version number (otherwise the latest version will be installed)
84
85
<pre>
86
#gem install rails --no-ri --no-rdoc
87
gem install rails -v=3.2.22 --no-ri --no-rdoc
88
</pre>
89 23 Jan Niggemann (redmine.org team member)
Note: You may be getting the error message _"no such file to load --zlib (LoadError)"_. In this case
90 11 Jan Niggemann (redmine.org team member)
you need to install zlib first:
91
<pre>cd ruby-1.9.3-p547/ext/zlib/
92
ruby extconf.rb
93 1 Jan Niggemann (redmine.org team member)
make
94
make install</pre>
95
96
h2. 1.7 install passenger (application server)
97
98
<pre>gem install passenger
99
passenger-install-apache2-module</pre>
100
101 4 Jan Niggemann (redmine.org team member)
h2. 1.8 configure apache
102 23 Jan Niggemann (redmine.org team member)
103 1 Jan Niggemann (redmine.org team member)
Put this in @/etc/apache/mods-available/passenger.load@ (remember to adjust the paths if necessary).
104 4 Jan Niggemann (redmine.org team member)
<pre>LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-4.0.46/ext/apache2/mod_passenger.so</pre>
105 23 Jan Niggemann (redmine.org team member)
106 1 Jan Niggemann (redmine.org team member)
And put this in @/etc/apache/mods-available/passenger.conf@ (remember to adjust the paths if necessary).
107
<pre>PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-4.0.46
108
PassengerRuby /usr/local/bin/ruby
109
PassengerDefaultUser www-data</pre>
110
111
112 3 Jan Niggemann (redmine.org team member)
h2. 1.9 activate module
113
114
<pre>a2enmod passenger</pre>
115 2 Jan Niggemann (redmine.org team member)
116 1 Jan Niggemann (redmine.org team member)
}}
117 2 Jan Niggemann (redmine.org team member)
118 1 Jan Niggemann (redmine.org team member)
h1. Chapter 2: Install redmine
119 2 Jan Niggemann (redmine.org team member)
120
{{collapse(Read chapter 2)
121
122 26 Jan Niggemann (redmine.org team member)
h2. 2.1 download redmine
123 2 Jan Niggemann (redmine.org team member)
124
Get latest zip from "here":http://www.redmine.org/projects/redmine/wiki/Download and unpack to /opt/redmine
125
126 16 Jan Niggemann (redmine.org team member)
h2. 2.2 further prepare the system
127 18 Andrew Tropin
128 19 Maik Nergert
Note: Installing @libmagickwand-dev@ installs a lot of packages (depends / recommends)
129 18 Andrew Tropin
Note: If you have bundle install error then you may try to purge, then install *-dev packages
130 4 Jan Niggemann (redmine.org team member)
<pre>gem install bundler mysql2
131 2 Jan Niggemann (redmine.org team member)
apt-get install libmagickwand-dev libmysqlclient-dev
132
cd /opt/redmine
133 4 Jan Niggemann (redmine.org team member)
bundle install --without postgresql</pre>
134 2 Jan Niggemann (redmine.org team member)
135
h2. 2.3 create database
136
137
<pre>create database redmine character set utf8;
138 4 Jan Niggemann (redmine.org team member)
create user 'redmine'@'localhost' identified by 'XXX';
139 1 Jan Niggemann (redmine.org team member)
grant all privileges on redmine.* to 'redmine'@'localhost';
140
</pre>
141
142
143
h2. 2.4 configure DB-connection
144 2 Jan Niggemann (redmine.org team member)
145 6 Jan Niggemann (redmine.org team member)
Put this in /opt/redmine/config/database.yml
146
<pre>production:
147
  adapter: mysql2
148
  database: redmine
149
  host: localhost
150 2 Jan Niggemann (redmine.org team member)
  username: redmine
151
  password: XXX</pre>
152 1 Jan Niggemann (redmine.org team member)
153
h2. 2.5 generate a session store secret
154
155
<pre>rake generate_secret_token</pre>
156
157
h2. 2.6 prepare database / create tables
158 2 Jan Niggemann (redmine.org team member)
159 1 Jan Niggemann (redmine.org team member)
<pre>RAILS_ENV=production rake db:migrate</pre>
160
161 4 Jan Niggemann (redmine.org team member)
h2. 2.7 set filesystem permissions
162
163
<pre>cd /opt/redmine
164
mkdir tmp tmp/pdf public/plugin_assets
165
chown -R www-data:www-data files log tmp public/plugin_assets
166 1 Jan Niggemann (redmine.org team member)
chmod -R 755 files log tmp public/plugin_assets
167
</pre>
168 4 Jan Niggemann (redmine.org team member)
169 24 Anonymous
h2. 2.8 test if it works
170 5 Jan Niggemann (redmine.org team member)
171 24 Anonymous
Redmine 2.x.x
172
<pre>ruby script/rails server webrick -e production</pre>
173
174
Redmine 3.x.x
175 3 Jan Niggemann (redmine.org team member)
<pre>bundle exec rails server webrick -e production</pre>
176
177
Now go to http://localhost:3000 and see redmine in action.
178
179
}}
180
181
h1. Chapter 3: Configure apache and passenger
182
183
In this guide, we deploy to a sub-URI. Read other guides if you want a name-based virtual host configuration.
184 1 Jan Niggemann (redmine.org team member)
185 3 Jan Niggemann (redmine.org team member)
{{collapse(Read chapter 3)
186 4 Jan Niggemann (redmine.org team member)
187 3 Jan Niggemann (redmine.org team member)
h2. 3.1 Configure apache (subURI deployment)
188 4 Jan Niggemann (redmine.org team member)
189 3 Jan Niggemann (redmine.org team member)
<pre>ln -s /opt/redmine/public /var/www/redmine</pre>
190 20 Jan Niggemann (redmine.org team member)
191 4 Jan Niggemann (redmine.org team member)
Put this in @/etc/apache2/sites-available/redmine@
192 1 Jan Niggemann (redmine.org team member)
Note: The option _RackBaseURI_ is for rails 3, in rails 2 it was called _RailsBaseURI_. It is in no case called _RakeBaseURI_.
193 3 Jan Niggemann (redmine.org team member)
<pre>
194 19 Maik Nergert
<Location /redmine>
195
		RailsEnv production
196 4 Jan Niggemann (redmine.org team member)
		RackBaseURI /redmine
197 3 Jan Niggemann (redmine.org team member)
		Options -MultiViews
198 4 Jan Niggemann (redmine.org team member)
</Location>
199
</pre>
200
201
Restart apache, test if http://yourhost.com/redmine is working, rejoice if it is :-)
202 3 Jan Niggemann (redmine.org team member)
203 1 Jan Niggemann (redmine.org team member)
If you see something unexpected, please post details on the forums and refer to this wiki page. Make sure to include the output of @gem env@ and / or @RAILS_ENV=production /opt/redmine/script/about@.
204
205
}}