HowTo Install Redmine on Debian with Ruby-on-Rails and Apache2-Passenger » History » Version 4

Mischa The Evil, 2010-06-26 03:27
Fixed page heading.

1 4 Mischa The Evil
h1. HowTo Install Redmine on Debian with Ruby-on-Rails and Apache2 Passenger
2 1 Stefan Brinkmann
3 2 Stefan Brinkmann
h2. A .bash_history based Doc.
4 1 Stefan Brinkmann
5 1 Stefan Brinkmann
aptitude install ruby libzlib-ruby rdoc irb
6 1 Stefan Brinkmann
7 1 Stefan Brinkmann
*_NOTE: The rubygems from repository is not working. We download gems from sourceforge_*
8 1 Stefan Brinkmann
9 1 Stefan Brinkmann
cd /tmp
10 1 Stefan Brinkmann
wget http://rubyforge.org/frs/download.php/70697/rubygems-1.3.7.zip
11 1 Stefan Brinkmann
unzip rubygems-1.3.7.zip
12 1 Stefan Brinkmann
cd rubygems-1.3.7
13 1 Stefan Brinkmann
ruby setup.rb all
14 1 Stefan Brinkmann
cd ..
15 1 Stefan Brinkmann
rm -r rubygems-1.3.7 rubygems-1.3.7.zip
16 1 Stefan Brinkmann
ln /usr/bin/gem1.8 /usr/bin/gem
17 1 Stefan Brinkmann
18 1 Stefan Brinkmann
gem install rails --include-dependencies
19 1 Stefan Brinkmann
gem install rack -v 1.0.1
20 1 Stefan Brinkmann
21 1 Stefan Brinkmann
mysql -uroot -pyourpasswd
22 1 Stefan Brinkmann
<pre>
23 1 Stefan Brinkmann
create database redmine character set utf8;
24 1 Stefan Brinkmann
create user 'redmine'@'localhost' identified by 'my_password';
25 1 Stefan Brinkmann
grant all privileges on redmine.* to 'redmine'@'localhost';
26 1 Stefan Brinkmann
exit;
27 1 Stefan Brinkmann
</pre>
28 1 Stefan Brinkmann
*_NOTE: For MySQL prior 5.2.0 use this_*
29 1 Stefan Brinkmann
<pre>
30 1 Stefan Brinkmann
create database redmine character set utf8;
31 1 Stefan Brinkmann
create user 'redmine'@'localhost' identified by 'my_password';
32 1 Stefan Brinkmann
grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'my_password';
33 1 Stefan Brinkmann
exit;
34 1 Stefan Brinkmann
</pre>
35 1 Stefan Brinkmann
36 1 Stefan Brinkmann
cd /srv/www/htdocs
37 1 Stefan Brinkmann
wget http://rubyforge.org/frs/download.php/70488/redmine-0.9.4.zip
38 1 Stefan Brinkmann
unzip redmine-0.9.4.zip
39 1 Stefan Brinkmann
rm redmine-0.9.4.zip
40 1 Stefan Brinkmann
mv redmine-0.9.4 redmine
41 1 Stefan Brinkmann
42 1 Stefan Brinkmann
cd /srv/www/htdocs/redmine
43 1 Stefan Brinkmann
cp config/database.yml.example config/database.yml
44 1 Stefan Brinkmann
vi config/database.yml
45 1 Stefan Brinkmann
<pre>
46 1 Stefan Brinkmann
production:
47 1 Stefan Brinkmann
  adapter: mysql
48 1 Stefan Brinkmann
  database: redmine
49 1 Stefan Brinkmann
  host: localhost
50 1 Stefan Brinkmann
  username: redmine
51 1 Stefan Brinkmann
  password: passwd
52 1 Stefan Brinkmann
  encoding: utf8
53 1 Stefan Brinkmann
</pre>
54 1 Stefan Brinkmann
55 1 Stefan Brinkmann
cp config/email.yml.example config/email.yml
56 1 Stefan Brinkmann
vi config/email.yml
57 1 Stefan Brinkmann
*_NOTE: For more Help look here:_* http://redmineblog.com/articles/setup-redmine-to-send-email-using-gmail/
58 1 Stefan Brinkmann
<pre>
59 1 Stefan Brinkmann
production:
60 1 Stefan Brinkmann
  delivery_method: :smtp
61 1 Stefan Brinkmann
  smtp_settings:
62 1 Stefan Brinkmann
    tls: true
63 1 Stefan Brinkmann
    address: "smtp.gmail.com"
64 1 Stefan Brinkmann
    port: '587'
65 1 Stefan Brinkmann
    domain: "smtp.gmail.com"
66 1 Stefan Brinkmann
    authentication: :plain
67 1 Stefan Brinkmann
    user_name: "your_email@gmail.com"
68 1 Stefan Brinkmann
    password: "your_password"
