HowTo Install Redmine in Ubuntu » History » Version 16

Ian Epperson, 2010-11-16 03:01
Made the section headers into headers with h2/h3 instead of bold tags. Added pre tags to the backup stuff to make it read properly.

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