HowTo Install Redmine in Ubuntu » History » Version 21

Graham King, 2011-01-24 19:42
Grammar police, extremely minor edits

1 6 Roger Lipscombe
h1. Ubuntu 10.4 LTS using mod_cgi
2 3 Sam Wilson
3 7 Mischa The Evil
{{>toc}}
4 7 Mischa The Evil
5 14 allen yeh
As of 10.04, Redmine is available through Ubuntu's package manager, and installation is simple:
6 3 Sam Wilson
7 14 allen yeh
> $ sudo apt-get install redmine redmine-mysql subversion
8 3 Sam Wilson
9 3 Sam Wilson
The second package, _redmine-mysql_, can be replaced by either _redmine-pgsql_ or _redmine-sqlite_ if you want to use either of those databases.
10 3 Sam Wilson
11 3 Sam Wilson
Redmine will now be installed in @/usr/share/redmine@ and @/etc/redmine@
12 3 Sam Wilson
13 3 Sam Wilson
h2. Configuration
14 3 Sam Wilson
15 17 Tim M
> 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 if mod_cgi does not work for you.
16 17 Tim M
17 3 Sam Wilson
Symlink @/usr/share/redmine/public@ to your desired web-accessible location.  E.g.:
18 3 Sam Wilson
19 19 Peter Hobor
> $ sudo ln -s /usr/share/redmine/public /var/www/redmine
20 3 Sam Wilson
21 3 Sam Wilson
The other files that you need to modify/create are as follows:
22 3 Sam Wilson
23 13 allen yeh
@/etc/redmine/default/database.yml@:
24 3 Sam Wilson
25 3 Sam Wilson
<pre>
26 3 Sam Wilson
production:
27 3 Sam Wilson
  adapter: mysql
28 3 Sam Wilson
  database: redmine
29 3 Sam Wilson
  host: localhost
30 3 Sam Wilson
  username: redmine
31 3 Sam Wilson
  password: pa55w0rd
32 3 Sam Wilson
  encoding: utf8
33 3 Sam Wilson
</pre>
34 3 Sam Wilson
35 12 Rolf Wojtech
@/usr/share/redmine/public/dispatch.cgi@:
36 3 Sam Wilson
37 3 Sam Wilson
<pre>
38 3 Sam Wilson
#!/usr/bin/ruby
39 3 Sam Wilson
40 3 Sam Wilson
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
41 3 Sam Wilson
42 3 Sam Wilson
require "dispatcher"
43 3 Sam Wilson
44 3 Sam Wilson
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
45 3 Sam Wilson
Dispatcher.dispatch
46 3 Sam Wilson
</pre>
47 3 Sam Wilson
48 4 Sam Wilson
@/usr/share/redmine/public/.htaccess@:
49 3 Sam Wilson
50 3 Sam Wilson
<pre>
51 3 Sam Wilson
RewriteEngine On
52 3 Sam Wilson
RewriteBase /redmine
53 3 Sam Wilson
RewriteRule ^$ index.html [QSA]
54 3 Sam Wilson
RewriteRule ^([^.]+)$ $1.html [QSA]
55 3 Sam Wilson
RewriteCond %{REQUEST_FILENAME} !-f
56 3 Sam Wilson
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
57 3 Sam Wilson
</pre>
58 3 Sam Wilson
59 3 Sam Wilson
And that's it!  If these instructions didn't work for you, please expand them to include whatever is needed.
60 1 Umit Uzun
61 14 allen yeh
h1. Ubuntu 10.04 using Passenger
62 6 Roger Lipscombe
63 6 Roger Lipscombe
If you can't get it working with mod_cgi, you might want to try mod_passenger (it's also quicker):
64 5 Roger Lipscombe
65 14 allen yeh
> $ sudo apt-get install redmine redmine-mysql subversion
66 5 Roger Lipscombe
67 5 Roger Lipscombe
The second package, _redmine-mysql_, can be replaced by either _redmine-pgsql_ or _redmine-sqlite_ if you want to use either of those databases.
68 5 Roger Lipscombe
69 5 Roger Lipscombe
Ubuntu should prompt you for all the interesting details.
70 5 Roger Lipscombe
71 5 Roger Lipscombe
Redmine will now be installed in @/usr/share/redmine@ and @/etc/redmine@
72 5 Roger Lipscombe
73 5 Roger Lipscombe
h2. Configuration
74 5 Roger Lipscombe
75 5 Roger Lipscombe
Symlink @/usr/share/redmine/public@ to your desired web-accessible location.  E.g.:
76 5 Roger Lipscombe
77 20 Peter Hobor
> $ sudo ln -s /usr/share/redmine/public /var/www/redmine
78 5 Roger Lipscombe
79 5 Roger Lipscombe
By default, passenger runs as 'nobody', so you'll need to fix that. In @/etc/apache2/mods-available/passenger.conf@, add a @PassengerDefaultUser www-data@ directive.
80 5 Roger Lipscombe
81 5 Roger Lipscombe
You'll also need to configure the @/var/www/redmine@ location in @/etc/apache2/sites-available/default@:
82 5 Roger Lipscombe
83 5 Roger Lipscombe
<pre><Directory /var/www/redmine>
84 5 Roger Lipscombe
    RailsBaseURI /redmine
