Project

General

Profile

HowTo Install Redmine on Ubuntu step by step » History » Version 23

Anonymous, 2014-02-26 09:50

1 1 Lee Butler
h1. HowTo Install Redmine on Ubuntu step by step
2
3 17 Dietmar H
{{>toc}}
4
5 22 Anonymous
p. Before using or studying this guide you should check which Redmine version you are going for. Be aware that only latest stable releases will be fully compatible with current releases of plugins.
6 21 Anonymous
To check redmine versions versus your ubuntu version have a look at http://www.ubuntuupdates.org/pm/redmine
7 23 Anonymous
Generally you could also consider only installing ruby from ubuntu-repos and then heading for a release of redmine from redmine's download page: http://www.redmine.org/projects/redmine/wiki/Download . In this case you this *guide is not suited* for you and you should check for an alterante guide.
8 22 Anonymous
9 23 Anonymous
If you are sure that you want to install from ubuntu-repositories, keep on reading:
10 21 Anonymous
11 1 Lee Butler
p. This tutorial walks you step-by-step through installing Redmine on a clean/fresh Ubuntu 12.04 installation.  This is intended to be a complete cookbook method for getting Redmine installed and running.  It makes no assumptions about other things being installed or configured.  Since I have had some issues when using the graphical package managers, we will be doing this from the command line prompt to keep things as clear and clean as possible.
12
13 6 Lee Butler
p. I recommend that you install any Ubuntu updates prior to beginning this process.  There are almost always some waiting to be applied after Ubuntu is first set up.
14 1 Lee Butler
15 3 Lee Butler
h2. Prerequisites:  Apache, mod-passenger, and MySQL
16 1 Lee Butler
17 3 Lee Butler
p. There are several support packages that we will install first.  The apache installation is pretty simple if you just follow the prompts and accept the defaults.
18
<pre>$ sudo apt-get install apache2 libapache2-mod-passenger</pre>
19 1 Lee Butler
20 3 Lee Butler
Installing mysql takes just a little more, so the details are spelled out.
21
22
<pre>$ sudo apt-get install mysql-server mysql-client </pre>
23
24 1 Lee Butler
p. The installation process for mysql is going to prompt you for a password for the "root" access for the database server, then ask you to confirm the password in a follow-up screen.  This sets the database adminstration password.
25
26
<pre>Package configuration                                                           
27
28
  ┌────────────────────┤ Configuring mysql-server-5.5 ├─────────────────────┐   
29
  │ While not mandatory, it is highly recommended that you set a password   │   
30
  │ for the MySQL administrative "root" user.                               │   
31
  │                                                                         │   
32
  │ If this field is left blank, the password will not be changed.          │   
33
  │                                                                         │   
34
  │ New password for the MySQL "root" user:                                 │   
35
  │                                                                         │   
36
  │ _______________________________________________________________________ │   
37
  │                                                                         │   
38
  │                                 <Ok>                                    │   
39
  │                                                                         │   
40
  └─────────────────────────────────────────────────────────────────────────┘   
41
</pre>
42
<pre>
43
  ┌────┤ Configuring mysql-server-5.5 ├──────────┐
44
  │                                              │
45
  │ Repeat password for the MySQL "root" user.   │
46
  │                                              │
47
  │                                              │
48
  │ ____________________________________________ │
49
  │                                              │
50
  │                   <Ok>                       │
51
  │                                              │
52
  └──────────────────────────────────────────────┘
53
</pre>
54
55 3 Lee Butler
h2. Installing and configuring the Ubuntu Redmine package
56
57 2 Lee Butler
p. Now it is time to install redmine itself.  
58
<pre>
59 1 Lee Butler
$ sudo apt-get install redmine redmine-mysql
60
</pre>
61
62
63
p. You want to allow dbconfig-common to configure the database when prompted so select *Yes* from the prompt in the panel below.
64
<pre>
65
Package configuration                                                           
66
                                                                                
67
 ┌──────────────────────────┤ Configuring redmine ├──────────────────────────┐  
68
 │                                                                           │  
69
 │ The redmine/instances/default package must have a database installed and  │  
70
 │ configured before it can be used.  This can be optionally handled with    │  
71
 │ dbconfig-common.                                                          │  
72
 │                                                                           │  
73
 │ If you are an advanced database administrator and know that you want to   │  
