Project

General

Profile

HowTo Install Redmine in Ubuntu » History » Version 67

Peter I, 2013-05-10 08:44

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 48 Recent Coin
These instructions assume that you have a basic Ubuntu server installation with command line access.  they assume that you have the rights to install a web server (Apache2) and a database (PostgreSQL or MySQL).  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 vertical grey bar.
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 52 Recent Coin
For MySQL: >apt-get install apache2 software-properties-common librmagick-ruby ruby-rmagick mysql-server mysql-client mysql-common 
46
For PostgreSQL:   >apt-get install apache2 software-properties-common librmagick-ruby ruby-rmagick postgresql
47 43 Recent Coin
48
49 44 Recent Coin
If you want to use another web server or data base, that is outside the scope of this document.
50 43 Recent Coin
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 58 Recent Coin
h2. Turn off apparmor for a bit so that it doesn't complain while we're installing everything
64 43 Recent Coin
65
> service apparmor stop
66
 - OR -
67
>/etc/init.d/apparmor stop
68
69 1 Umit Uzun
You can restart it once everything has been configured.
70 58 Recent Coin
71
Alternatively, you can set it into "whine" mode.
72
73
> aa-complain /usr/sbin/mysqld
74 1 Umit Uzun
75 44 Recent Coin
h2. Create your data base and your user for your redmine installation.
76 1 Umit Uzun
77 44 Recent Coin
There are a great many GUI's out there for most databases.  It is strongly recommended never to run your application as your "root" user on your database (e.g. MySQL root for MySQL or 'postgres' user for PostgreSQL).  There are also any number of tutorials on the creation of databases and granting of rights on them, so that it is really outside the scope of this document. These are pretty trivial to find on Google and if you are going to administer database driven applications its very advisable for you to become at least passingly familiar with SQL statements.
78
79 67 Peter I
For MySQL:  <pre>CREATE 'user'@'hostname' IDENTIFIED BY 'password';  CREATE DATABASE myredminedb; GRANT ALL ON myredminedb.* TO 'user'@'hostname'; FLUSH PRIVILEGES;</pre>
80 44 Recent Coin
81
For PostgreSQL: CREATE USER user WITH PASSWORD 'password'; CREATE DATABASE myredminedb;GRANT ALL PRIVILEGES ON DATABASE myredminedb to user;
82
83 46 Recent Coin
NOTE for PostgreSQL Users:  You will have to set the postgres user password before you can connect remotely.  MySQL will force you to set this during the installation but Postgres does not. To so do:
84
85
>su - postgres
86
>psql
87
88
This will take you to the postgres database prompt.  
89
90
>ALTER USER postgres with password 'my-secure-password';
91
92
This will set the password.  You can now proceed to editing the postgres configuration files so that you can connect remotely.
93
94 44 Recent Coin
h2. Install Redmine.
95
96 43 Recent Coin
---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.
97
98
For MySQL: >apt-get install redmine redmine-mysql
99 47 Recent Coin
For PostgreSQL: >apt-get install redmine redmine-pgsql
100 49 Recent Coin
For SQLite: 
101 43 Recent Coin
102 1 Umit Uzun
103 49 Recent Coin
The PostgreSQL installation will ask for the postgres user password so that it can create its own user, password, database, etc.  
104
105 36 Anonymous
106
The installation process should prompt you for all the interesting details.
107
108 45 Recent Coin
Redmine will now be installed in @/usr/share/redmine@ and the configuration files will be located in @/etc/redmine@
109 36 Anonymous
110
h2. Installing the latest Redmine
111 53 Recent Coin
112 51 Recent Coin
--If you are not happy with the older versions of Redmine that are in the official Ubuntu repositories (10.04 is stuck 0.9.x and 12.04 is stuck at 1.3.x while the current version is 2.2), this section is for you.  You still need to follow the steps in the other sections but this will get you the newer versions from the PPA/Launchpad here: https://launchpad.net/~ondrej/+archive/redmine
113 1 Umit Uzun
114 51 Recent Coin
*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.
115 1 Umit Uzun
116 51 Recent Coin
Run the following commands to export your proxy settings for both http (port 80) and https (port 443):
117
>export http_proxy="http://proxy.your.server:port" 
118
>export https_proxy="http:proxy.your.server:port"
119 1 Umit Uzun
120
121 51 Recent Coin
Otherwise, proceed to add the PPA to the list of repositories for your machine:
122
123
>add-apt-repository ppa:ondrej/redmine
124
>apt-get update
125
126
127
For MySQL: >apt-get install redmine redmine-mysql
128
For PostgreSQL: apt-get install redmine redmine-pgsql
129 36 Anonymous
130 66 Recent Coin
h2. The Long Way Home 
131 64 Recent Coin
132 66 Recent Coin
There is now a PPA for Quantal.  As I have not gotten the manual process to work properly, I will leave it to someone else to write this section.
133 55 Recent Coin
134 54 Recent Coin
h2. Apache Configuration
135 1 Umit Uzun
136 57 Recent Coin
You have two choices.  You can install Redmine as a dedicated server where www.example.com will serve Redmine by default.  You can also install Redmine for use as a directory on another server (e.g. www.example.com/redmine).
137 1 Umit Uzun
138 57 Recent Coin
h3.  Common configuration issues
139
By default, passenger runs as 'nobody', so you'll need to fix that. 
140
141
>cd /etc/apache2/mods-available
142
143
edit the passenger.conf by adding the line below 
144
<pre>PassengerDefaultUser www-data</pre>
145
146
> cd /etc/apache2/conf.d
147
148
edit security
149
Change ServerTokens OS to read ServerTokens Prod
150
Save the file
151
152
153
154 54 Recent Coin
h3. *Dedicated Server Configuration*
155
>cd /etc/apache2/sites-available
156
157 1 Umit Uzun
edit default with your choice of editor. 
158
ServerAdministrator youremail@email.com
159 57 Recent Coin
ServerName www.mydomain.com
160
ServerAlias mydomain.com
161 54 Recent Coin
162
Directly under this directive is 
163
<pre>
164
DocumentRoot /var/www
165
        <Directory />