85 15 Spenser Gilliland
    PassengerResolveSymlinksInDocumentRoot on
86 5 Roger Lipscombe
</Directory>
87 5 Roger Lipscombe
</pre>
88 5 Roger Lipscombe
89 5 Roger Lipscombe
> $ sudo a2enmod passenger
90 5 Roger Lipscombe
91 5 Roger Lipscombe
Restart apache2 and you should be good to go.
92 17 Tim M
93 17 Tim M
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.
94 17 Tim M
95 17 Tim M
> $ sudo chmod a+x /usr/share/redmine/public
96 5 Roger Lipscombe
97 14 allen yeh
h1. Redmine Installation on Virtual or Normal Ubuntu < 10.04
98 1 Umit Uzun
99 21 Graham King
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.
100 1 Umit Uzun
101 2 Sam Wilson
h2. Step 1: Install Ubuntu
102 1 Umit Uzun
103 2 Sam Wilson
If you are installing on a non-virtual Ubuntu instance, please skip this section.
104 1 Umit Uzun
105 2 Sam Wilson
*Installing VirtualBox:*
106 2 Sam Wilson
107 21 Graham King
1.Download the latest version of Sun VirtualBox (version 3.0.10 or newer).
108 21 Graham King
2.Install VirtualBox by following the instructions.
109 1 Umit Uzun
110 1 Umit Uzun
*Installing Ubuntu on VirtualBox:*
111 1 Umit Uzun
112 21 Graham King
1.Download the latest version of Ubuntu (version 9.10 or newer).
113 21 Graham King
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.
114 1 Umit Uzun
115 21 Graham King
3.While installing Ubuntu you should enter the following configuration:
116 21 Graham King
(This suggested configuration is optional, you can enter any names you want.)
117 1 Umit Uzun
Q: What is your name? A: Redmine Server
118 1 Umit Uzun
Q: What name do you want to use to login? A: redmine
119 1 Umit Uzun
Q: Choose to password to keep your account safe? A: redmine
120 1 Umit Uzun
Q: What is the name of this computer? A: redmine-server
121 1 Umit Uzun
Choose “Log in automatically.” radio button.
122 1 Umit Uzun
123 21 Graham King
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:
124 1 Umit Uzun
> sudo apt-get update
125 1 Umit Uzun
> sudo apt-get upgrade
126 1 Umit Uzun
127 1 Umit Uzun
*Configuring VirtualBox:*
128 1 Umit Uzun
129 21 Graham King
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.
130 1 Umit Uzun
131 21 Graham King
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.
132 1 Umit Uzun
133 2 Sam Wilson
h2. Step 2: Install Redmine
134 1 Umit Uzun
135 2 Sam Wilson
Once you have a functioning Ubuntu operating system up and running, you can continue with installing Redmine.
136 1 Umit Uzun
137 2 Sam Wilson
h3. Install dependencies
138 2 Sam Wilson
139 2 Sam Wilson
The following packages are required to install and run Redmine.  Please install them by running @apt-get@ as root:
140 2 Sam Wilson
141 2 Sam Wilson
>sudo apt-get package-name
142 2 Sam Wilson
143 2 Sam Wilson
where @package-name@ is each of:
144 2 Sam Wilson
* apache2 
145 2 Sam Wilson
* apache2-threaded-dev 
146 2 Sam Wilson
* build-essential
147 2 Sam Wilson
* libapache-dbi-perl 
148 2 Sam Wilson
* libapache2-mod-perl2 
149 2 Sam Wilson
* libapache2-svn
150 2 Sam Wilson
* libdigest-sha1-perl 
151 2 Sam Wilson
* libgemplugin-ruby 
152 2 Sam Wilson
* libgemplugin-ruby1.8 
153 2 Sam Wilson
* libruby-extras 
154 2 Sam Wilson
* libruby1.8-extras 
155 2 Sam Wilson
* mongrel 
156 2 Sam Wilson
* mysql-server
157 2 Sam Wilson
* rails
158 2 Sam Wilson
* rake 
159 2 Sam Wilson
* ruby
160 2 Sam Wilson
* rubygems
161 2 Sam Wilson
* rubygems1.8
162 1 Umit Uzun
* ruby1.8-dev
163 2 Sam Wilson
* subversion
164 1 Umit Uzun
165 1 Umit Uzun
_(Could someone please clean up this list?)_
166 2 Sam Wilson
167 2 Sam Wilson
h3. Package Installation and Setup
168 16 Ian Epperson
169 1 Umit Uzun
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: 
170 1 Umit Uzun
> sudo apt-get install 
171 2 Sam Wilson
> sudo apt-get install 
172 21 Graham King
(_Surely some missing package names above?_)
173 1 Umit Uzun
174 1 Umit Uzun
The packages we’re installing above are MySQL, phpMyAdmin, Rails, Ruby Gems, Mongrel and Ruby Dev environment.
175 21 Graham King
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”.
176 1 Umit Uzun
177 21 Graham King
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:
178 1 Umit Uzun
> sudo mkdir /opt/redmine
179 1 Umit Uzun
> sudo cd /opt/redmine
180 1 Umit Uzun
> sudo wget http://rubyforge.org/frs/download.php/66633/redmine-0.8.6.tar.gz
181 1 Umit Uzun
> tar -xvf redmine-0.8.6.tar.gz
182 1 Umit Uzun
183 16 Ian Epperson
h3. Database Setup
184 1 Umit Uzun
185 1 Umit Uzun
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.
186 1 Umit Uzun
Type in “root” and the MySQL “password” you created when installing MySQL.
187 1 Umit Uzun
188 21 Graham King
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”.
189 1 Umit Uzun
190 1 Umit Uzun
3.Now, go back to the home screen and click on:
191 1 Umit Uzun
“Privileges”
192 1 Umit Uzun
“Add a new User” 
193 1 Umit Uzun
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.
194 1 Umit Uzun
In the “Database for user” section, check “Create database with same name and grant all privileges” and click on the “Go” button.
195 1 Umit Uzun
196 1 Umit Uzun
4.Log out of phpMyAdmin.
197 1 Umit Uzun
198 16 Ian Epperson
h3. Redmine Database Connection Configuration
199 1 Umit Uzun
200 1 Umit Uzun
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:
201 1 Umit Uzun
> sudo cd /opt/redmine/redmine-0.8.6/config
202 1 Umit Uzun
203 1 Umit Uzun
2.So now, assuming you’re in the “/opt/redmine/redmine-0.8.6/config” directory, issue:
204 1 Umit Uzun
> sudo cp database.yml.example database.yml 
205 1 Umit Uzun
206 1 Umit Uzun
3.Then, open the “database.yml” file, issue:
207 1 Umit Uzun
> sudo gedit database.yml
208 1 Umit Uzun
… and edit it as in the example for a MySQL database below:
209 1 Umit Uzun
210 1 Umit Uzun
production:
211 1 Umit Uzun
adapter: mysql
212 1 Umit Uzun
socket: /var/run/mysqld/mysqld.sock
213 1 Umit Uzun
database: redmine
214 1 Umit Uzun
host: localhost
215 1 Umit Uzun
username: redmine
216 1 Umit Uzun
password: [password]
217 1 Umit Uzun
218 21 Graham King
Then save the “database.yml” file and exit to the command prompt.
219 1 Umit Uzun
On Ubuntu the “mysql.sock” is located in /var/run/mysqld/mysqld.sock, as noted in the “config” above. 
220 1 Umit Uzun
(The standard Redmine installation assumes the socket is located in “/opt/redmine/redmine-0.8.6/tmp/mysqld.sock”.)
221 1 Umit Uzun
222 21 Graham King
4.Create the database structure, by running the following command under the application root directory (I mean “/opt/redmine/redmine-0.8.6”):
223 1 Umit Uzun
> sudo rake db:migrate RAILS_ENV="production" 
224 21 Graham King
It will create the necessary tables in the redmine database you created earlier and an administrator account.
225 1 Umit Uzun
226 21 Graham King
5.Insert the default configuration data in to the database, by issuing:
227 1 Umit Uzun
> sudo rake redmine:load_default_data RAILS_ENV="production" 
228 21 Graham King
(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.) 
229 1 Umit Uzun
230 16 Ian Epperson
h3.  Setting up Permissions
231 1 Umit Uzun
232 1 Umit Uzun
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:
233 1 Umit Uzun
> sudo mkdir /opt/redmine/redmine-0.8.6
234 1 Umit Uzun
235 1 Umit Uzun
2.If you haven’t created a Redmine user, do it now by issuing:
236 1 Umit Uzun
> sudo useradd redmine
237 1 Umit Uzun
238 1 Umit Uzun
3.Now, assuming you run Redmine with a redmine user, from your /opt/redmine/redmine-0.8.6 directory issue:
239 1 Umit Uzun
> sudo chown -R redmine:redmine files log tmp
240 1 Umit Uzun
> sudo chmod -R 755 files log tmp
241 1 Umit Uzun
242 16 Ian Epperson
h3.  Testing the Installation
243 1 Umit Uzun
244 1 Umit Uzun
1.It should all be working now. Test the installation by running the WEBrick web server issue:
245 1 Umit Uzun
> sudo cd /opt/redmine/redmine-0.8.6
246 1 Umit Uzun
> sudo ruby script/server -e production
247 1 Umit Uzun
	
