InstallRedmineOnDebianStableApacheMysqlPassenger » History » Version 3

Jan Niggemann (redmine.org team member), 2013-01-22 11:26

1 3 Jan Niggemann (redmine.org team member)
h1. InstallRedmineOnDebianStableApacheMysqlPassenger
2 1 Jan Niggemann (redmine.org team member)
3 3 Jan Niggemann (redmine.org team member)
Last updated: January 2012
4 1 Jan Niggemann (redmine.org team member)
5 3 Jan Niggemann (redmine.org team member)
h1. Chapter 0: Preface
6 1 Jan Niggemann (redmine.org team member)
7 3 Jan Niggemann (redmine.org team member)
h2. About this guide
8 3 Jan Niggemann (redmine.org team member)
9 3 Jan Niggemann (redmine.org team member)
This is a step-by-step guide to install redmine on "Debian stable" (called Squeeze at the moment of writing).
10 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.
11 3 Jan Niggemann (redmine.org team member)
To keep this guide short, it does not explain every step in detail, but *after reading, even novices should end up with a working redmine instance*.
12 3 Jan Niggemann (redmine.org team member)
13 3 Jan Niggemann (redmine.org team member)
*%{color:red}Please note:%* We're 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.
14 3 Jan Niggemann (redmine.org team member)
15 3 Jan Niggemann (redmine.org team member)
h1. Chapter 1: Install ruby, rails, gems and passenger
16 3 Jan Niggemann (redmine.org team member)
17 3 Jan Niggemann (redmine.org team member)
{{collapse(Read chapter 1)
18 3 Jan Niggemann (redmine.org team member)
19 1 Jan Niggemann (redmine.org team member)
h2. 1.1 Prepare your system
20 1 Jan Niggemann (redmine.org team member)
21 1 Jan Niggemann (redmine.org team member)
<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</pre>
22 1 Jan Niggemann (redmine.org team member)
23 1 Jan Niggemann (redmine.org team member)
h2. 1.2 download, build and install ruby
24 1 Jan Niggemann (redmine.org team member)
25 1 Jan Niggemann (redmine.org team member)
<pre>wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz
26 1 Jan Niggemann (redmine.org team member)
tar xvfz ruby-1.9.3-p327.tar.gz
27 1 Jan Niggemann (redmine.org team member)
cd ruby-1.9.2-p0
28 1 Jan Niggemann (redmine.org team member)
./configure --enable-pthread --prefix=/usr/local
29 1 Jan Niggemann (redmine.org team member)
make && make install</pre>
30 1 Jan Niggemann (redmine.org team member)
31 1 Jan Niggemann (redmine.org team member)
h2. 1.3 check if ruby works
32 1 Jan Niggemann (redmine.org team member)
33 1 Jan Niggemann (redmine.org team member)
<pre>ruby –v</pre>
34 1 Jan Niggemann (redmine.org team member)
35 1 Jan Niggemann (redmine.org team member)
h2. 1.4 make ruby support OpenSSL
36 1 Jan Niggemann (redmine.org team member)
37 1 Jan Niggemann (redmine.org team member)
<pre>cd ruby-1.9.2-p0
38 1 Jan Niggemann (redmine.org team member)
cd ext/openssl/
39 1 Jan Niggemann (redmine.org team member)
ruby extconf.rb
40 1 Jan Niggemann (redmine.org team member)
make && make install</pre>
41 1 Jan Niggemann (redmine.org team member)
42 1 Jan Niggemann (redmine.org team member)
h2. 1.5 gem installed?
43 1 Jan Niggemann (redmine.org team member)
44 1 Jan Niggemann (redmine.org team member)
By now, gem should already be installed, check:
45 1 Jan Niggemann (redmine.org team member)
<pre>gem -v</pre>
46 1 Jan Niggemann (redmine.org team member)
47 1 Jan Niggemann (redmine.org team member)
h2. 1.6 install rails
48 1 Jan Niggemann (redmine.org team member)
49 1 Jan Niggemann (redmine.org team member)
<pre>gem install rails</pre>
50 1 Jan Niggemann (redmine.org team member)
51 1 Jan Niggemann (redmine.org team member)
h2. 1.7 install passenger (application server)
52 1 Jan Niggemann (redmine.org team member)
53 1 Jan Niggemann (redmine.org team member)
<pre>gem install passenger
54 1 Jan Niggemann (redmine.org team member)
passenger-install-apache2-module</pre>
55 1 Jan Niggemann (redmine.org team member)
56 1 Jan Niggemann (redmine.org team member)
h2. 1.8 configure apache
57 1 Jan Niggemann (redmine.org team member)
58 1 Jan Niggemann (redmine.org team member)
Put this in /etc/apache/mods-available/passenger.load
59 1 Jan Niggemann (redmine.org team member)
<pre>LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.18/ext/apache2/mod_passenger.so</pre>
60 1 Jan Niggemann (redmine.org team member)
61 1 Jan Niggemann (redmine.org team member)
And put this in /etc/apache/mods-available/passenger.conf
62 1 Jan Niggemann (redmine.org team member)
<pre>PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.18
63 1 Jan Niggemann (redmine.org team member)
PassengerRuby /usr/local/bin/ruby
64 1 Jan Niggemann (redmine.org team member)
PassengerDefaultUser www-data</pre>
65 1 Jan Niggemann (redmine.org team member)
66 1 Jan Niggemann (redmine.org team member)
67 1 Jan Niggemann (redmine.org team member)
h2. 1.9 activate module
68 1 Jan Niggemann (redmine.org team member)
69 1 Jan Niggemann (redmine.org team member)
<pre>a2enmod passenger</pre>
70 1 Jan Niggemann (redmine.org team member)
71 3 Jan Niggemann (redmine.org team member)
}}
72 1 Jan Niggemann (redmine.org team member)
73 3 Jan Niggemann (redmine.org team member)
h1. Chapter 2: Install redmine
74 3 Jan Niggemann (redmine.org team member)
75 3 Jan Niggemann (redmine.org team member)
{{collapse(Read chapter 2)
76 3 Jan Niggemann (redmine.org team member)
77 2 Jan Niggemann (redmine.org team member)
h2. 2.1 download redmine
78 2 Jan Niggemann (redmine.org team member)
79 2 Jan Niggemann (redmine.org team member)
Get latest zip from "here":http://rubyforge.org/frs/?group_id=1850 and unpack to /opt
80 2 Jan Niggemann (redmine.org team member)
81 2 Jan Niggemann (redmine.org team member)
h2. 2.2 further prepare the system
82 2 Jan Niggemann (redmine.org team member)
83 2 Jan Niggemann (redmine.org team member)
Note: Installing @libmagick9-dev@ installs a lot of packages (depends / recommends)
84 2 Jan Niggemann (redmine.org team member)
<pre>gem install bundler
85 2 Jan Niggemann (redmine.org team member)
apt-get install libmagick9-dev
86 2 Jan Niggemann (redmine.org team member)
bundle install --without postgresql</pre>
87 2 Jan Niggemann (redmine.org team member)
88 2 Jan Niggemann (redmine.org team member)
h2. 2.3 create databases
89 2 Jan Niggemann (redmine.org team member)
90 2 Jan Niggemann (redmine.org team member)
We now create 2 databases, one for production and one for development.
91 2 Jan Niggemann (redmine.org team member)
I won't give detailed instructions on how to use mysql, please use you favorite search engine to find information you need.
92 2 Jan Niggemann (redmine.org team member)
93 2 Jan Niggemann (redmine.org team member)
<pre>create database redmine character set utf8;
94 2 Jan Niggemann (redmine.org team member)
create database redmine_dev character set utf8;
95 2 Jan Niggemann (redmine.org team member)
create user 'redmine'@'localhost' identified by 'XXX';
96 2 Jan Niggemann (redmine.org team member)
grant all privileges on redmine.* to 'redmine'@'localhost';
97 2 Jan Niggemann (redmine.org team member)
grant all privileges on redmine_dev.* to 'redmine'@'localhost';</pre>
98 2 Jan Niggemann (redmine.org team member)
99 2 Jan Niggemann (redmine.org team member)
100 2 Jan Niggemann (redmine.org team member)
h2. 2.4 configure DB-connection
101 2 Jan Niggemann (redmine.org team member)
102 2 Jan Niggemann (redmine.org team member)
Put this in /opt/redmine/config/database.yml
103 2 Jan Niggemann (redmine.org team member)
<pre>production:
104 2 Jan Niggemann (redmine.org team member)
adapter: mysql2
105 2 Jan Niggemann (redmine.org team member)
database: redmine
106 2 Jan Niggemann (redmine.org team member)
host: localhost
107 2 Jan Niggemann (redmine.org team member)
username: redmine
108 2 Jan Niggemann (redmine.org team member)
password: my_password</pre>
109 2 Jan Niggemann (redmine.org team member)
110 2 Jan Niggemann (redmine.org team member)
h2. 2.5 generate a session store secret
111 2 Jan Niggemann (redmine.org team member)
112 2 Jan Niggemann (redmine.org team member)
<pre>rake generate_secret_token</pre>
113 2 Jan Niggemann (redmine.org team member)
114 2 Jan Niggemann (redmine.org team member)
h2. 2.6 prepare database / create tables
115 2 Jan Niggemann (redmine.org team member)
116 2 Jan Niggemann (redmine.org team member)
<pre>RAILS_ENV=production rake db:migrate</pre>
117 2 Jan Niggemann (redmine.org team member)
118 2 Jan Niggemann (redmine.org team member)
h2. 2.7 set filesystem permissions
119 2 Jan Niggemann (redmine.org team member)
120 2 Jan Niggemann (redmine.org team member)
<pre>mkdir /opt/redmine/plugin_assets (oder public/plugin_assets?)
121 2 Jan Niggemann (redmine.org team member)
chown www-data:www-data /opt/redmine/plugin_assets</<pre>
122 1 Jan Niggemann (redmine.org team member)
123 1 Jan Niggemann (redmine.org team member)
h2. 2.8 test if it works
124 1 Jan Niggemann (redmine.org team member)
<pre>ruby script/rails server webrick -e production</<pre>
125 1 Jan Niggemann (redmine.org team member)
Now go to http://localhost:3000 and see redmine in action.
126 3 Jan Niggemann (redmine.org team member)
127 3 Jan Niggemann (redmine.org team member)
}}
128 3 Jan Niggemann (redmine.org team member)
129 3 Jan Niggemann (redmine.org team member)
h1. Chapter 3: Configure apache and passenger
130 3 Jan Niggemann (redmine.org team member)
131 3 Jan Niggemann (redmine.org team member)
In this guide, we deploy to a sub-URI. Read other guides if you want a name-based virtual host configuration.
132 3 Jan Niggemann (redmine.org team member)
133 3 Jan Niggemann (redmine.org team member)
{{collapse(Read chapter 3)
134 3 Jan Niggemann (redmine.org team member)
135 3 Jan Niggemann (redmine.org team member)
h2. Deployment in subURI
136 3 Jan Niggemann (redmine.org team member)
<pre>
137 3 Jan Niggemann (redmine.org team member)
ln -s /opt/redmine/public /var/www/redmine
138 3 Jan Niggemann (redmine.org team member)
139 3 Jan Niggemann (redmine.org team member)
/etc/apache2/sites-available/redmine
140 3 Jan Niggemann (redmine.org team member)
141 3 Jan Niggemann (redmine.org team member)
[Location /redmine-dev]
142 3 Jan Niggemann (redmine.org team member)
  RailsEnv development
143 3 Jan Niggemann (redmine.org team member)
		RailsBaseURI /redmine-dev
144 3 Jan Niggemann (redmine.org team member)
		Options –MultiViews
145 3 Jan Niggemann (redmine.org team member)
[/Location]
146 3 Jan Niggemann (redmine.org team member)
[Location /redmine]
147 3 Jan Niggemann (redmine.org team member)
		RailsEnv production
148 3 Jan Niggemann (redmine.org team member)
		RailsBaseURI /redmine
149 3 Jan Niggemann (redmine.org team member)
		Options –MultiViews
150 3 Jan Niggemann (redmine.org team member)
[/Location]
151 3 Jan Niggemann (redmine.org team member)
</pre>
152 3 Jan Niggemann (redmine.org team member)
153 3 Jan Niggemann (redmine.org team member)
}}