Project

General

Profile

HowTo Install Redmine in Ubuntu » History » Version 43

Recent Coin, 2013-02-11 23:21
updating instructions to be more complete and detailed. also including system administration information.

1 43 Recent Coin
h1. Step-by-step for Ubuntu 12.04  or Ubuntu 10.04 using Passenger
2 41 Lee Butler
3
[[HowTo_Install_Redmine_on_Ubuntu_step_by_step|A step-by-step guide]] to getting Redmine running on a fresh installation of Ubuntu.
4
5 43 Recent Coin
h2. Assumptions In This Document 
6 36 Anonymous
7 43 Recent Coin
These instructions assume that you have a web server (Apache2) and a database (PostgreSQL or MySQL) already in place.  They also assume that you have the ability to carry out sudo commands and that you have at least a passing familiarity with the linux OS and file system.  Lines you should type in will be on their own line and will be preceded by a '>'.  
8 36 Anonymous
9 43 Recent Coin
h2. Become root or be prepared to type sudo before every command.  
10 36 Anonymous
11 43 Recent Coin
You can also save yourself a lot of time if you are doing a big install/configuration job by simply becoming 'real root' instead of typing sudo before everything by typing in either of these commands;
12 36 Anonymous
13 43 Recent Coin
>sudo -s
14 1 Umit Uzun
15 43 Recent Coin
 - OR - 
16 1 Umit Uzun
17 43 Recent Coin
>sudo -i
18 1 Umit Uzun
19 43 Recent Coin
Both will ask you to supply your password again and then you will get a # prompt which shows that you are "root" and no longer have to keep typing sudo. 
20 1 Umit Uzun
21 43 Recent Coin
h2. Be sure to run your updates before you start.  
22 1 Umit Uzun
23 43 Recent Coin
Be sure to check your /etc/apt/sources.list  You will probably want to comment out the "backports" and uncomment the extras and partners.  
24
25
>apt-get update
26
27
If you get any key errors for any of the repositories, you can fix them easily.  
28
29
A key error will look something like this:
30
31
W: GPG error: http://extras.ubuntu.com quantal Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 16126D3A3E5C1192
32
33
>gpg --keyserver hkp://subkeys.pgp.net --recv-keys 16126D3A3E5C1192
34
>gpg --export --armor 16126D3A3E5C1192 | sudo apt-key add - 
35
36
Note that the key (16126D3A3E5C1192) is the same in the error message, the key fetch request and the key import request.  What ever key you are missing can be fixed by through this process.  
37
38
39
>apt-get update && apt-get dist-upgrade
40
41
h2. Have your web server and data base installed
42
43
Installing Ubuntu's entire LAMP stack also installs PHP as well as the PHP connectors for apache, mysql, etc. If you are using RoR, installing all of that is probably unnecessary.  As a general rule of practice, it is best not to install anything you don't actually need.  That which isn't installed is not a potential security hole.  The statements below will install apache2 and the proper database.  
44
45
For MySQL: >apt-get install apache2 mysql-server mysql-client mysql-common 
46
For PostgreSQL:   >apt-get install apache2 postgresql
47
48
49
If you want to use another web server or data base, that is outside the scope of this document.  
50
51
h2. You must install mod_passenger for Apache2. 
52
> apt-get install libapache2-mod-passenger
53
54
Wait for the install to complete then you must enable the module and restart Apache2.
55
56
>a2enmod passenger
57
>service apache2 restart
58
 - OR -
59
>/etc/init.d/apache2 restart
60
61
Mod_passenger should now be enabled and visible to apache.
62
63
h2.Turn off apparmor for a bit so that it doesn't complain while we're installing everything
64
65
> service apparmor stop
66
 - OR -
