HowTo Install Redmine in Ubuntu » History » Version 39

Yu Kobayashi, 2012-10-15 17:34

1 36 Anonymous
h1. Ubuntu 10.04 or 12.04 using Passenger
2 36 Anonymous
3 36 Anonymous
The installation assumes that the web server and database are already in place, so you probably want to install the LAMP stack first if you don't already have it:
4 36 Anonymous
5 36 Anonymous
> $ sudo tasksel install lamp-server
6 36 Anonymous
7 36 Anonymous
You will also need to install the Passenger apache module.
8 36 Anonymous
9 36 Anonymous
> $ sudo apt-get install libapache2-mod-passenger
10 36 Anonymous
11 36 Anonymous
Also, the default AppArmor configuration can get in the way, so you may need to set the mysqld profile to complain:
12 36 Anonymous
13 36 Anonymous
> $ sudo aa-complain /usr/sbin/mysqld
14 36 Anonymous
15 36 Anonymous
h2. Installing Redmine 0.9.3 (Ubuntu 10.04) or Redmine 1.3.2 (Ubuntu 12.04)
16 36 Anonymous
17 36 Anonymous
As of 10.04 and 12.04, Redmine is available through Ubuntu's package manager, and installation is simple:
18 36 Anonymous
19 38 Yu Kobayashi
> $ sudo apt-get install redmine redmine-mysql
20 36 Anonymous
21 36 Anonymous
The second package, _redmine-mysql_, can be replaced by either _redmine-pgsql_ or _redmine-sqlite_ if you want to use either of those databases.
22 36 Anonymous
23 36 Anonymous
The installation process should prompt you for all the interesting details.
24 36 Anonymous
25 36 Anonymous
Redmine will now be installed in @/usr/share/redmine@ and @/etc/redmine@
26 36 Anonymous
27 36 Anonymous
h2. Installing the latest Redmine
28 36 Anonymous
29 36 Anonymous
The package with Ubuntu 10.04 is stuck in the 0.9.x branch and Ubuntu 12.04 is stuck in the 1.3.x branch. A PPA exists that has the latest branch here: https://launchpad.net/~ondrej/+archive/redmine
30 36 Anonymous
31 36 Anonymous
To install redmine using the PPA:
32 36 Anonymous
33 38 Yu Kobayashi
> $ sudo add-apt-repository ppa:ondrej/redmine
34 38 Yu Kobayashi
> $ sudo apt-get update
35 38 Yu Kobayashi
> $ sudo apt-get install redmine redmine-mysql
36 36 Anonymous
37 36 Anonymous
Note: If your server is behind a firewall, you will need to export your firewall settings before running @add-apt-repository@. Otherwise, the command will hang.
38 36 Anonymous
Run the following <pre>export http_proxy="http://proxy.your.server:port" and export https_proxy="http:proxy.your.server:port".</pre>
39 36 Anonymous
40 36 Anonymous
h2. Configuration
41 36 Anonymous
42 36 Anonymous
Symlink @/usr/share/redmine/public@ to your desired web-accessible location. E.g.:
43 36 Anonymous
44 36 Anonymous
> $ sudo ln -s /usr/share/redmine/public /var/www/redmine
45 36 Anonymous
46 36 Anonymous
By default, passenger runs as 'nobody', so you'll need to fix that. In @/etc/apache2/mods-available/passenger.conf@, add:
47 36 Anonymous
48 38 Yu Kobayashi
<pre>PassengerDefaultUser www-data</pre>
49 36 Anonymous
50 36 Anonymous
You'll also need to configure the @/var/www/redmine@ location in @/etc/apache2/sites-available/default@ by adding:
51 36 Anonymous
52 36 Anonymous
<pre><Directory /var/www/redmine>
53 36 Anonymous
RailsBaseURI /redmine
54 36 Anonymous
PassengerResolveSymlinksInDocumentRoot on
55 36 Anonymous
</Directory>
56 36 Anonymous
</pre>
57 36 Anonymous
58 36 Anonymous
If you set your AppArmor mysqld profile to complain you ought to set it back to enforce:
59 36 Anonymous
60 36 Anonymous
> $ sudo aa-enforce /usr/sbin/mysqld
61 36 Anonymous
62 36 Anonymous
Enable passenger:
63 36 Anonymous
64 36 Anonymous
> $ sudo a2enmod passenger
65 36 Anonymous
66 36 Anonymous
Restart apache2
67 36 Anonymous
68 36 Anonymous
> $ sudo service apache2 restart
69 36 Anonymous
70 36 Anonymous
and you should be able to access Redmine at: http://redmine.server.ip.address/redmine
71 36 Anonymous
72 36 Anonymous
If you receive a "403: Forbidden" error after setting up Redmine, the Redmine 'public' folder may have incorrect permissions set. The executable bit on the public folder must be enabled or you will receive a "403: Forbidden" error when attempting to access Redmine.
73 36 Anonymous
74 36 Anonymous
> $ sudo chmod a+x /usr/share/redmine/public
75 36 Anonymous
76 36 Anonymous
h1. Ubuntu 10.04 or 12.04 using WEBrick
77 36 Anonymous
78 36 Anonymous
Using Passenger is recommended for the heavy load server. But WEBrick uses less memory.
79 36 Anonymous
80 39 Yu Kobayashi
Install Redmine: (See also _Installing the latest Redmine_ above)
81 38 Yu Kobayashi
82 38 Yu Kobayashi
> $ sudo apt-get install redmine redmine-mysql
83 36 Anonymous
84 36 Anonymous
Then, create this for /etc/init/redmine.conf
85 36 Anonymous
86 36 Anonymous
<pre>
87 36 Anonymous
# Redmine
88 36 Anonymous
89 36 Anonymous
description "Redmine"
90 36 Anonymous
91 36 Anonymous
start on runlevel [2345]
92 36 Anonymous
stop on runlevel [!2345]
93 36 Anonymous
94 36 Anonymous
expect daemon
95 36 Anonymous
exec ruby /usr/share/redmine/script/server webrick -e production -b 0.0.0.0 -d
96 36 Anonymous
</pre>
97 36 Anonymous
98 36 Anonymous
You can start Redmine by this. You can access by http://example.com:3000/
99 36 Anonymous
100 36 Anonymous
> $ sudo service redmine start
101 36 Anonymous
102 36 Anonymous
You can stop by this.
103 36 Anonymous
104 36 Anonymous
> $ sudo service redmine stop
105 36 Anonymous
106 36 Anonymous
h1. Ubuntu 10.04 using mod_cgi
107 36 Anonymous
108 36 Anonymous
The installation assumes that the web server and database are already in place, so you probably want to install the LAMP stack first if you don't already have it:
109 36 Anonymous
110 36 Anonymous
> $ sudo tasksel install lamp-server
111 36 Anonymous
112 36 Anonymous
Also, the default AppArmor configuration can get in the way, so you may need to set the mysqld profile to complain:
113 36 Anonymous
114 36 Anonymous
> $ sudo aa-complain /usr/sbin/mysqld
115 36 Anonymous
116 36 Anonymous
As of 10.04, Redmine is available through Ubuntu's package manager, and installation is simple:
117 36 Anonymous
118 36 Anonymous
> $ sudo apt-get install redmine redmine-mysql subversion
119 36 Anonymous
120 36 Anonymous
The second package, _redmine-mysql_, can be replaced by either _redmine-pgsql_ or _redmine-sqlite_ if you want to use either of those databases.
121 36 Anonymous
122 36 Anonymous
The installation process should prompt you for all the interesting details.
123 36 Anonymous
124 36 Anonymous
Redmine will now be installed in @/usr/share/redmine@ and @/etc/redmine@
125 36 Anonymous
126 36 Anonymous
If you set your AppArmor mysqld profile to complain you ought to set it back to enforce:
127 36 Anonymous
128 36 Anonymous
> $ sudo aa-enforce /usr/sbin/mysqld
129 36 Anonymous
130 36 Anonymous
h2. Configuration
131 36 Anonymous
132 36 Anonymous
> *Using Ubuntu Server 10.04.1, configuring Redmine via mod_cgi as described in this section does not seem to work. If you can successfully make this work, please update these instructions! Otherwise follow the instructions in the next section for installing on Ubuntu 10.04 using Passenger or WEBrick if mod_cgi does not work for you.*
133 36 Anonymous
134 36 Anonymous
Symlink @/usr/share/redmine/public@ to your desired web-accessible location. E.g.:
135 36 Anonymous
136 36 Anonymous
> $ sudo ln -s /usr/share/redmine/public /var/www/redmine
137 36 Anonymous
138 36 Anonymous
The other files that you need to modify/create are as follows:
139 36 Anonymous
140 36 Anonymous
@/etc/redmine/default/database.yml@:
141 36 Anonymous
142 36 Anonymous
<pre>
143 36 Anonymous
production:
144 36 Anonymous
adapter: mysql
145 36 Anonymous
database: redmine
146 36 Anonymous
host: localhost
147 36 Anonymous
username: redmine
148 36 Anonymous
password: pa55w0rd
149 36 Anonymous
encoding: utf8
150 36 Anonymous
</pre>
151 36 Anonymous
152 36 Anonymous
@/usr/share/redmine/public/dispatch.cgi@:
153 36 Anonymous
154 36 Anonymous
<pre>
155 36 Anonymous
#!/usr/bin/ruby
156 36 Anonymous
157 36 Anonymous
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
158 36 Anonymous
159 36 Anonymous
require "dispatcher"
160 36 Anonymous
161 36 Anonymous
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
162 36 Anonymous
Dispatcher.dispatch
163 36 Anonymous
</pre>
164 36 Anonymous
165 36 Anonymous
@/usr/share/redmine/public/.htaccess@:
166 36 Anonymous
167 36 Anonymous
<pre>
168 36 Anonymous
RewriteEngine On
169 36 Anonymous
RewriteBase /redmine
170 36 Anonymous
RewriteRule ^$ index.html [QSA]
171 36 Anonymous
RewriteRule ^([^.]+)$ $1.html [QSA]
172 36 Anonymous
RewriteCond %{REQUEST_FILENAME} !-f
173 36 Anonymous
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
174 36 Anonymous
</pre>
175 36 Anonymous
176 36 Anonymous
And that's it! If these instructions didn't work for you, please expand them to include whatever is needed.
177 36 Anonymous
178 36 Anonymous
h1. Redmine Installation on Virtual or Normal Ubuntu < 10.04
179 36 Anonymous
180 36 Anonymous
This page is a guide to installing Redmine on either a virtual or actual installation of the Ubuntu operating system. If you follow all instructions correctly you will have installed your Redmine server successfully in almost an hour.
181 36 Anonymous
182 36 Anonymous
h2. Step 1: Install Ubuntu
183 36 Anonymous
184 36 Anonymous
If you are installing on a non-virtual Ubuntu instance, please skip this section.
185 36 Anonymous
186 36 Anonymous
*Installing VirtualBox:*
187 36 Anonymous
188 36 Anonymous
1.Download the latest version of Sun VirtualBox (version 3.0.10 or newer).
189 36 Anonymous
2.Install VirtualBox by following the instructions.
190 36 Anonymous
191 36 Anonymous
*Installing Ubuntu on VirtualBox:*
192 36 Anonymous
193 36 Anonymous
1.Download the latest version of Ubuntu (version 9.10 or newer).
194 36 Anonymous
2.After installing VirtualBox you will create a new virtual operating which will be Linux type and Ubuntu subtype. If you don't know anything about VirtualBox and/or its usage please refer to Google.
195 36 Anonymous
196 36 Anonymous
3.While installing Ubuntu you should enter the following configuration:
197 36 Anonymous
(This suggested configuration is optional, you can enter any names you want.)
198 36 Anonymous
Q: What is your name? A: Redmine Server
199 36 Anonymous
Q: What name do you want to use to login? A: redmine
200 36 Anonymous
Q: Choose to password to keep your account safe? A: redmine
201 36 Anonymous
Q: What is the name of this computer? A: redmine-server
202 36 Anonymous
Choose “Log in automatically.” radio button.
203 36 Anonymous
204 36 Anonymous
4.When you've finished the installation, open up your new VirtualBox Ubuntu OS and open up a terminal (console) screen and issue these commands:
205 36 Anonymous
> sudo apt-get update
206 36 Anonymous
> sudo apt-get upgrade
207 36 Anonymous
208 36 Anonymous
*Configuring VirtualBox:*
209 36 Anonymous
210 36 Anonymous
1.If you want to reach your VirtualBox Ubuntu OS from a different machine, you have to configure VirtualBox Ubuntu OS's network settings to Bridged Adapter. So you can reach your VirtualBox Ubuntu from an internal IP address easily. Because it get's the same IP block as you from DHCP easily. I mean your guest and host computer is same IP block as different network client.
211 36 Anonymous
212 36 Anonymous
2.If you had assigned a static IP to your Network Consult by giving your static ethernet MAC address, you have to assign the unique MAC address your VirtualBox Ubuntu OS by Setting->Network->MAC address initialization box. By this MAC address, you can get a static IP easily or you can configure your Ubuntu system to not use DHCP, instead of that you can assign a static IP manually.
213 36 Anonymous
214 36 Anonymous
h2. Step 2: Install Redmine
215 36 Anonymous
216 36 Anonymous
Once you have a functioning Ubuntu operating system up and running, you can continue with installing Redmine.
217 36 Anonymous
218 36 Anonymous
h3. Install dependencies
219 36 Anonymous
220 36 Anonymous
The following packages are required to install and run Redmine. Please install them by running @apt-get@ as root:
221 36 Anonymous
222 36 Anonymous
>sudo apt-get install package-name
223 36 Anonymous
224 36 Anonymous
where @package-name@ is each of:
225 36 Anonymous
* apache2
226 36 Anonymous
* apache2-threaded-dev
227 36 Anonymous
* build-essential
228 36 Anonymous
* libapache-dbi-perl
229 36 Anonymous
* libapache2-mod-perl2
230 36 Anonymous
* libapache2-svn
231 36 Anonymous
* libdigest-sha1-perl
232 36 Anonymous
* libgemplugin-ruby
233 36 Anonymous
* libgemplugin-ruby1.8
234 36 Anonymous
* libruby-extras
235 36 Anonymous
* libruby1.8-extras
236 36 Anonymous
* mongrel
237 36 Anonymous
* mysql-server
238 36 Anonymous
* rails
239 36 Anonymous
* rake
240 36 Anonymous
* ruby
241 36 Anonymous
* rubygems
242 36 Anonymous
* rubygems1.8
243 36 Anonymous
* ruby1.8-dev
244 36 Anonymous
* subversion
245 36 Anonymous
246 36 Anonymous
_(Could someone please clean up this list?)_
247 36 Anonymous
248 36 Anonymous
h3. Package Installation and Setup
249 36 Anonymous
250 36 Anonymous
1.Once you’ve installed the VirtualBox Ubuntu OS and updated it, you need to install a bunch of packages that we will prepare the server for the Redmine installation. So, as root, install the following packages by issuing:
251 36 Anonymous
> sudo apt-get install
252 36 Anonymous
> sudo apt-get install
253 36 Anonymous
(_Surely some missing package names above?_)
254 36 Anonymous
255 36 Anonymous
The packages we’re installing above are MySQL, phpMyAdmin, Rails, Ruby Gems, Mongrel and Ruby Dev environment.
256 36 Anonymous
During the installation of the packages, when MySQL is installed, it will prompt you to create a password. Make sure you remember it. You will need it later to log in to phpMyAdmin. To make things simple you can set all passwords to “redmine”.
257 36 Anonymous
258 36 Anonymous
2.Create a new directory for Redmine. I put mine in /opt/redmine. And download the latest version of Redmine in to it with the wget command line downloader and extract it by issuing:
259 36 Anonymous
> sudo mkdir /opt/redmine
260 36 Anonymous
> sudo cd /opt/redmine
261 36 Anonymous
> sudo wget http://rubyforge.org/frs/download.php/66633/redmine-0.8.6.tar.gz
262 36 Anonymous
> tar -xvf redmine-0.8.6.tar.gz
263 36 Anonymous
264 36 Anonymous
h3. Database Setup
265 36 Anonymous
266 36 Anonymous
1.Now it’s time to create an empty database for Redmine. As you may have noticed, we installed phpMyAdmin earlier. phpMyAdmin will come in handy now. Head over to http://localhost/phpmyadmin. You should be presented with the phpMyAdmin login screen.
267 36 Anonymous
Type in “root” and the MySQL “password” you created when installing MySQL.
268 36 Anonymous
269 36 Anonymous
2.First, click on “Databases” then, at the bottom of the screen, in the “Create new database” text box create a new database called “redmine” and set “Collation” to “utf8_general_ci”.
270 36 Anonymous
271 36 Anonymous
3.Now, go back to the home screen and click on:
272 36 Anonymous
“Privileges”
273 36 Anonymous
“Add a new User”
274 36 Anonymous
Fill out the “Login Information” boxes. Call your user “redmine”. Make sure you remember password you create here. It will be used when you set up the database connection details in Redmine.
275 36 Anonymous
In the “Database for user” section, check “Create database with same name and grant all privileges” and click on the “Go” button.
276 36 Anonymous
277 36 Anonymous
4.Log out of phpMyAdmin.
278 36 Anonymous
279 36 Anonymous
h3. Redmine Database Connection Configuration
280 36 Anonymous
281 36 Anonymous
1.It’s time to configure the database connection. If you installed Redmine as I did above, then copy “config/database.yml.example” to “config/database.yml” and edit this file in order to configure your database settings for “production” environment. You’ll find the “database.yml.example” issuing:
282 36 Anonymous
> sudo cd /opt/redmine/redmine-0.8.6/config
283 36 Anonymous
284 36 Anonymous
2.So now, assuming you’re in the “/opt/redmine/redmine-0.8.6/config” directory, issue:
285 36 Anonymous
> sudo cp database.yml.example database.yml
286 36 Anonymous
287 36 Anonymous
3.Then, open the “database.yml” file, issue:
288 36 Anonymous
> sudo gedit database.yml
289 36 Anonymous
… and edit it as in the example for a MySQL database below:
290 36 Anonymous
291 36 Anonymous
production:
292 36 Anonymous
adapter: mysql
293 36 Anonymous
socket: /var/run/mysqld/mysqld.sock
294 36 Anonymous
database: redmine
295 36 Anonymous
host: localhost
296 36 Anonymous
username: redmine
297 36 Anonymous
password: [password]
298 36 Anonymous
299 36 Anonymous
Then save the “database.yml” file and exit to the command prompt.
300 36 Anonymous
On Ubuntu the “mysql.sock” is located in /var/run/mysqld/mysqld.sock, as noted in the “config” above.
301 36 Anonymous
(The standard Redmine installation assumes the socket is located in “/opt/redmine/redmine-0.8.6/tmp/mysqld.sock”.)
302 36 Anonymous
303 36 Anonymous
4.Create the database structure, by running the following command under the application root directory (I mean “/opt/redmine/redmine-0.8.6”):
304 36 Anonymous
> sudo rake db:migrate RAILS_ENV="production"
305 36 Anonymous
It will create the necessary tables in the redmine database you created earlier and an administrator account.
306 36 Anonymous
307 36 Anonymous
5.Insert the default configuration data in to the database, by issuing:
308 36 Anonymous
> sudo rake redmine:load_default_data RAILS_ENV="production"
309 36 Anonymous
(This step is optional but highly recommended, as you can define your own configuration from scratch. It will load default roles, trackers, statuses, work flows and enumerations. While loading default data command prompt wants to given language selection by you.)
310 36 Anonymous
311 36 Anonymous
h3. Setting up Permissions
312 36 Anonymous
313 36 Anonymous
1.The user who runs Redmine must have write permission on the following sub directories: “files”, “log”, “tmp” (create the last one if not present). You probably already have a “tmp” directory in /opt/redmine/redmine-0.8.6, but if you don’t, create one now by issuing:
314 36 Anonymous
> sudo mkdir /opt/redmine/redmine-0.8.6
315 36 Anonymous
316 36 Anonymous
2.If you haven’t created a Redmine user, do it now by issuing:
317 36 Anonymous
> sudo useradd redmine
318 36 Anonymous
319 36 Anonymous
3.Now, assuming you run Redmine with a redmine user, from your /opt/redmine/redmine-0.8.6 directory issue:
320 36 Anonymous
> sudo chown -R redmine:redmine files log tmp
321 36 Anonymous
> sudo chmod -R 755 files log tmp
322 36 Anonymous
323 36 Anonymous
h3. Testing the Installation
324 36 Anonymous
325 36 Anonymous
1.It should all be working now. Test the installation by running the WEBrick web server issue:
326 36 Anonymous
> sudo cd /opt/redmine/redmine-0.8.6
327 36 Anonymous
> sudo ruby script/server -e production
328 36 Anonymous
329 36 Anonymous
Once WEBrick has started, point your browser to http://localhost:3000/. Or, if you are using a browser on a computer other than the one you installed Redmine on, point your browser to http://192.168.1.10:3000/ (if that’s the IP address you gave your Redmine server). You should now see the application welcome page.
330 36 Anonymous
331 36 Anonymous
*Log in:*
332 36 Anonymous
333 36 Anonymous
1.Use default administrator account to log in:
334 36 Anonymous
Login : admin
335 36 Anonymous
Password : admin
336 36 Anonymous
337 36 Anonymous
2.You can go to Admin & Settings to modify application settings.
338 36 Anonymous
339 36 Anonymous
h3. Setting Up Static IP
340 36 Anonymous
341 36 Anonymous
1.An easier method for configuring a static IP address is to use your local DHCP server to assign a permanent IP to the VirtualBox OS mac address. That way you will not have to do anything inside VBS. Consult your network administrator.
342 36 Anonymous
343 36 Anonymous
2.Or you should determine the configuration parameters given below, and then you can configure your system to have a static IP address:
344 36 Anonymous
The desired IP address
345 36 Anonymous
Network mask and broadcast address
346 36 Anonymous
Gateway address
347 36 Anonymous
Your local DNS server address(es)
348 36 Anonymous
349 36 Anonymous
h3. Assigning Host Name and Domain for VirtualBox OS
350 36 Anonymous
351 36 Anonymous
1.An easier method for adding your IP address - Host name pair configuration to your DNS server . Consult your network administrator.
352 36 Anonymous
353 36 Anonymous
h2. Configuring the Passenger Apache module
354 36 Anonymous
355 36 Anonymous
Passenger is a module for apache2 that allows Apache to run Ruby on Rails applications. Install it thus:
356 36 Anonymous
357 36 Anonymous
>$ sudo gem install passenger
358 36 Anonymous
359 36 Anonymous
Then go to the passenger apache2 module installation directory and run @passenger-install-apache2-module@
360 36 Anonymous
361 36 Anonymous
> $ cd /var/lib/gems/1.X/gems/passenger-X.X.X/
362 36 Anonymous
363 36 Anonymous
> $ sudo bin/passenger-install-apache2-module
364 36 Anonymous
365 36 Anonymous
Next, configure Apache:
366 36 Anonymous
367 36 Anonymous
In /etc/apache2/mods-available/passenger.load we will add next line
368 36 Anonymous
369 36 Anonymous
> LoadModule passenger_module /var/lib/gems/1.X/gems/passenger-X.X.X/ext/apache2/mod_passenger.so
370 36 Anonymous
371 36 Anonymous
We have to edit the conf of the passenger apache2 module in /etc/apache2/mods-available/passenger.conf
372 36 Anonymous
373 36 Anonymous
> PassengerRoot /var/lib/gems/1.X/gems/passenger-X.X.X
374 36 Anonymous
> PassengerRuby /usr/bin/ruby1.X
375 36 Anonymous
376 36 Anonymous
And now we activate the module
377 36 Anonymous
378 36 Anonymous
> $ sudo a2enmod passenger
379 36 Anonymous
380 36 Anonymous
Apache virtualhost for redmine web app
381 36 Anonymous
382 36 Anonymous
<pre>
383 36 Anonymous
<VirtualHost *:80>
384 36 Anonymous
ServerName redmine.server.com
385 36 Anonymous
386 36 Anonymous
DocumentRoot /var/www/redmine/public
387 36 Anonymous
388 36 Anonymous
ServerAdmin user@server.com
389 36 Anonymous
LogLevel warn
390 36 Anonymous
ErrorLog /var/log/apache2/redmine_error
391 36 Anonymous
CustomLog /var/log/apache2/redmine_access combined
392 36 Anonymous
393 36 Anonymous
<Directory /var/www/redmine/public>
394 36 Anonymous
Options Indexes FollowSymLinks MultiViews
395 36 Anonymous
AllowOverride None
396 36 Anonymous
Order allow,deny
397 36 Anonymous
allow from all
398 36 Anonymous
</Directory>
399 36 Anonymous
</VirtualHost>
400 36 Anonymous
</pre>
401 36 Anonymous
402 36 Anonymous
subversion server config in apache
403 36 Anonymous
404 36 Anonymous
<pre>
405 36 Anonymous
<VirtualHost *:80>
406 36 Anonymous
ServerName svn.server.com
407 36 Anonymous
ServerAdmin user@server.com
408 36 Anonymous
ErrorLog /var/log/apache2/svn_error
409 36 Anonymous
CustomLog /var/log/apache2/svn_access combined
410 36 Anonymous
<Location /project>
411 36 Anonymous
DAV svn
412 36 Anonymous
SVNPath /var/lib/svn/project
413 36 Anonymous
414 36 Anonymous
AuthType Basic
415 36 Anonymous
AuthName "Trac system for Server projects"
416 36 Anonymous
AuthUserFile "/var/lib/svn/.htpasswd"
417 36 Anonymous
Require valid-user
418 36 Anonymous
<LimitExcept GET PROPFIND OPTIONS REPORT>
419 36 Anonymous
Require valid-user
420 36 Anonymous
</LimitExcept>
421 36 Anonymous
</Location>
422 36 Anonymous
</Virtualhost>
423 36 Anonymous
</pre>
424 36 Anonymous
425 36 Anonymous
h2. Sendmail Server Configuration
426 36 Anonymous
427 36 Anonymous
1.Before configuring email support for Redmine, we should download the sendmail application for Ubuntu, issue:
428 36 Anonymous
429 36 Anonymous
> sudo apt-get install sendmail
430 36 Anonymous
431 36 Anonymous
> sudo sendmailconfig
432 36 Anonymous
433 36 Anonymous
(Answer Yes to all questions which you will be asked)
434 36 Anonymous
435 36 Anonymous
2.It’s time to configure the server connection. Copy “config/email.yml.example” to “config/email.yml” and edit this file in order to configure your database settings for “production” environment. You’ll find the “email.yml.example” issue:
436 36 Anonymous
> sudo cd /opt/redmine/redmine-0.8.6/config
437 36 Anonymous
438 37 João Lencart e Silva
439 37 João Lencart e Silva
440 36 Anonymous
3.So now, assuming you’re in the “/config” directory, issue:
441 36 Anonymous
> sudo cp email.yml.example email.yml
442 36 Anonymous
443 36 Anonymous
4.Then, open the “email.yml” file, issue:
444 36 Anonymous
> sudo gedit email.yml
445 36 Anonymous
… and edit it as in the example for sendmail configuration below:
446 36 Anonymous
447 36 Anonymous
production:
448 36 Anonymous
delivery_method: :sendmail
449 36 Anonymous
sendmail_settings:
450 36 Anonymous
location: /usr/sbin/sendmail
451 36 Anonymous
arguments: -i -t
452 36 Anonymous
address: smtp.example.net
453 36 Anonymous
port: 25
454 36 Anonymous
domain: example.net
455 36 Anonymous
authentication: :none
456 36 Anonymous
user_name: redmine@example.net
457 36 Anonymous
password: redmine
458 36 Anonymous
459 36 Anonymous
Then save “email.yml” file and exit to the command prompt.
460 36 Anonymous
461 36 Anonymous
5.It’s time to configure the “environmet.rb” configuration. Open up the “environment.rb” and change “config.action_mailer.perform_deliveries = false” to “config.action_mailer.perform_deliveries = true” then save and close the “environment.rb”.
462 37 João Lencart e Silva
463 37 João Lencart e Silva
h2. Email configuration for Ubuntu 12.04 with redmine >v1.4.3
464 37 João Lencart e Silva
465 37 João Lencart e Silva
1. Instead of creating an email.yml, edit config/configuration.yml and add a section
466 37 João Lencart e Silva
<pre>
467 37 João Lencart e Silva
production:
468 37 João Lencart e Silva
   email_delivery:
469 37 João Lencart e Silva
     delivery_method: :smtp
470 37 João Lencart e Silva
...</pre>
471 37 João Lencart e Silva
472 37 João Lencart e Silva
or
473 37 João Lencart e Silva
474 37 João Lencart e Silva
<pre>production:
475 37 João Lencart e Silva
   email_delivery:
476 37 João Lencart e Silva
     delivery_method: :sendmail
477 37 João Lencart e Silva
...</pre>
478 37 João Lencart e Silva
479 37 João Lencart e Silva
Please see http://www.redmine.org/projects/redmine/wiki/EmailConfiguration for the correct format of the full email block.
480 37 João Lencart e Silva
481 37 João Lencart e Silva
2. **DO NOT CHANGE** environment.rb config.action_mailer.perform_deliveries. The correct way is changing configuration.yml and leaving the default config.action_mailer.perform_deliveries setting to false:
482 37 João Lencart e Silva
@config.action_mailer.perform_deliveries = false@
483 37 João Lencart e Silva
484 37 João Lencart e Silva
485 37 João Lencart e Silva
486 37 João Lencart e Silva
487 36 Anonymous
488 36 Anonymous
h2. Subversion Installation and Configuration
489 36 Anonymous
490 36 Anonymous
1.Before configuring Subversion support for Redmine, we should download the Subversion application for Ubuntu, issue:
491 36 Anonymous
> sudo apt-get install subversion
492 36 Anonymous
493 36 Anonymous
2.If your Redmine can't find the “subversion” command you can help to find by issuing:
494 36 Anonymous
· > sudo cd /opt/redmine/redmine-0.8.6/config
495 36 Anonymous
· > sudo gedit environment.rb
496 36 Anonymous
· Add ENV['PATH'] = "#{ENV['PATH']}:/subversion/path" line in it.
497 36 Anonymous
· Save and close the “environment.rb”
498 36 Anonymous
499 36 Anonymous
h2. Start Application at Boot Time
500 36 Anonymous
501 36 Anonymous
1.To automatically start the application on booting your server you need to modify your “crontab”, issue:
502 36 Anonymous
> export EDITOR=gedit
503 36 Anonymous
> crontab -e
504 36 Anonymous
505 36 Anonymous
2.Your “crontab” file will be presented. This is the list of programs that start at certain times or at boot. Add the following to the “crontab” (all on one line):
506 36 Anonymous
@reboot cd /opt/redmine/redmine-0.8.6 ; rm -f log/mongrel.pid ; mongrel_rails start -e production -p 3000 -d
507 36 Anonymous
508 36 Anonymous
h2. Backup
509 36 Anonymous
510 36 Anonymous
1.Running backups is always a good idea. Redmine backups should include:
511 36 Anonymous
* data (stored in your redmine database)
512 36 Anonymous
/usr/bin/mysqldump -u -p | gzip > /path/to/redmine/backup/db/redmine_`date +%y_%m_%d`.gz
513 36 Anonymous
* attachments (stored in the files directory of your Redmine install)
514 36 Anonymous
rsync -a /path/to/redmine/files /path/to/redmine/backup/files
515 36 Anonymous
516 36 Anonymous
2.Or you can use the bash shell to automate this kind of operation, issue:
517 36 Anonymous
> sudo cd /opt/redmine/redmine-0.8.6
518 36 Anonymous
> sudo mkdir backup
519 36 Anonymous
> sudo mkdir backup/db
520 36 Anonymous
> sudo mkdir backup/files
521 36 Anonymous
> sudo gedit backup/runRedmineBackup.bash
522 36 Anonymous
523 36 Anonymous
And after open “runRedmineBackup.bash” with gedit, write all commands below:
524 36 Anonymous
<pre>
525 36 Anonymous
#!/bin/bash
526 36 Anonymous
data=`date -I`
527 36 Anonymous
mysqldump --user=root --password="redmine" --all-databases | gzip > db/backup-$data.sql.gz
528 36 Anonymous
cd db
529 36 Anonymous
ftp -i -n << EOF
530 36 Anonymous
open ftpserver.example.net
531 36 Anonymous
user username password
532 36 Anonymous
bin
533 36 Anonymous
mput backup-$data.sql.gz
534 36 Anonymous
bye
535 36 Anonymous
EOF
536 36 Anonymous
</pre>
537 36 Anonymous
Then save the “runRedmineBackup.bash” file and exit to the command prompt. After creation of runRedmineBackup.bash you can add this bash script to run continually between specified periods. Issue:
538 36 Anonymous
539 36 Anonymous
> export EDITOR=gedit
540 36 Anonymous
> crontab -e
541 36 Anonymous
Add 0 0 * * 0 cd /opt/redmine/redmine-0.8.6/backup ; sh runRedmineBackup.bash commands to crontab to backup database weekly.
542 36 Anonymous
543 36 Anonymous
For this to work without any permission problems you have to change the permissions of the files to maximum, issue:
544 36 Anonymous
545 36 Anonymous
> sudo chmod -R 777 backup
546 36 Anonymous
> sudo chown -R redmine:redmine backup
547 36 Anonymous
548 36 Anonymous
That's all. Now we have completely installed Redmine on our virtual Ubuntu OS and can reach it from any machine in our network easily. Congratulations..!
549 36 Anonymous
550 36 Anonymous
h2. Sources & contributors.
551 36 Anonymous
552 36 Anonymous
* Ümit Uzun 06/11/2009.
553 36 Anonymous
* Some of the above material comes from Macada's wiki, licenced under the GNU Free Documentation License 1.2. See "Redmine in Ubuntu Jaunty 9.04":http://wiki.ousli.org/index.php/Redmine_in_Ubuntu_Jaunty_9.04 by David 'macada', last modified 2010-02-08, accessed 2010-05-26.
554 36 Anonymous
* Sam Wilson 2010-05-26, formatting changes.
555 36 Anonymous
* Allen Yeh 2010-09-08, Added apt-get install subversion into instructions for 10.04 otherwise once redmine is setup an error like this will result this error -> +*The entry or revision was not found in the repository.*+
556 36 Anonymous
557 36 Anonymous
h2. Additional Sources
558 36 Anonymous
559 36 Anonymous
* http://wiki.oseems.com/web/redmine/install-in-ubuntu