InstallRedmineOnDebianStableApacheMysqlPassenger » History » Version 2

Jan Niggemann (redmine.org team member), 2013-01-21 22:24

1 1 Jan Niggemann (redmine.org team member)
h1. DebianInstall
2 1 Jan Niggemann (redmine.org team member)
3 2 Jan Niggemann (redmine.org team member)
{{>toc}}
4 2 Jan Niggemann (redmine.org team member)
5 1 Jan Niggemann (redmine.org team member)
h1. 1: Install ruby, rails, gems and passenger
6 1 Jan Niggemann (redmine.org team member)
7 1 Jan Niggemann (redmine.org team member)
h2. 1.1 Prepare your system
8 1 Jan Niggemann (redmine.org team member)
9 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>
10 1 Jan Niggemann (redmine.org team member)
11 1 Jan Niggemann (redmine.org team member)
h2. 1.2 download, build and install ruby
12 1 Jan Niggemann (redmine.org team member)
13 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
14 1 Jan Niggemann (redmine.org team member)
tar xvfz ruby-1.9.3-p327.tar.gz
15 1 Jan Niggemann (redmine.org team member)
cd ruby-1.9.2-p0
16 1 Jan Niggemann (redmine.org team member)
./configure --enable-pthread --prefix=/usr/local
17 1 Jan Niggemann (redmine.org team member)
make && make install</pre>
18 1 Jan Niggemann (redmine.org team member)
19 1 Jan Niggemann (redmine.org team member)
h2. 1.3 check if ruby works
20 1 Jan Niggemann (redmine.org team member)
21 1 Jan Niggemann (redmine.org team member)
<pre>ruby –v</pre>
22 1 Jan Niggemann (redmine.org team member)
23 1 Jan Niggemann (redmine.org team member)
h2. 1.4 make ruby support OpenSSL
24 1 Jan Niggemann (redmine.org team member)
25 1 Jan Niggemann (redmine.org team member)
<pre>cd ruby-1.9.2-p0
26 1 Jan Niggemann (redmine.org team member)
cd ext/openssl/
27 1 Jan Niggemann (redmine.org team member)
ruby extconf.rb
28 1 Jan Niggemann (redmine.org team member)
make && make install</pre>
29 1 Jan Niggemann (redmine.org team member)
30 1 Jan Niggemann (redmine.org team member)
h2. 1.5 gem installed?
31 1 Jan Niggemann (redmine.org team member)
32 1 Jan Niggemann (redmine.org team member)
By now, gem should already be installed, check:
33 1 Jan Niggemann (redmine.org team member)
<pre>gem -v</pre>
34 1 Jan Niggemann (redmine.org team member)
35 1 Jan Niggemann (redmine.org team member)
h2. 1.6 install rails
36 1 Jan Niggemann (redmine.org team member)
37 1 Jan Niggemann (redmine.org team member)
<pre>gem install rails</pre>
38 1 Jan Niggemann (redmine.org team member)
39 1 Jan Niggemann (redmine.org team member)
h2. 1.7 install passenger (application server)
40 1 Jan Niggemann (redmine.org team member)
41 1 Jan Niggemann (redmine.org team member)
<pre>gem install passenger
42 1 Jan Niggemann (redmine.org team member)
passenger-install-apache2-module</pre>
43 1 Jan Niggemann (redmine.org team member)
44 1 Jan Niggemann (redmine.org team member)
h2. 1.8 configure apache
45 1 Jan Niggemann (redmine.org team member)
46 1 Jan Niggemann (redmine.org team member)
Put this in /etc/apache/mods-available/passenger.load
47 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>
48 1 Jan Niggemann (redmine.org team member)
49 1 Jan Niggemann (redmine.org team member)
And put this in /etc/apache/mods-available/passenger.conf
50 1 Jan Niggemann (redmine.org team member)
<pre>PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.18
51 1 Jan Niggemann (redmine.org team member)
PassengerRuby /usr/local/bin/ruby
52 1 Jan Niggemann (redmine.org team member)
PassengerDefaultUser www-data</pre>
53 1 Jan Niggemann (redmine.org team member)
54 1 Jan Niggemann (redmine.org team member)
55 1 Jan Niggemann (redmine.org team member)
h2. 1.9 activate module
56 1 Jan Niggemann (redmine.org team member)
57 1 Jan Niggemann (redmine.org team member)
<pre>a2enmod passenger</pre>
58 2 Jan Niggemann (redmine.org team member)
59 2 Jan Niggemann (redmine.org team member)
h1. 2: Install redmine
60 2 Jan Niggemann (redmine.org team member)
61 2 Jan Niggemann (redmine.org team member)
h2. 2.1 download redmine
62 2 Jan Niggemann (redmine.org team member)
63 2 Jan Niggemann (redmine.org team member)
Get latest zip from "here":http://rubyforge.org/frs/?group_id=1850 and unpack to /opt
64 2 Jan Niggemann (redmine.org team member)
65 2 Jan Niggemann (redmine.org team member)
h2. 2.2 further prepare the system
66 2 Jan Niggemann (redmine.org team member)
67 2 Jan Niggemann (redmine.org team member)
Note: Installing @libmagick9-dev@ installs a lot of packages (depends / recommends)
68 2 Jan Niggemann (redmine.org team member)
<pre>gem install bundler
69 2 Jan Niggemann (redmine.org team member)
apt-get install libmagick9-dev
70 2 Jan Niggemann (redmine.org team member)
bundle install --without postgresql</pre>
71 2 Jan Niggemann (redmine.org team member)
72 2 Jan Niggemann (redmine.org team member)
h2. 2.3 create databases
73 2 Jan Niggemann (redmine.org team member)
74 2 Jan Niggemann (redmine.org team member)
We now create 2 databases, one for production and one for development.
75 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.
76 2 Jan Niggemann (redmine.org team member)
77 2 Jan Niggemann (redmine.org team member)
<pre>create database redmine character set utf8;
78 2 Jan Niggemann (redmine.org team member)
create database redmine_dev character set utf8;
79 2 Jan Niggemann (redmine.org team member)
create user 'redmine'@'localhost' identified by 'XXX';
80 2 Jan Niggemann (redmine.org team member)
grant all privileges on redmine.* to 'redmine'@'localhost';
81 2 Jan Niggemann (redmine.org team member)
grant all privileges on redmine_dev.* to 'redmine'@'localhost';</pre>
82 2 Jan Niggemann (redmine.org team member)
83 2 Jan Niggemann (redmine.org team member)
84 2 Jan Niggemann (redmine.org team member)
h2. 2.4 configure DB-connection
85 2 Jan Niggemann (redmine.org team member)
86 2 Jan Niggemann (redmine.org team member)
Put this in /opt/redmine/config/database.yml
87 2 Jan Niggemann (redmine.org team member)
<pre>production:
88 2 Jan Niggemann (redmine.org team member)
adapter: mysql2
89 2 Jan Niggemann (redmine.org team member)
database: redmine
90 2 Jan Niggemann (redmine.org team member)
host: localhost
91 2 Jan Niggemann (redmine.org team member)
username: redmine
92 2 Jan Niggemann (redmine.org team member)
password: my_password</pre>
93 2 Jan Niggemann (redmine.org team member)
94 2 Jan Niggemann (redmine.org team member)
h2. 2.5 generate a session store secret
95 2 Jan Niggemann (redmine.org team member)
96 2 Jan Niggemann (redmine.org team member)
<pre>rake generate_secret_token</pre>
97 2 Jan Niggemann (redmine.org team member)
98 2 Jan Niggemann (redmine.org team member)
h2. 2.6 prepare database / create tables
99 2 Jan Niggemann (redmine.org team member)
100 2 Jan Niggemann (redmine.org team member)
<pre>RAILS_ENV=production rake db:migrate</pre>
101 2 Jan Niggemann (redmine.org team member)
102 2 Jan Niggemann (redmine.org team member)
h2. 2.7 set filesystem permissions
103 2 Jan Niggemann (redmine.org team member)
104 2 Jan Niggemann (redmine.org team member)
<pre>mkdir /opt/redmine/plugin_assets (oder public/plugin_assets?)
105 2 Jan Niggemann (redmine.org team member)
chown www-data:www-data /opt/redmine/plugin_assets</<pre>
106 2 Jan Niggemann (redmine.org team member)
107 2 Jan Niggemann (redmine.org team member)
h2. 2.8 test if it works
108 2 Jan Niggemann (redmine.org team member)
<pre>ruby script/rails server webrick -e production</<pre>
109 2 Jan Niggemann (redmine.org team member)
Now go to http://localhost:3000 and see redmine in action.