248 21 Graham King
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. 
249 1 Umit Uzun
250 1 Umit Uzun
*Log in:*
251 1 Umit Uzun
252 1 Umit Uzun
1.Use default administrator account to log in:
253 1 Umit Uzun
Login : admin
254 1 Umit Uzun
Password : admin
255 1 Umit Uzun
256 1 Umit Uzun
2.You can go to Admin & Settings to modify application settings.
257 1 Umit Uzun
258 16 Ian Epperson
h3.  Setting Up Static IP
259 1 Umit Uzun
260 21 Graham King
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. 
261 1 Umit Uzun
262 21 Graham King
2.Or you should determine the configuration parameters given below, and then you can configure your system to have a static IP address:
263 1 Umit Uzun
The desired IP address
264 1 Umit Uzun
Network mask and broadcast address
265 1 Umit Uzun
Gateway address
266 1 Umit Uzun
Your local DNS server address(es)
267 1 Umit Uzun
268 16 Ian Epperson
h3.  Assigning Host Name and Domain for VirtualBox OS
269 1 Umit Uzun
270 21 Graham King
1.An easier method for adding your IP address - Host name pair configuration to your DNS server . Consult your network administrator.
271 1 Umit Uzun
272 2 Sam Wilson
h2. Configuring the Passenger Apache module
273 1 Umit Uzun
274 21 Graham King
Passenger is a module for apache2 that allows Apache to run Ruby on Rails applications.  Install it thus:
275 2 Sam Wilson
276 2 Sam Wilson
>$ sudo gem install passenger
277 2 Sam Wilson
278 2 Sam Wilson
Then go to the passenger apache2 module installation directory and run @passenger-install-apache2-module@
279 2 Sam Wilson
280 2 Sam Wilson
> $ cd /var/lib/gems/1.X/gems/passenger-X.X.X/
281 2 Sam Wilson
282 2 Sam Wilson
> $ sudo bin/passenger-install-apache2-module
283 2 Sam Wilson
284 2 Sam Wilson
Next, configure Apache:
285 2 Sam Wilson
286 2 Sam Wilson
In /etc/apache2/mods-available/passenger.load we will add next line
287 2 Sam Wilson
288 2 Sam Wilson
> LoadModule passenger_module /var/lib/gems/1.X/gems/passenger-X.X.X/ext/apache2/mod_passenger.so
289 2 Sam Wilson
290 2 Sam Wilson
We have to edit the conf of the passenger apache2 module in /etc/apache2/mods-available/passenger.conf
291 2 Sam Wilson
292 2 Sam Wilson
> PassengerRoot /var/lib/gems/1.X/gems/passenger-X.X.X
293 2 Sam Wilson
> PassengerRuby /usr/bin/ruby1.X
294 2 Sam Wilson
295 21 Graham King
And now we activate the module
296 2 Sam Wilson
297 2 Sam Wilson
> $ sudo a2enmod passenger
298 2 Sam Wilson
299 2 Sam Wilson
Apache virtualhost for redmine web app
300 2 Sam Wilson
301 2 Sam Wilson
<pre>
302 2 Sam Wilson
    <VirtualHost *:80>
