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