74
 │ perform this configuration manually, or if your database has already      │  
75
 │ been installed and configured, you should refuse this option.  Details    │  
76
 │ on what needs to be done should most likely be provided in                │  
77
 │ /usr/share/doc/redmine/instances/default.                                 │  
78
 │                                                                           │  
79
 │ Otherwise, you should probably choose this option.                        │  
80
 │                                                                           │  
81
 │ Configure database for redmine/instances/default with dbconfig-common?    │  
82
 │                                                                           │  
83
 │                    <Yes>                       <No>                       │  
84
 │                                                                           │  
85
 └───────────────────────────────────────────────────────────────────────────┘  
86
</pre>
87
88
p. Then you want to provide the "root" password for the database, so that the installer can create the redmine database.  This is the password set when you installed mysql.
89
90
<pre>
91
Package configuration                                                           
92
                                                                                
93
 ┌──────────────────────────┤ Configuring redmine ├──────────────────────────┐  
94
 │ Please provide the password for hte administrative account with which     │  
95
 │ this package should create its MySQL database and user.                   │  
96
 │                                                                           │  
97
 │ Password of the database's administrative user:                           │  
98
 │                                                                           │  
99
 │ ******__________________________________________________________________  │  
100
 │                                                                           │  
101
 │                   <Ok>                       <Cancel>                     │  
102
 │                                                                           │  
103
 └───────────────────────────────────────────────────────────────────────────┘  
104
</pre>
105
106
p. Tell the redmine installer we are using mysql for this installation by highlighting "mysql" from the list of database choices:
107
108
<pre>
109
Package configuration                                                           
110
                                                                                
111
 ┌──────────────────────────┤ Configuring redmine ├──────────────────────────┐  
112
 │ The redmine/instances/default package can be configured to use one of     │  
113
 │ several database types. Below, you will be presented with the available   │  
114
 │ choices.                                                                  │  
115
 │                                                                           │  
116
 │ Database type to be used by redmine/instances/default:                    │  
117
 │                                                                           │  
118
 │                                  sqlite3                                  │  
119
 │                                  pgsql                                    │  
120
 │                                  mysql                                    │  
121
 │                                                                           │  
122
 │                                                                           │  
123
 │                    <Ok>                        <Cancel>                   │  
124
 │                                                                           │  
125
 └───────────────────────────────────────────────────────────────────────────┘  
126
</pre>
127
128
p. Now you are asked to provide a password that will be used to protect the redmine database.  Redmine itself will use this when it wants to access mysql.
129
130
<pre>
131
Package configuration                                                           
132
133
 ┌──────────────────────────┤ Configuring redmine ├──────────────────────────┐  
134
 │ Please provide a password for redmine/instances/default to register with  │  
135
 │ the database server.  If left blank, a random password will be            │  
136
 │ generated.                                                                │  
137
 │                                                                           │  
138
 │ MySQL application password for redmine/instances/default:                 │  
139
 │                                                                           │  
140
 │ *******__________________________________________________________________ │  
141
 │                                                                           │  
142
 │                    <Ok>                        <Cancel>                   │  
143
 │                                                                           │  
144
 └───────────────────────────────────────────────────────────────────────────┘ 
145
</pre>
146
147
Now confirm the redmine password.
148
149
<pre>
150
Package configuration                                                           
151
                                                                                
152
   ┌────┤ Configuring redmine ├─────┐                       
153
   │                                │                       
154
   │                                │                       
155
   │ Password confirmation:         │                       
156
   │                                │                       
157
   │ *******_______________________ │                       
158
   │                                │                       
159
   │     <Ok>         <Cancel>      │                       
160
   │                                │                       
161
   └────────────────────────────────┘   
162
</pre>
163
164 3 Lee Butler
h2. Configuring Apache
165
166 1 Lee Butler
p. You need to modify two files for apache.  The first is /etc/apache2/mods-available/passenger.conf which needs the text *PassengerDefaultUser www-data* added as seen here:
167
<pre>
168
<IfModule mod_passenger.c>
169
  PassengerDefaultUser www-data
170
  PassengerRoot /usr
171
  PassengerRuby /usr/bin/ruby