69 1 Stefan Brinkmann
</pre>
70 1 Stefan Brinkmann
71 1 Stefan Brinkmann
aptitude install libapache2-mod-fastcgi libfcgi-ruby1.8
72 1 Stefan Brinkmann
aptitude install libmysql-ruby libopenssl-ruby1.8
73 1 Stefan Brinkmann
74 1 Stefan Brinkmann
RAILS_ENV=production rake config/initializers/session_store.rb
75 1 Stefan Brinkmann
rake generate_session_store
76 1 Stefan Brinkmann
RAILS_ENV=production rake db:migrate
77 1 Stefan Brinkmann
RAILS_ENV=production rake redmine:load_default_data
78 1 Stefan Brinkmann
79 1 Stefan Brinkmann
aptitude install ruby-dev
80 1 Stefan Brinkmann
gem install passenger
81 1 Stefan Brinkmann
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/bin/passenger-install-apache2-module
82 1 Stefan Brinkmann
83 1 Stefan Brinkmann
*_NOTE: following file contents info comes from ".../passenger-install-apache2-module"_*
84 1 Stefan Brinkmann
85 1 Stefan Brinkmann
vi /etc/apache2/mods-available/passenger.load
86 1 Stefan Brinkmann
<pre>
87 1 Stefan Brinkmann
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/ext/apache2/mod_passenger.so</pre>
88 1 Stefan Brinkmann
89 1 Stefan Brinkmann
vi /etc/apache2/mods-available/passenger.conf
90 1 Stefan Brinkmann
<pre>
91 1 Stefan Brinkmann
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.14                                                 
92 1 Stefan Brinkmann
PassengerRuby /usr/bin/ruby1.8
93 1 Stefan Brinkmann
</pre>
94 1 Stefan Brinkmann
95 1 Stefan Brinkmann
a2enmod passenger
96 1 Stefan Brinkmann
97 1 Stefan Brinkmann
vi /etc/apache2/sites-available/default
98 1 Stefan Brinkmann
<pre>
99 1 Stefan Brinkmann
<VirtualHost *:80>                                                                                         
100 1 Stefan Brinkmann
  ServerName www.yourhost.com                                                                             
101 1 Stefan Brinkmann
  DocumentRoot /srv/www/htdocs/redmine/public    # <-- be sure to point to 'public'!                                   
102 1 Stefan Brinkmann
  <Directory /srv/www/htdocs/redmine/public>                                                                           
103 1 Stefan Brinkmann
    AllowOverride all                            # <-- relax Apache security settings                                  
104 1 Stefan Brinkmann
    Options -MultiViews                          # <-- MultiViews must be turned off                                   
105 1 Stefan Brinkmann
  </Directory>                                                                                            
106 1 Stefan Brinkmann
</VirtualHost>
107 1 Stefan Brinkmann
</pre> 
108 1 Stefan Brinkmann
109 1 Stefan Brinkmann
cd /srv/www/htdocs/redmine
110 1 Stefan Brinkmann
chmod -R 775 ./*
111 1 Stefan Brinkmann
chown -R root:root ./*
112 1 Stefan Brinkmann
mkdir tmp public/plugin_assets
113 1 Stefan Brinkmann
chown -R nobody:nogroup files log tmp public/plugin_assets
114 1 Stefan Brinkmann
chmod -R 775 files log tmp public/plugin_assets
115 1 Stefan Brinkmann
116 1 Stefan Brinkmann
/etc/init.d/apache2 restart
117 1 Stefan Brinkmann
118 1 Stefan Brinkmann
h2. Put Redmine in a Folder
119 1 Stefan Brinkmann
120 1 Stefan Brinkmann
mkdir /srv/www/apps
121 1 Stefan Brinkmann
mv /srv/www/htdocs/redmine /srv/www/apps/redmine
122 1 Stefan Brinkmann
ln -s /srv/www/apps/redmine /srv/www/htdocs/redmine
123 1 Stefan Brinkmann
vi /etc/apache2/sites-available/default
124 1 Stefan Brinkmann
<pre>
125 1 Stefan Brinkmann
<VirtualHost *:80>
126 1 Stefan Brinkmann
  ServerName www.yourhost.com
127 1 Stefan Brinkmann
  DocumentRoot /srv/www/htdocs
128 1 Stefan Brinkmann
  <Directory /srv/www/htdocs>
129 1 Stefan Brinkmann
    AllowOverride all
130 1 Stefan Brinkmann
    Options -MultiViews
131 1 Stefan Brinkmann
  </Directory>
132 1 Stefan Brinkmann
133 1 Stefan Brinkmann
  RailsBaseURI /redmine
134 1 Stefan Brinkmann
  <Directory /srv/www/htdocs/redmine>
135 1 Stefan Brinkmann
    Options -MultiViews
136 1 Stefan Brinkmann
  </Directory>                                                                                     
137 1 Stefan Brinkmann
</VirtualHost>
138 1 Stefan Brinkmann
</pre>
139 1 Stefan Brinkmann
140 1 Stefan Brinkmann
/etc/init.d/apache2 restart
141 1 Stefan Brinkmann
142 1 Stefan Brinkmann
h2. Repositories
143 1 Stefan Brinkmann
144 1 Stefan Brinkmann
I used following Repos:
145 1 Stefan Brinkmann
Replace lenny with etch if you are using Debian etch(stable)
146 1 Stefan Brinkmann
You find more Repos here:
147 1 Stefan Brinkmann
http://wiki.unixboard.de/index.php/Repositories_fuer_Debian_und_Derivate
148 1 Stefan Brinkmann
149 1 Stefan Brinkmann
vi /etc/apt/sources.list
150 1 Stefan Brinkmann
<pre>
151 1 Stefan Brinkmann
deb http://ftp.de.debian.org/debian/ lenny main contrib non-free
152 1 Stefan Brinkmann
deb-src http://ftp.de.debian.org/debian/ lenny main contrib non-free
153 1 Stefan Brinkmann
154 1 Stefan Brinkmann
deb http://security.debian.org/ lenny/updates main contrib non-free
155 1 Stefan Brinkmann
deb-src http://security.debian.org/ lenny/updates main contrib non-free
156 1 Stefan Brinkmann
157 1 Stefan Brinkmann
deb http://security.debian.org/ lenny/updates main contrib non-free
158 1 Stefan Brinkmann
deb-src http://security.debian.org/ lenny/updates main contrib non-free
159 1 Stefan Brinkmann
160 1 Stefan Brinkmann
deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free
161 1 Stefan Brinkmann
</pre>