166
                Options FollowSymLinks
167
                AllowOverride None
168
        </Directory>
169
</pre>
170
171
 
172
Change this to
173
<pre>
174
DocumentRoot /var/www
175
        <Directory />
176
                Options FollowSymLinks
177
                RailsBaseURI /
178 1 Umit Uzun
                PassengerResolveSymlinksinDocumentRoot on
179
                AllowOverride None
180
        </Directory>
181 56 Recent Coin
</pre>
182 1 Umit Uzun
183 56 Recent Coin
184 57 Recent Coin
If you want to force or not the www at the beginning of the URL
185
>a2enmod rewrite
186
Then add the appropriate rules to either the default file or a .htaccess file located in the new root directory.  
187 56 Recent Coin
188 57 Recent Coin
189 56 Recent Coin
>cd /var
190 54 Recent Coin
>mv www ww2
191 36 Anonymous
>ln -s /usr/share/redmine/public www
192
>service apache2 restart
193
194 1 Umit Uzun
Go browse your server.  You should be able to log in with the default user of "admin" and the default password of "admin".  
195
Change the user name and password immediately.
196
197
h3. *Shared Server Configuration*
198
199 57 Recent Coin
>cd /var/www
200 1 Umit Uzun
201 57 Recent Coin
Decide on the "folder" you want the webserver to run this out of - redmine, projects, tickets, etc.  Be sure to change the "myfoldername" in the directions to whatever you have decided to use.  
202 1 Umit Uzun
203 57 Recent Coin
>ln -s /usr/share/redmine/public myfoldername
204 1 Umit Uzun
205
206 57 Recent Coin
Now you must edit the default site (or other virtual host file)
207
208
>cd /etc/apache2/sites-available
209
210
edit default and add the following
211
212
<pre>ServerAdministrator youremail@email.com
213
ServerName www.mydomain.com
214
ServerAlias mydomain.com
215
</pre>
216
217
<pre><Directory /var/www/myfoldername>
218
RailsBaseURI /myfoldername
219 36 Anonymous
PassengerResolveSymlinksInDocumentRoot on
220 1 Umit Uzun
</Directory>
221 36 Anonymous
</pre>
222 1 Umit Uzun
223 59 Recent Coin
h3. Apparmor
224 36 Anonymous
225 59 Recent Coin
If you shut it down, now is the time to restart it.
226 1 Umit Uzun
227 59 Recent Coin
>service apparmor start
228
 -OR-