67
>/etc/init.d/apparmor stop
68
69
You can restart it once everything has been configured.  
70
71
h2.Install Redmine itself.
72
73
---If you are happy with the packaged version, the you can use the packages from the Ubuntu repository.   The Ubuntu 10.04 package is stuck in the 0.9.x branch and the Ubuntu 12.04 package is stuck in the 1.3.x branch.
74
75
For MySQL: >apt-get install redmine redmine-mysql
76
For PostgreSQL: >apt-get install redmine redmin-postgresql
77
78 36 Anonymous
79
The second package, _redmine-mysql_, can be replaced by either _redmine-pgsql_ or _redmine-sqlite_ if you want to use either of those databases.
80
81
The installation process should prompt you for all the interesting details.
82
83
Redmine will now be installed in @/usr/share/redmine@ and @/etc/redmine@
84
85
h2. Installing the latest Redmine
86
87
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
88
89
To install redmine using the PPA:
90
91 38 Yu Kobayashi
> $ sudo add-apt-repository ppa:ondrej/redmine
92
> $ sudo apt-get update
93
> $ sudo apt-get install redmine redmine-mysql
94 36 Anonymous
95
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.
96
Run the following <pre>export http_proxy="http://proxy.your.server:port" and export https_proxy="http:proxy.your.server:port".</pre>
97
98
h2. Configuration
99
100
Symlink @/usr/share/redmine/public@ to your desired web-accessible location. E.g.:
101
102
> $ sudo ln -s /usr/share/redmine/public /var/www/redmine
103
104
By default, passenger runs as 'nobody', so you'll need to fix that. In @/etc/apache2/mods-available/passenger.conf@, add:
105
106 38 Yu Kobayashi
<pre>PassengerDefaultUser www-data</pre>
107 36 Anonymous
108
You'll also need to configure the @/var/www/redmine@ location in @/etc/apache2/sites-available/default@ by adding:
109
110
<pre><Directory /var/www/redmine>
111
RailsBaseURI /redmine
112
PassengerResolveSymlinksInDocumentRoot on
113
</Directory>
114
</pre>
115
116
If you set your AppArmor mysqld profile to complain you ought to set it back to enforce:
117
118
> $ sudo aa-enforce /usr/sbin/mysqld
119
120
Enable passenger:
121
122
> $ sudo a2enmod passenger
123
124
Restart apache2
125
126
> $ sudo service apache2 restart
127
128
and you should be able to access Redmine at: http://redmine.server.ip.address/redmine
129
130
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.
131
132
> $ sudo chmod a+x /usr/share/redmine/public
133
134
h1. Ubuntu 10.04 or 12.04 using WEBrick
135
136
Using Passenger is recommended for the heavy load server. But WEBrick uses less memory.
137
138 39 Yu Kobayashi
Install Redmine: (See also _Installing the latest Redmine_ above)
139 38 Yu Kobayashi
140
> $ sudo apt-get install redmine redmine-mysql
141 36 Anonymous
142
Then, create this for /etc/init/redmine.conf
143
144
<pre>
145
# Redmine
146
147
description "Redmine"
148
149
start on runlevel [2345]
150
stop on runlevel [!2345]
151
152
expect daemon
153
exec ruby /usr/share/redmine/script/server webrick -e production -b 0.0.0.0 -d
154
</pre>
155
156
You can start Redmine by this. You can access by http://example.com:3000/
157
158
> $ sudo service redmine start
159
160
You can stop by this.
161
162
> $ sudo service redmine stop
163
164
h1. Ubuntu 10.04 using mod_cgi
165
166
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:
167
168
> $ sudo tasksel install lamp-server
169
170
Also, the default AppArmor configuration can get in the way, so you may need to set the mysqld profile to complain:
171
172
> $ sudo aa-complain /usr/sbin/mysqld
173
174
As of 10.04, Redmine is available through Ubuntu's package manager, and installation is simple:
175
176
> $ sudo apt-get install redmine redmine-mysql subversion
177
178
The second package, _redmine-mysql_, can be replaced by either _redmine-pgsql_ or _redmine-sqlite_ if you want to use either of those databases.
179
180
The installation process should prompt you for all the interesting details.
181
182
Redmine will now be installed in @/usr/share/redmine@ and @/etc/redmine@
183
184
If you set your AppArmor mysqld profile to complain you ought to set it back to enforce:
185
186
> $ sudo aa-enforce /usr/sbin/mysqld
187
188
h2. Configuration
189
190
> *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.*
191
192
Symlink @/usr/share/redmine/public@ to your desired web-accessible location. E.g.:
193
194
> $ sudo ln -s /usr/share/redmine/public /var/www/redmine
195
196 42 Roland Giesler
Also symlink @/var/cache/redmine/default/plugin_assets@ to your redmine directory. E.g.:
197
198
> $ sudo ln -s /var/cache/redmine/default/plugin_assets /usr/share/redmine/public/
199
200
This will ensure that any graphics or other resources are displayed in any installed add-ons.
201
202 36 Anonymous
The other files that you need to modify/create are as follows:
203
204
@/etc/redmine/default/database.yml@:
205
206
<pre>
207
production:
208
adapter: mysql
209
database: redmine
210
host: localhost
211
username: redmine
212
password: pa55w0rd
213
encoding: utf8
214
</pre>
215
216
@/usr/share/redmine/public/dispatch.cgi@:
217
218
<pre>
219
#!/usr/bin/ruby
220
221
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
222
223
require "dispatcher"
224
225
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
226
Dispatcher.dispatch
227
</pre>
228
229
@/usr/share/redmine/public/.htaccess@:
230
231
<pre>
232
RewriteEngine On
233
RewriteBase /redmine
234
RewriteRule ^$ index.html [QSA]
235
RewriteRule ^([^.]+)$ $1.html [QSA]
236
RewriteCond %{REQUEST_FILENAME} !-f
237
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
238
</pre>
239
240
And that's it! If these instructions didn't work for you, please expand them to include whatever is needed.
241
242
h1. Redmine Installation on Virtual or Normal Ubuntu < 10.04
243
244
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.
245
246
h2. Step 1: Install Ubuntu
247
248
If you are installing on a non-virtual Ubuntu instance, please skip this section.
249
250
*Installing VirtualBox:*
251
252
1.Download the latest version of Sun VirtualBox (version 3.0.10 or newer).
253
2.Install VirtualBox by following the instructions.
254
255
*Installing Ubuntu on VirtualBox:*
256
257
1.Download the latest version of Ubuntu (version 9.10 or newer).
258
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.
259
260
3.While installing Ubuntu you should enter the following configuration:
261
(This suggested configuration is optional, you can enter any names you want.)
262
Q: What is your name? A: Redmine Server
263
Q: What name do you want to use to login? A: redmine
264
Q: Choose to password to keep your account safe? A: redmine
265
Q: What is the name of this computer? A: redmine-server
266
Choose “Log in automatically.” radio button.
267
268
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:
269
> sudo apt-get update
270
> sudo apt-get upgrade
271
272
*Configuring VirtualBox:*
273
274
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.
275
276
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.
277
278
h2. Step 2: Install Redmine
279
280
Once you have a functioning Ubuntu operating system up and running, you can continue with installing Redmine.
281
282
h3. Install dependencies
283
284
The following packages are required to install and run Redmine. Please install them by running @apt-get@ as root:
285
286
>sudo apt-get install package-name
287
288
where @package-name@ is each of:
289
* apache2
290
* apache2-threaded-dev
291
* build-essential
292
* libapache-dbi-perl
293
* libapache2-mod-perl2
294
* libapache2-svn
295
* libdigest-sha1-perl
296
* libgemplugin-ruby
297
* libgemplugin-ruby1.8
298
* libruby-extras
299
* libruby1.8-extras
300
* mongrel
301
* mysql-server
302
* rails
303
* rake
304
* ruby
305
* rubygems
306
* rubygems1.8
307
* ruby1.8-dev
308
* subversion
309
310
_(Could someone please clean up this list?)_
311
312
h3. Package Installation and Setup
313
314
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:
315
> sudo apt-get install
316
> sudo apt-get install
317
(_Surely some missing package names above?_)
318
319
The packages we’re installing above are MySQL, phpMyAdmin, Rails, Ruby Gems, Mongrel and Ruby Dev environment.
320
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”.
321
322
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:
323
> sudo mkdir /opt/redmine
324
> sudo cd /opt/redmine
325
> sudo wget http://rubyforge.org/frs/download.php/66633/redmine-0.8.6.tar.gz
326
> tar -xvf redmine-0.8.6.tar.gz
327
328
h3. Database Setup
329
330
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.
331
Type in “root” and the MySQL “password” you created when installing MySQL.
332
333
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”.
334
335
3.Now, go back to the home screen and click on:
336
“Privileges”
337
“Add a new User”
338
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.
339
In the “Database for user” section, check “Create database with same name and grant all privileges” and click on the “Go” button.
340
341
4.Log out of phpMyAdmin.
342
343
h3. Redmine Database Connection Configuration
344
345
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:
346
> sudo cd /opt/redmine/redmine-0.8.6/config
347
348
2.So now, assuming you’re in the “/opt/redmine/redmine-0.8.6/config” directory, issue:
349
> sudo cp database.yml.example database.yml
350
351
3.Then, open the “database.yml” file, issue:
352
> sudo gedit database.yml
353
… and edit it as in the example for a MySQL database below:
354
355
production:
356
adapter: mysql
357
socket: /var/run/mysqld/mysqld.sock
358
database: redmine
359
host: localhost
360
username: redmine
361
password: [password]
362
363
Then save the “database.yml” file and exit to the command prompt.
364
On Ubuntu the “mysql.sock” is located in /var/run/mysqld/mysqld.sock, as noted in the “config” above.
365
(The standard Redmine installation assumes the socket is located in “/opt/redmine/redmine-0.8.6/tmp/mysqld.sock”.)
366
367
4.Create the database structure, by running the following command under the application root directory (I mean “/opt/redmine/redmine-0.8.6”):
368
> sudo rake db:migrate RAILS_ENV="production"
369
It will create the necessary tables in the redmine database you created earlier and an administrator account.
370
371
5.Insert the default configuration data in to the database, by issuing:
372
> sudo rake redmine:load_default_data RAILS_ENV="production"
373
(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.)
374
375
h3. Setting up Permissions
376
377
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:
378
> sudo mkdir /opt/redmine/redmine-0.8.6
379
380
2.If you haven’t created a Redmine user, do it now by issuing:
381
> sudo useradd redmine
382
383
3.Now, assuming you run Redmine with a redmine user, from your /opt/redmine/redmine-0.8.6 directory issue:
384
> sudo chown -R redmine:redmine files log tmp
385
> sudo chmod -R 755 files log tmp
386
387
h3. Testing the Installation
388
389
1.It should all be working now. Test the installation by running the WEBrick web server issue:
390
> sudo cd /opt/redmine/redmine-0.8.6
391
> sudo ruby script/server -e production
392
393
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.
394
395
*Log in:*
396
397
1.Use default administrator account to log in:
398
Login : admin
399
Password : admin
400
401
2.You can go to Admin & Settings to modify application settings.
402
403
h3. Setting Up Static IP
404
405
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.
406
407
2.Or you should determine the configuration parameters given below, and then you can configure your system to have a static IP address:
408
The desired IP address
409
Network mask and broadcast address
410
Gateway address
411
Your local DNS server address(es)
412
413
h3. Assigning Host Name and Domain for VirtualBox OS
414
415
1.An easier method for adding your IP address - Host name pair configuration to your DNS server . Consult your network administrator.
416
417
h2. Configuring the Passenger Apache module
418
419
Passenger is a module for apache2 that allows Apache to run Ruby on Rails applications. Install it thus:
420
421
>$ sudo gem install passenger
422
423
Then go to the passenger apache2 module installation directory and run @passenger-install-apache2-module@
424
425
> $ cd /var/lib/gems/1.X/gems/passenger-X.X.X/
426
427
> $ sudo bin/passenger-install-apache2-module
428
429
Next, configure Apache:
430
431
In /etc/apache2/mods-available/passenger.load we will add next line
432
433
> LoadModule passenger_module /var/lib/gems/1.X/gems/passenger-X.X.X/ext/apache2/mod_passenger.so
434
435
We have to edit the conf of the passenger apache2 module in /etc/apache2/mods-available/passenger.conf
436
437
> PassengerRoot /var/lib/gems/1.X/gems/passenger-X.X.X
438
> PassengerRuby /usr/bin/ruby1.X
439
440
And now we activate the module
441
442
> $ sudo a2enmod passenger
443
444
Apache virtualhost for redmine web app
445
446
<pre>
447
<VirtualHost *:80>
448
ServerName redmine.server.com
449
450
DocumentRoot /var/www/redmine/public
451
452
ServerAdmin user@server.com
453
LogLevel warn
454
ErrorLog /var/log/apache2/redmine_error
455
CustomLog /var/log/apache2/redmine_access combined
456
457
<Directory /var/www/redmine/public>
458
Options Indexes FollowSymLinks MultiViews
459
AllowOverride None
460
Order allow,deny
461
allow from all
462
</Directory>
463
</VirtualHost>
464
</pre>
465
466
subversion server config in apache
467
468
<pre>
469
<VirtualHost *:80>
470
ServerName svn.server.com
471
ServerAdmin user@server.com
472
ErrorLog /var/log/apache2/svn_error
473
CustomLog /var/log/apache2/svn_access combined
474
<Location /project>
475
DAV svn
476
SVNPath /var/lib/svn/project
477
478
AuthType Basic
479
AuthName "Trac system for Server projects"
480
AuthUserFile "/var/lib/svn/.htpasswd"
481
Require valid-user
482
<LimitExcept GET PROPFIND OPTIONS REPORT>
483
Require valid-user
484
</LimitExcept>
485
</Location>
486
</Virtualhost>
487
</pre>
488
489
h2. Sendmail Server Configuration
490
491
1.Before configuring email support for Redmine, we should download the sendmail application for Ubuntu, issue:
492
493
> sudo apt-get install sendmail
494
495
> sudo sendmailconfig
496
497
(Answer Yes to all questions which you will be asked)
498
499
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:
500
> sudo cd /opt/redmine/redmine-0.8.6/config
501
502 37 João Lencart e Silva
503
504 36 Anonymous
3.So now, assuming you’re in the “/config” directory, issue:
505
> sudo cp email.yml.example email.yml
506
507
4.Then, open the “email.yml” file, issue:
508
> sudo gedit email.yml
509
… and edit it as in the example for sendmail configuration below:
510
511
production:
512
delivery_method: :sendmail
513
sendmail_settings:
514
location: /usr/sbin/sendmail
515
arguments: -i -t
516
address: smtp.example.net
517
port: 25
518
domain: example.net
519
authentication: :none
520
user_name: redmine@example.net
521
password: redmine
522
523
Then save “email.yml” file and exit to the command prompt.
524
525
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”.
526 37 João Lencart e Silva
527
h2. Email configuration for Ubuntu 12.04 with redmine >v1.4.3
528
529
1. Instead of creating an email.yml, edit config/configuration.yml and add a section
530
<pre>
531
production:
532
   email_delivery:
533
     delivery_method: :smtp
534
...</pre>
535
536
or
537
538
<pre>production:
539
   email_delivery:
540
     delivery_method: :sendmail
541
...</pre>
542
543
Please see http://www.redmine.org/projects/redmine/wiki/EmailConfiguration for the correct format of the full email block.
544
545
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:
546
@config.action_mailer.perform_deliveries = false@
547
548
549
550
551 36 Anonymous
552
h2. Subversion Installation and Configuration
553
554
1.Before configuring Subversion support for Redmine, we should download the Subversion application for Ubuntu, issue:
555
> sudo apt-get install subversion
556
557
2.If your Redmine can't find the “subversion” command you can help to find by issuing:
558
· > sudo cd /opt/redmine/redmine-0.8.6/config
559
· > sudo gedit environment.rb
560
· Add ENV['PATH'] = "#{ENV['PATH']}:/subversion/path" line in it.
561
· Save and close the “environment.rb”
562
563
h2. Start Application at Boot Time
564
565
1.To automatically start the application on booting your server you need to modify your “crontab”, issue:
566
> export EDITOR=gedit
567
> crontab -e
568
569
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):
570
@reboot cd /opt/redmine/redmine-0.8.6 ; rm -f log/mongrel.pid ; mongrel_rails start -e production -p 3000 -d
571
572
h2. Backup
573
574
1.Running backups is always a good idea. Redmine backups should include:
575
* data (stored in your redmine database)
576
/usr/bin/mysqldump -u -p | gzip > /path/to/redmine/backup/db/redmine_`date +%y_%m_%d`.gz
577
* attachments (stored in the files directory of your Redmine install)
578
rsync -a /path/to/redmine/files /path/to/redmine/backup/files
579
580
2.Or you can use the bash shell to automate this kind of operation, issue:
581
> sudo cd /opt/redmine/redmine-0.8.6
582
> sudo mkdir backup
583
> sudo mkdir backup/db
584
> sudo mkdir backup/files
585
> sudo gedit backup/runRedmineBackup.bash
586
587
And after open “runRedmineBackup.bash” with gedit, write all commands below:
588
<pre>
589
#!/bin/bash
590
data=`date -I`
591
mysqldump --user=root --password="redmine" --all-databases | gzip > db/backup-$data.sql.gz
592
cd db
593
ftp -i -n << EOF
594
open ftpserver.example.net
595
user username password
596
bin
597
mput backup-$data.sql.gz
598
bye
599
EOF
600
</pre>
601
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:
602
603
> export EDITOR=gedit
604
> crontab -e
605
Add 0 0 * * 0 cd /opt/redmine/redmine-0.8.6/backup ; sh runRedmineBackup.bash commands to crontab to backup database weekly.
606
607
For this to work without any permission problems you have to change the permissions of the files to maximum, issue:
608
609
> sudo chmod -R 777 backup
610
> sudo chown -R redmine:redmine backup
611
612
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..!
613
614
h2. Sources & contributors.
615
616
* Ümit Uzun 06/11/2009.
617
* 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.
618
* Sam Wilson 2010-05-26, formatting changes.
619
* 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.*+
620
621
h2. Additional Sources
622
623 40 Mohd Shakir Zakaria
* http://docs.oseems.com/general/web/redmine/install-in-ubuntu