303 2 Sam Wilson
        ServerName redmine.server.com
304 2 Sam Wilson
305 2 Sam Wilson
        DocumentRoot /var/www/redmine/public
306 2 Sam Wilson
307 2 Sam Wilson
        ServerAdmin user@server.com
308 2 Sam Wilson
        LogLevel warn
309 2 Sam Wilson
        ErrorLog /var/log/apache2/redmine_error
310 2 Sam Wilson
        CustomLog /var/log/apache2/redmine_access combined
311 2 Sam Wilson
312 2 Sam Wilson
        <Directory /var/www/redmine/public>
313 2 Sam Wilson
            Options Indexes FollowSymLinks MultiViews
314 2 Sam Wilson
            AllowOverride None
315 2 Sam Wilson
            Order allow,deny
316 2 Sam Wilson
            allow from all
317 2 Sam Wilson
        </Directory>
318 2 Sam Wilson
    </VirtualHost>
319 2 Sam Wilson
</pre>
320 2 Sam Wilson
321 1 Umit Uzun
subversion server config in apache
322 1 Umit Uzun
323 2 Sam Wilson
<pre>
324 2 Sam Wilson
    <VirtualHost *:80>
325 2 Sam Wilson
	ServerName svn.server.com
326 2 Sam Wilson
	ServerAdmin user@server.com