229 1 Umit Uzun
230 59 Recent Coin
>/etc/init.d/apparmor tart
231 1 Umit Uzun
232 59 Recent Coin
If you had it configured to complain, you should enable it again.  
233 1 Umit Uzun
234 59 Recent Coin
>aa-enforce /usr/sbin/mysqld
235 1 Umit Uzun
236 59 Recent Coin
237
h3. Final Steps
238
    
239
>service apache2 restart
240
241
- OR -
242
243
>/etc/init.d/apache2 restart
244
245
You may also want to consider installing something like fail2ban as well.
246
247
h3. Known Issues
248
249 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.
250
251 59 Recent Coin
>chmod a+x /usr/share/redmine/public
252
-OR-
253
chmod 755 /usr/share/redmine/public
254 36 Anonymous
255
h1. Ubuntu 10.04 or 12.04 using WEBrick
256
257 39 Yu Kobayashi
Using Passenger is recommended for the heavy load server. But WEBrick uses less memory.
258 38 Yu Kobayashi
259
Install Redmine: (See also _Installing the latest Redmine_ above)
260 36 Anonymous
261
> $ sudo apt-get install redmine redmine-mysql
262
263
Then, create this for /etc/init/redmine.conf
264
265
<pre>
266
# Redmine
267
268
description "Redmine"
269
270
start on runlevel [2345]
271
stop on runlevel [!2345]
272
273
expect daemon
274
exec ruby /usr/share/redmine/script/server webrick -e production -b 0.0.0.0 -d
275
</pre>
276
277
You can start Redmine by this. You can access by http://example.com:3000/
278
279
> $ sudo service redmine start
280
281
You can stop by this.
282
283
> $ sudo service redmine stop
284
285
h1. Ubuntu 10.04 using mod_cgi
286
287
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:
288
289
> $ sudo tasksel install lamp-server
290
291
Also, the default AppArmor configuration can get in the way, so you may need to set the mysqld profile to complain:
292
293
> $ sudo aa-complain /usr/sbin/mysqld
294
295
As of 10.04, Redmine is available through Ubuntu's package manager, and installation is simple:
296
297
> $ sudo apt-get install redmine redmine-mysql subversion
298
299
The second package, _redmine-mysql_, can be replaced by either _redmine-pgsql_ or _redmine-sqlite_ if you want to use either of those databases.
300
301
The installation process should prompt you for all the interesting details.
302
303
Redmine will now be installed in @/usr/share/redmine@ and @/etc/redmine@
304
305
If you set your AppArmor mysqld profile to complain you ought to set it back to enforce:
306
307
> $ sudo aa-enforce /usr/sbin/mysqld
308
309
h2. Configuration
310
311
> *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.*
312
313
Symlink @/usr/share/redmine/public@ to your desired web-accessible location. E.g.:
314
315 42 Roland Giesler
> $ sudo ln -s /usr/share/redmine/public /var/www/redmine
316
317
Also symlink @/var/cache/redmine/default/plugin_assets@ to your redmine directory. E.g.:
318
319
> $ sudo ln -s /var/cache/redmine/default/plugin_assets /usr/share/redmine/public/
320
321 36 Anonymous
This will ensure that any graphics or other resources are displayed in any installed add-ons.
322
323
The other files that you need to modify/create are as follows:
324
325
@/etc/redmine/default/database.yml@:
326
327
<pre>
328
production:
329
adapter: mysql
330
database: redmine
331
host: localhost
332
username: redmine
333
password: pa55w0rd
334
encoding: utf8
335
</pre>
336
337
@/usr/share/redmine/public/dispatch.cgi@:
338
339
<pre>
340
#!/usr/bin/ruby
341
342
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
343
344
require "dispatcher"
345
346
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
347
Dispatcher.dispatch
348
</pre>
349
350
@/usr/share/redmine/public/.htaccess@:
351
352
<pre>
353
RewriteEngine On
354
RewriteBase /redmine
355
RewriteRule ^$ index.html [QSA]
356
RewriteRule ^([^.]+)$ $1.html [QSA]
357
RewriteCond %{REQUEST_FILENAME} !-f
358
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
359
</pre>
360
361
And that's it! If these instructions didn't work for you, please expand them to include whatever is needed.
362
363
h1. Redmine Installation on Virtual or Normal Ubuntu < 10.04
364
365
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.
366
367
h2. Step 1: Install Ubuntu
368
369
If you are installing on a non-virtual Ubuntu instance, please skip this section.
370
371
*Installing VirtualBox:*
372
373
1.Download the latest version of Sun VirtualBox (version 3.0.10 or newer).
374
2.Install VirtualBox by following the instructions.
375
376
*Installing Ubuntu on VirtualBox:*
377
378
1.Download the latest version of Ubuntu (version 9.10 or newer).
379
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.
380
381
3.While installing Ubuntu you should enter the following configuration:
382
(This suggested configuration is optional, you can enter any names you want.)
383
Q: What is your name? A: Redmine Server
384
Q: What name do you want to use to login? A: redmine
385
Q: Choose to password to keep your account safe? A: redmine
386
Q: What is the name of this computer? A: redmine-server
387
Choose “Log in automatically.” radio button.
388
389
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:
390
> sudo apt-get update
391
> sudo apt-get upgrade
392
393
*Configuring VirtualBox:*
394
395
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.
396
397
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.
398
399
h2. Step 2: Install Redmine
400
401
Once you have a functioning Ubuntu operating system up and running, you can continue with installing Redmine.
402
403
h3. Install dependencies
404
405
The following packages are required to install and run Redmine. Please install them by running @apt-get@ as root:
406
407
>sudo apt-get install package-name
408
409
where @package-name@ is each of:
410
* apache2
411
* apache2-threaded-dev
412
* build-essential
413
* libapache-dbi-perl
414
* libapache2-mod-perl2
415
* libapache2-svn
416
* libdigest-sha1-perl
417
* libgemplugin-ruby
418
* libgemplugin-ruby1.8
419
* libruby-extras
420
* libruby1.8-extras
421
* mongrel
422
* mysql-server
423
* rails
424
* rake
425
* ruby
426
* rubygems
427
* rubygems1.8
428
* ruby1.8-dev
429
* subversion
430
431
_(Could someone please clean up this list?)_
432
433
h3. Package Installation and Setup
434
435
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:
436
> sudo apt-get install
437
> sudo apt-get install
438
(_Surely some missing package names above?_)
439
440
The packages we’re installing above are MySQL, phpMyAdmin, Rails, Ruby Gems, Mongrel and Ruby Dev environment.
441
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”.
442
443
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:
444
> sudo mkdir /opt/redmine
445
> sudo cd /opt/redmine
446
> sudo wget http://rubyforge.org/frs/download.php/66633/redmine-0.8.6.tar.gz
447
> tar -xvf redmine-0.8.6.tar.gz
448
449
h3. Database Setup
450
451
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.
452
Type in “root” and the MySQL “password” you created when installing MySQL.
453
454
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”.
455
456
3.Now, go back to the home screen and click on:
457
“Privileges”
458
“Add a new User”
459
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.
460
In the “Database for user” section, check “Create database with same name and grant all privileges” and click on the “Go” button.
461
462
4.Log out of phpMyAdmin.
463
464
h3. Redmine Database Connection Configuration
465
466
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:
467
> sudo cd /opt/redmine/redmine-0.8.6/config
468
469
2.So now, assuming you’re in the “/opt/redmine/redmine-0.8.6/config” directory, issue:
470
> sudo cp database.yml.example database.yml
471
472
3.Then, open the “database.yml” file, issue:
473
> sudo gedit database.yml
474
… and edit it as in the example for a MySQL database below:
475
476
production:
477
adapter: mysql
478
socket: /var/run/mysqld/mysqld.sock
479
database: redmine
480
host: localhost
481
username: redmine
482
password: [password]
483
484
Then save the “database.yml” file and exit to the command prompt.
485
On Ubuntu the “mysql.sock” is located in /var/run/mysqld/mysqld.sock, as noted in the “config” above.
486
(The standard Redmine installation assumes the socket is located in “/opt/redmine/redmine-0.8.6/tmp/mysqld.sock”.)
487
488
4.Create the database structure, by running the following command under the application root directory (I mean “/opt/redmine/redmine-0.8.6”):
489
> sudo rake db:migrate RAILS_ENV="production"
490
It will create the necessary tables in the redmine database you created earlier and an administrator account.
491
492
5.Insert the default configuration data in to the database, by issuing:
493
> sudo rake redmine:load_default_data RAILS_ENV="production"
494
(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.)
495
496
h3. Setting up Permissions
497
498
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:
499
> sudo mkdir /opt/redmine/redmine-0.8.6
500
501
2.If you haven’t created a Redmine user, do it now by issuing:
502
> sudo useradd redmine
503
504
3.Now, assuming you run Redmine with a redmine user, from your /opt/redmine/redmine-0.8.6 directory issue:
505
> sudo chown -R redmine:redmine files log tmp
506
> sudo chmod -R 755 files log tmp
507
508
h3. Testing the Installation
509
510
1.It should all be working now. Test the installation by running the WEBrick web server issue:
511
> sudo cd /opt/redmine/redmine-0.8.6
512
> sudo ruby script/server -e production
513
514
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.
515
516
*Log in:*
517
518
1.Use default administrator account to log in:
519
Login : admin
520
Password : admin
521
522
2.You can go to Admin & Settings to modify application settings.
523
524
h3. Setting Up Static IP
525
526
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.
527
528
2.Or you should determine the configuration parameters given below, and then you can configure your system to have a static IP address:
529
The desired IP address
530
Network mask and broadcast address
531
Gateway address
532
Your local DNS server address(es)
533
534
h3. Assigning Host Name and Domain for VirtualBox OS
535
536
1.An easier method for adding your IP address - Host name pair configuration to your DNS server . Consult your network administrator.
537
538
h2. Configuring the Passenger Apache module
539
540
Passenger is a module for apache2 that allows Apache to run Ruby on Rails applications. Install it thus:
541
542
>$ sudo gem install passenger
543
544
Then go to the passenger apache2 module installation directory and run @passenger-install-apache2-module@
545
546
> $ cd /var/lib/gems/1.X/gems/passenger-X.X.X/
547
548
> $ sudo bin/passenger-install-apache2-module
549
550
Next, configure Apache:
551
552
In /etc/apache2/mods-available/passenger.load we will add next line
553
554
> LoadModule passenger_module /var/lib/gems/1.X/gems/passenger-X.X.X/ext/apache2/mod_passenger.so
555
556
We have to edit the conf of the passenger apache2 module in /etc/apache2/mods-available/passenger.conf
557
558
> PassengerRoot /var/lib/gems/1.X/gems/passenger-X.X.X
559
> PassengerRuby /usr/bin/ruby1.X
560
561
And now we activate the module
562
563
> $ sudo a2enmod passenger
564
565
Apache virtualhost for redmine web app
566
567
<pre>
568
<VirtualHost *:80>
569
ServerName redmine.server.com
570
571
DocumentRoot /var/www/redmine/public
572
573
ServerAdmin user@server.com
574
LogLevel warn
575
ErrorLog /var/log/apache2/redmine_error
576
CustomLog /var/log/apache2/redmine_access combined
577
578
<Directory /var/www/redmine/public>
579
Options Indexes FollowSymLinks MultiViews
580
AllowOverride None
581
Order allow,deny
582
allow from all
583
</Directory>
584
</VirtualHost>
585
</pre>
586
587
subversion server config in apache
588
589
<pre>
590
<VirtualHost *:80>
591
ServerName svn.server.com
592
ServerAdmin user@server.com
593
ErrorLog /var/log/apache2/svn_error
594
CustomLog /var/log/apache2/svn_access combined
595
<Location /project>
596
DAV svn
597
SVNPath /var/lib/svn/project
598
599
AuthType Basic
600
AuthName "Trac system for Server projects"
601
AuthUserFile "/var/lib/svn/.htpasswd"
602
Require valid-user
603
<LimitExcept GET PROPFIND OPTIONS REPORT>
604
Require valid-user
605
</LimitExcept>
606
</Location>
607
</Virtualhost>
608
</pre>
609
610
h2. Sendmail Server Configuration
611
612
1.Before configuring email support for Redmine, we should download the sendmail application for Ubuntu, issue:
613
614
> sudo apt-get install sendmail
615
616
> sudo sendmailconfig
617
618
(Answer Yes to all questions which you will be asked)
619
620
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:
621 37 João Lencart e Silva
> sudo cd /opt/redmine/redmine-0.8.6/config
622
623 36 Anonymous
624
625
3.So now, assuming you’re in the “/config” directory, issue:
626
> sudo cp email.yml.example email.yml
627
628
4.Then, open the “email.yml” file, issue:
629
> sudo gedit email.yml
630
… and edit it as in the example for sendmail configuration below:
631
632
production:
633
delivery_method: :sendmail
634
sendmail_settings:
635
location: /usr/sbin/sendmail
636
arguments: -i -t
637
address: smtp.example.net
638
port: 25
639
domain: example.net
640
authentication: :none
641
user_name: redmine@example.net
642
password: redmine
643
644
Then save “email.yml” file and exit to the command prompt.
645 37 João Lencart e Silva
646
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”.
647
648
h2. Email configuration for Ubuntu 12.04 with redmine >v1.4.3
649
650
1. Instead of creating an email.yml, edit config/configuration.yml and add a section
651
<pre>
652
production:
653
   email_delivery:
654
     delivery_method: :smtp
655
...</pre>
656
657
or
658
659
<pre>production:
660
   email_delivery:
661
     delivery_method: :sendmail
662
...</pre>
663
664
Please see http://www.redmine.org/projects/redmine/wiki/EmailConfiguration for the correct format of the full email block.
665
666
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:
667
@config.action_mailer.perform_deliveries = false@
668
669
670 36 Anonymous
671
672
673
h2. Subversion Installation and Configuration
674
675
1.Before configuring Subversion support for Redmine, we should download the Subversion application for Ubuntu, issue:
676
> sudo apt-get install subversion
677
678
2.If your Redmine can't find the “subversion” command you can help to find by issuing:
679
· > sudo cd /opt/redmine/redmine-0.8.6/config
680
· > sudo gedit environment.rb
681
· Add ENV['PATH'] = "#{ENV['PATH']}:/subversion/path" line in it.
682
· Save and close the “environment.rb”
683
684
h2. Start Application at Boot Time
685
686
1.To automatically start the application on booting your server you need to modify your “crontab”, issue:
687
> export EDITOR=gedit
688
> crontab -e
689
690
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):
691
@reboot cd /opt/redmine/redmine-0.8.6 ; rm -f log/mongrel.pid ; mongrel_rails start -e production -p 3000 -d
692
693
h2. Backup
694
695
1.Running backups is always a good idea. Redmine backups should include:
696
* data (stored in your redmine database)
697
/usr/bin/mysqldump -u -p | gzip > /path/to/redmine/backup/db/redmine_`date +%y_%m_%d`.gz
698
* attachments (stored in the files directory of your Redmine install)
699
rsync -a /path/to/redmine/files /path/to/redmine/backup/files
700
701
2.Or you can use the bash shell to automate this kind of operation, issue:
702
> sudo cd /opt/redmine/redmine-0.8.6
703
> sudo mkdir backup
704
> sudo mkdir backup/db
705
> sudo mkdir backup/files
706
> sudo gedit backup/runRedmineBackup.bash
707
708
And after open “runRedmineBackup.bash” with gedit, write all commands below:
709
<pre>
710
#!/bin/bash
711
data=`date -I`
712
mysqldump --user=root --password="redmine" --all-databases | gzip > db/backup-$data.sql.gz
713
cd db
714
ftp -i -n << EOF
715
open ftpserver.example.net
716
user username password
717
bin
718
mput backup-$data.sql.gz
719
bye
720
EOF
721
</pre>
722
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:
723
724
> export EDITOR=gedit
725
> crontab -e
726
Add 0 0 * * 0 cd /opt/redmine/redmine-0.8.6/backup ; sh runRedmineBackup.bash commands to crontab to backup database weekly.
727
728
For this to work without any permission problems you have to change the permissions of the files to maximum, issue:
729
730
> sudo chmod -R 777 backup
731
> sudo chown -R redmine:redmine backup
732
733
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..!
734
735
h2. Sources & contributors.
736
737
* Ümit Uzun 06/11/2009.
738
* 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.
739
* Sam Wilson 2010-05-26, formatting changes.
740
* 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.*+
741
742 40 Mohd Shakir Zakaria
h2. Additional Sources
743 1 Umit Uzun
744
* http://docs.oseems.com/general/web/redmine/install-in-ubuntu