Project

General

Profile

InstallRedmineOnDebianStableApacheMysqlPassenger » History » Version 25

Anonymous, 2015-07-17 08:09

1 4 Jan Niggemann (redmine.org team member)
h1. Preface
2 1 Jan Niggemann (redmine.org team member)
3 25 Anonymous
Last updated: 17 Jun 2015
4 9 Jan Niggemann (redmine.org team member)
5 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
6
*Deutsche Version* unter http://files.hz6.de/redmine/InstallingRedmine_DE.pdf
7 1 Jan Niggemann (redmine.org team member)
8 4 Jan Niggemann (redmine.org team member)
*After reading this guide you should have a working redmine instance*.
9
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@.
10
If this guide has issues, please "contact me":http://www.redmine.org/users/55460 or correct it yourself.
11
12 3 Jan Niggemann (redmine.org team member)
h2. About this guide
13 1 Jan Niggemann (redmine.org team member)
14 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).
15 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.
16 10 Jan Niggemann (redmine.org team member)
To keep this guide short, it does not explain every step in detail.
17 1 Jan Niggemann (redmine.org team member)
18 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.*
19 3 Jan Niggemann (redmine.org team member)
20 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.
21
22 3 Jan Niggemann (redmine.org team member)
h1. Chapter 1: Install ruby, rails, gems and passenger
23 1 Jan Niggemann (redmine.org team member)
24
{{collapse(Read chapter 1)
25
26
h2. 1.1 Prepare your system
27
28 19 Maik Nergert
<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</pre>
29 1 Jan Niggemann (redmine.org team member)
30
h2. 1.2 download, build and install ruby
31
32 4 Jan Niggemann (redmine.org team member)
<pre>cd ~
33 23 Jan Niggemann (redmine.org team member)
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p547.tar.gz
34
tar xvfz ruby-1.9.3-p547.tar.gz
35
cd ruby-1.9.3-p547
36 1 Jan Niggemann (redmine.org team member)
./configure --enable-pthread --prefix=/usr/local
37 8 Jan Niggemann (redmine.org team member)
make && checkinstall --type=debian --install=yes --fstrans=no --pakdir='~'</pre>
38 1 Jan Niggemann (redmine.org team member)
39
h2. 1.3 check if ruby works
40
41 23 Jan Niggemann (redmine.org team member)
Expected output: @ruby 1.9.3p547 (2013-06-27 revision 41675) [i686-linux]@
42 1 Jan Niggemann (redmine.org team member)
<pre>ruby –v</pre>
43
44
h2. 1.4 make ruby support OpenSSL
45
46 4 Jan Niggemann (redmine.org team member)
<pre>cd ext/openssl/
47 1 Jan Niggemann (redmine.org team member)
ruby extconf.rb
48 8 Jan Niggemann (redmine.org team member)
make && checkinstall --type=debian --install=yes --fstrans=no --pakdir='~'</pre>
49 1 Jan Niggemann (redmine.org team member)
50
h2. 1.5 gem installed?
51
52 4 Jan Niggemann (redmine.org team member)
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@:
53 1 Jan Niggemann (redmine.org team member)
<pre>gem -v</pre>
54 11 Jan Niggemann (redmine.org team member)
We can now install rdoc:
55
<pre>gem install rdoc</pre>
56 1 Jan Niggemann (redmine.org team member)
57
h2. 1.6 install rails
58
59 22 Jan Niggemann (redmine.org team member)
<pre>gem install rails --no-ri --no-rdoc</pre>
60 11 Jan Niggemann (redmine.org team member)
Note: You may be getting the error message _"no such file to load --zlib (LoadError)"_. In this case
61
you need to install zlib first:
62 23 Jan Niggemann (redmine.org team member)
<pre>cd ruby-1.9.3-p547/ext/zlib/
63 11 Jan Niggemann (redmine.org team member)
ruby extconf.rb
64
make
65
make install</pre>
66 1 Jan Niggemann (redmine.org team member)
67
h2. 1.7 install passenger (application server)
68
69
<pre>gem install passenger
70
passenger-install-apache2-module</pre>
71
72
h2. 1.8 configure apache
73
74 4 Jan Niggemann (redmine.org team member)
Put this in @/etc/apache/mods-available/passenger.load@ (remember to adjust the paths if necessary).
75 23 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>
76 1 Jan Niggemann (redmine.org team member)
77 4 Jan Niggemann (redmine.org team member)
And put this in @/etc/apache/mods-available/passenger.conf@ (remember to adjust the paths if necessary).
78 23 Jan Niggemann (redmine.org team member)
<pre>PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-4.0.46
79 1 Jan Niggemann (redmine.org team member)
PassengerRuby /usr/local/bin/ruby
80
PassengerDefaultUser www-data</pre>
81
82
83
h2. 1.9 activate module
84
85 3 Jan Niggemann (redmine.org team member)
<pre>a2enmod passenger</pre>
86
87
}}
88 2 Jan Niggemann (redmine.org team member)
89 1 Jan Niggemann (redmine.org team member)
h1. Chapter 2: Install redmine
90 2 Jan Niggemann (redmine.org team member)
91 1 Jan Niggemann (redmine.org team member)
{{collapse(Read chapter 2)
92 2 Jan Niggemann (redmine.org team member)
93
h2. 2.1 download redmine
94
95 4 Jan Niggemann (redmine.org team member)
Get latest zip from "here":http://rubyforge.org/frs/?group_id=1850 and unpack to /opt/redmine
96 2 Jan Niggemann (redmine.org team member)
97
h2. 2.2 further prepare the system
98
99 16 Jan Niggemann (redmine.org team member)
Note: Installing @libmagickwand-dev@ installs a lot of packages (depends / recommends)
100 18 Andrew Tropin
Note: If you have bundle install error then you may try to purge, then install *-dev packages
101 19 Maik Nergert
<pre>gem install bundler mysql2
102 18 Andrew Tropin
apt-get install libmagickwand-dev libmysqlclient-dev
103 4 Jan Niggemann (redmine.org team member)
cd /opt/redmine
104 2 Jan Niggemann (redmine.org team member)
bundle install --without postgresql</pre>
105
106 4 Jan Niggemann (redmine.org team member)
h2. 2.3 create database
107 2 Jan Niggemann (redmine.org team member)
108
<pre>create database redmine character set utf8;
109
create user 'redmine'@'localhost' identified by 'XXX';
110
grant all privileges on redmine.* to 'redmine'@'localhost';
111 4 Jan Niggemann (redmine.org team member)
</pre>
112 1 Jan Niggemann (redmine.org team member)
113
114
h2. 2.4 configure DB-connection
115
116
Put this in /opt/redmine/config/database.yml
117 2 Jan Niggemann (redmine.org team member)
<pre>production:
118 6 Jan Niggemann (redmine.org team member)
  adapter: mysql2
119
  database: redmine
120
  host: localhost
121
  username: redmine
122
  password: XXX</pre>
123 2 Jan Niggemann (redmine.org team member)
124
h2. 2.5 generate a session store secret
125 1 Jan Niggemann (redmine.org team member)
126
<pre>rake generate_secret_token</pre>
127
128
h2. 2.6 prepare database / create tables
129
130
<pre>RAILS_ENV=production rake db:migrate</pre>
131 2 Jan Niggemann (redmine.org team member)
132 1 Jan Niggemann (redmine.org team member)
h2. 2.7 set filesystem permissions
133
134 4 Jan Niggemann (redmine.org team member)
<pre>cd /opt/redmine
135
mkdir tmp tmp/pdf public/plugin_assets
136
chown -R www-data:www-data files log tmp public/plugin_assets
137
chmod -R 755 files log tmp public/plugin_assets
138
</pre>
139 1 Jan Niggemann (redmine.org team member)
140
h2. 2.8 test if it works
141 4 Jan Niggemann (redmine.org team member)
142 24 Anonymous
Redmine 2.x.x
143 5 Jan Niggemann (redmine.org team member)
<pre>ruby script/rails server webrick -e production</pre>
144 24 Anonymous
145
Redmine 3.x.x
146
<pre>bundle exec rails server webrick -e production</pre>
147
148 3 Jan Niggemann (redmine.org team member)
Now go to http://localhost:3000 and see redmine in action.
149
150
}}
151
152
h1. Chapter 3: Configure apache and passenger
153
154
In this guide, we deploy to a sub-URI. Read other guides if you want a name-based virtual host configuration.
155
156
{{collapse(Read chapter 3)
157 1 Jan Niggemann (redmine.org team member)
158 3 Jan Niggemann (redmine.org team member)
h2. 3.1 Configure apache (subURI deployment)
159 4 Jan Niggemann (redmine.org team member)
160 3 Jan Niggemann (redmine.org team member)
<pre>ln -s /opt/redmine/public /var/www/redmine</pre>
161 4 Jan Niggemann (redmine.org team member)
162 3 Jan Niggemann (redmine.org team member)
Put this in @/etc/apache2/sites-available/redmine@
163 20 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_.
164 4 Jan Niggemann (redmine.org team member)
<pre>
165 1 Jan Niggemann (redmine.org team member)
<Location /redmine>
166 3 Jan Niggemann (redmine.org team member)
		RailsEnv production
167 19 Maik Nergert
		RackBaseURI /redmine
168
		Options -MultiViews
169 4 Jan Niggemann (redmine.org team member)
</Location>
170 3 Jan Niggemann (redmine.org team member)
</pre>
171 4 Jan Niggemann (redmine.org team member)
172
Restart apache, test if http://yourhost.com/redmine is working, rejoice if it is :-)
173
174
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@.
175 3 Jan Niggemann (redmine.org team member)
176 1 Jan Niggemann (redmine.org team member)
}}