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