172
</IfModule>
173
</pre>
174
175
Now create a symlink to connect Redmine into the web document space:
176
<pre>
177
$ sudo ln -s /usr/share/redmine/public /var/www/redmine
178
</pre>
179
180
p. And modify /etc/apache2/sites-available/default to insert the following with the other <Directory> sections so that apache knows to follow the symlink into Rails:
181
<pre>
182
<Directory /var/www/redmine>
183
	RailsBaseURI /redmine
184
	PassengerResolveSymlinksInDocumentRoot on
185
</Directory>
186
</pre>
187
188
Now restart apache:
189
<pre>
190
$ sudo service apache2 restart
191
</pre>
192
193
p. You should now be able to access redmine from the local host
194
<pre>$ firefox http://127.0.0.1/redmine
195
</pre>
196
197
198
p. In the upper right corner of the browser window you should see the "Sign in" link.  Click that and enter "admin" at both the *Login:* and *Password:* prompts.  Note: _this is not the password you set during the installation process_.  Click the *Login* button.
199
200
p. I recommend that the next thing you do is to click on *My account* in the upper right corner and change that password.  In the page that is displayed there should be a *Change password* link in the upper right of the white area of the page.  Click to change the password.
201 3 Lee Butler
202 4 Lee Butler
203 5 Lee Butler
h2. Backing up Redmine
204 4 Lee Butler
205 14 Lee Butler
p. You should arrange a regular backup of the Redmine database and the files that users upload/attach.  The database can be dumped to a text file with:
206
<pre>/usr/bin/mysqldump -u root -p<password> redmine_default | gzip > /path/to/backups/redmine_db_`date +%y_%m_%d`.gz</pre>where <password> is the one you set when installing mysql.
207 1 Lee Butler
208 14 Lee Butler
p. The attachments are stashed in /var/lib/redmine/default/files and can be backed up with something like:
209
<pre>rsync -a /var/lib/redmine/default/files /path/to/backups/files</pre>
210 13 Lee Butler
211 14 Lee Butler
p. You can have these commands run automatically by creating a script called /etc/cron.daily/redmine that contains:
212
<pre>#!/bin/sh
213 4 Lee Butler
/usr/bin/mysqldump -u root -p<password> redmine_default | gzip > /path/to/backups/redmine_db_`date +%y_%m_%d`.gz
214 14 Lee Butler
rsync -a /var/lib/redmine/default/files /path/to/backups/files</pre>
215 13 Lee Butler
216 15 Lee Butler
p. Again, be sure to substitute the mysql root password for <password> in the mysqldump command line.  The file should be protected so that only root has read permission because you are storing the root password for your mysql installation in this file.  That the first line creates a new file every time the script is run.  This can eventually create a large number of backups of your database files.  You should have a script that purges old ones periodically.
217 14 Lee Butler
218 16 Lee Butler
h1. Additional semi-optional packages
219 3 Lee Butler
220
There are some services that Redmine can use that are not absolutely necessary, but are useful.  These are email and software repository/revision control systems.
221
222 16 Lee Butler
h2. Email setup
223 3 Lee Butler
224 19 Lee Butler
p. At some point you will probably want Redmine to be able to send email.  For this you will need to install and configure email.  This can be achieved by installing the *postfix* package.  I do not recommend the exim4 package, as there have been some incompatibilities in the way the "sendmail" command line is handled between Redmine and exim4.  Unless everyone has an email account on the redmine server you will want to set up external email as a full internet host.  Once email service is installed, you will have to restart apache for Redmine to know that it has access to email services.
225 3 Lee Butler
226 20 Lee Butler
<pre>$ sudo apt-get install postfix</pre>
227 1 Lee Butler
228 16 Lee Butler
p. Now that you can send email, you have to tell Redmine about it.  You need to create/edit the file */etc/redmine/default/configuration.yml* and add the following lines:
229
<pre>
230
production:
231
  email_delivery:
232
    delivery_method: :sendmail
233
</pre>
234
235
Then restart apache so that Redmine reloads the configuration file:
236
237 18 Lee Butler
<pre>$ sudo service apache2 restart</pre>
238
239 16 Lee Butler
h2. Revision control repository setup
240 3 Lee Butler
241
p. In order to have your software repository on the system Redmine will need the corresponding software installed.  
242
243
<pre>$ sudo apt-get install git subversion cvs mercurial
244
$ sudo service apache2 restart
245
</pre>
246
247
That covers it as far as I have gotten in my use of Redmine to date.