327 2 Sam Wilson
	ErrorLog /var/log/apache2/svn_error
328 2 Sam Wilson
       	CustomLog /var/log/apache2/svn_access combined
329 2 Sam Wilson
        <Location /project>
330 2 Sam Wilson
           DAV svn
331 2 Sam Wilson
           SVNPath /var/lib/svn/project
332 2 Sam Wilson
333 2 Sam Wilson
           AuthType Basic
334 2 Sam Wilson
           AuthName "Trac system for Server projects"
335 2 Sam Wilson
           AuthUserFile "/var/lib/svn/.htpasswd"
336 2 Sam Wilson
           Require valid-user 
337 2 Sam Wilson
	   <LimitExcept GET PROPFIND OPTIONS REPORT>
338 2 Sam Wilson
               Require valid-user
339 2 Sam Wilson
           </LimitExcept>
340 2 Sam Wilson
       </Location>
341 2 Sam Wilson
    </Virtualhost>
342 2 Sam Wilson
</pre>
343 2 Sam Wilson
344 16 Ian Epperson
h2. Sendmail Server Configuration
345 2 Sam Wilson
346 21 Graham King
1.Before configuring email support for Redmine, we should download the sendmail application for Ubuntu, issue:
347 1 Umit Uzun
> sudo apt-get install sendmail
348 21 Graham King
> sudo sendmailconfig (Answer Yes to all questions which you will be asked)
349 1 Umit Uzun
350 1 Umit Uzun
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:
351 1 Umit Uzun
> sudo cd /opt/redmine/redmine-0.8.6/config
352 1 Umit Uzun
353 1 Umit Uzun
3.So now, assuming you’re in the “/config” directory, issue:
354 1 Umit Uzun
> sudo cp email.yml.example email.yml 
355 1 Umit Uzun
356 1 Umit Uzun
4.Then, open the “email.yml” file, issue:
357 1 Umit Uzun
> sudo gedit email.yml
358 1 Umit Uzun
… and edit it as in the example for sendmail configuration below:
359 1 Umit Uzun
360 1 Umit Uzun
production:
361 1 Umit Uzun
delivery_method: :sendmail
362 1 Umit Uzun
sendmail_settings:
363 1 Umit Uzun
location: /usr/sbin/sendmail
364 1 Umit Uzun
arguments: -i -t
365 1 Umit Uzun
address: smtp.example.net
366 1 Umit Uzun
port: 25
367 1 Umit Uzun
domain: example.net
368 1 Umit Uzun
authentication: :none
369 1 Umit Uzun
user_name: redmine@example.net
370 1 Umit Uzun
password: redmine
371 1 Umit Uzun
372 1 Umit Uzun
Then save “email.yml” file and exit to the command prompt.
373 1 Umit Uzun
374 1 Umit Uzun
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”.
375 1 Umit Uzun
376 1 Umit Uzun
h2.  Subversion Installation and Configuration
377 1 Umit Uzun
378 21 Graham King
1.Before configuring Subversion support for Redmine, we should download the Subversion application for Ubuntu, issue:
379 1 Umit Uzun
> sudo apt-get install subversion
380 1 Umit Uzun
381 1 Umit Uzun
2.If your Redmine can't find the “subversion” command you can help to find by issuing:
382 1 Umit Uzun
· > sudo cd /opt/redmine/redmine-0.8.6/config
383 1 Umit Uzun
· > sudo gedit environment.rb
384 1 Umit Uzun
· Add ENV['PATH'] = "#{ENV['PATH']}:/subversion/path" line in it.
385 1 Umit Uzun
· Save and close the “environment.rb”
386 1 Umit Uzun
387 16 Ian Epperson
h2.  Start Application at Boot Time
388 1 Umit Uzun
389 1 Umit Uzun
1.To automatically start the application on booting your server you need to modify your “crontab”, issue:
390 1 Umit Uzun
> export EDITOR=gedit
391 1 Umit Uzun
> crontab -e
392 1 Umit Uzun
393 1 Umit Uzun
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):
394 1 Umit Uzun
@reboot cd /opt/redmine/redmine-0.8.6 ; rm -f log/mongrel.pid ; mongrel_rails start -e production -p 3000 -d
395 1 Umit Uzun
396 16 Ian Epperson
h2.  Backup
397 1 Umit Uzun
398 1 Umit Uzun
1.Running backups is always a good idea. Redmine backups should include:
399 16 Ian Epperson
* data (stored in your redmine database) 
400 1 Umit Uzun
/usr/bin/mysqldump -u -p | gzip > /path/to/redmine/backup/db/redmine_`date +%y_%m_%d`.gz
401 16 Ian Epperson
* attachments (stored in the files directory of your Redmine install)
402 1 Umit Uzun
rsync -a /path/to/redmine/files /path/to/redmine/backup/files
403 1 Umit Uzun
404 21 Graham King
2.Or you can use the bash shell to automate this kind of operation, issue:
405 1 Umit Uzun
> sudo cd /opt/redmine/redmine-0.8.6
406 1 Umit Uzun
> sudo mkdir backup
407 1 Umit Uzun
> sudo mkdir backup/db
408 1 Umit Uzun
> sudo mkdir backup/files
409 1 Umit Uzun
> sudo gedit backup/runRedmineBackup.bash
410 1 Umit Uzun
411 21 Graham King
And after open “runRedmineBackup.bash” with gedit, write all commands below:
412 16 Ian Epperson
<pre>
413 1 Umit Uzun
#!/bin/bash
414 1 Umit Uzun
data=`date -I`
415 1 Umit Uzun
mysqldump --user=root --password="redmine" --all-databases | gzip > db/backup-$data.sql.gz
416 1 Umit Uzun
cd db
417 1 Umit Uzun
ftp -i -n << EOF
418 1 Umit Uzun
open ftpserver.example.net
419 1 Umit Uzun
user username password
420 1 Umit Uzun
bin
421 1 Umit Uzun
mput backup-$data.sql.gz
422 1 Umit Uzun
bye
423 1 Umit Uzun
EOF
424 16 Ian Epperson
</pre>
425 21 Graham King
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:
426 1 Umit Uzun
427 1 Umit Uzun
> export EDITOR=gedit
428 1 Umit Uzun
> crontab -e
429 1 Umit Uzun
Add 0 0 * * 0 cd /opt/redmine/redmine-0.8.6/backup ; sh runRedmineBackup.bash commands to crontab to backup database weekly.
430 1 Umit Uzun
	
431 21 Graham King
For this to work without any permission problems you have to change the permissions of the files to maximum, issue:
432 1 Umit Uzun
433 1 Umit Uzun
> sudo chmod -R 777 backup
434 1 Umit Uzun
> sudo chown -R redmine:redmine backup
435 1 Umit Uzun
436 21 Graham King
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..!
437 1 Umit Uzun
438 1 Umit Uzun
h2. Sources & contributors.
439 2 Sam Wilson
440 2 Sam Wilson
* Ümit Uzun 06/11/2009.
441 2 Sam Wilson
* 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.
442 2 Sam Wilson
* Sam Wilson 2010-05-26, formatting changes.
443 14 allen yeh
* 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.*+
444 18 Glenn Gould
445 18 Glenn Gould
h2. Additional Sources
446 18 Glenn Gould
447 18 Glenn Gould
* http://www.techrecipes.net/web/redmine/install-in-ubuntu