HowTo Install Redmine in Ubuntu » History » Version 33

Yu Kobayashi, 2012-02-25 10:53

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