Project

General

Profile

HowTo Install Redmine 212 in Ubuntu 1210 and Apache Passenger » History » Version 3

Julian Perelli, 2012-11-07 18:32

1 1 Julian Perelli
h1. HowTo Install Redmine 212 in Ubuntu 1210 and Apache Passenger
2
3
Inspired in "HowTo Install Redmine 210 on Debian Squeeze with Apache Passenger", from this same wiki, so meta-kudos, to the original authors.
4
5
h2. Assumptions
6
7
* We will be using redmine.example.com; so every time you see this below, replace it by your own domain
8 3 Julian Perelli
* For this to work maybe you shold edit /etc/hosts file adding a line "127.0.0.1 redmine.example.com"
9 1 Julian Perelli
* If you are behind a proxy, you could do export http_proxy="http://proxy.domain.tld:port" and the installation should work ok.
10
11
h2. Warming up
12
13
We will first need to install basic packages:
14
<pre>
15
apt-get install ruby rubygems libruby libapache2-mod-passenger
16
</pre>
17
Download the latest version of Redmine (2.1.2 in our case) and untar it, then move it to /usr/local/share
18
<pre>
19 2 Julian Perelli
wget http://rubyforge.org/frs/download.php/76495/redmine-2.1.2.tar.gz
20 1 Julian Perelli
tar -xzvf redmine-2.1.2.tar.gz
21
ln /usr/local/share/redmine-2.1.2 /usr/local/share/redmine
22
chown -R root:root /usr/local/share/redmine-2.1.2
23
</pre>
24
25 2 Julian Perelli
Install development libraries for MySQL and Imagick:
26 1 Julian Perelli
<pre>
27 2 Julian Perelli
apt-get install libmysqlclient-dev libmagickcore-dev libmagickwand-dev (install shitload of packages)
28 1 Julian Perelli
</pre>
29
30
h2. Running the Gem stuff
31
32
Install Bundler (removing useless module, which would otherwise create dependencies):
33
<pre>
34
gem install bundler
35
cd /usr/local/share/redmine/
36 3 Julian Perelli
bundle install --without development test postgresql sqlite
37 1 Julian Perelli
</pre>
38
39
h2. Configuration
40
41
Copy config/database.yml.example to config/database.yml and edit this file in order to configure your database settings for "production" environment.
42
Example for a MySQL database using ruby1.8 or jruby:
43
<pre>
44
production:
45 3 Julian Perelli
  adapter: mysql2
46 1 Julian Perelli
  database: redmine
47
  host: localhost
48
  username: redmine
49
  password: my_password
50
</pre>
51
52
Generate a session store secret:
53
<pre>
54 3 Julian Perelli
rake generate_secret_token
55 1 Julian Perelli
</pre>
56
57
Generate the database structure:
58
<pre>
59 3 Julian Perelli
RAILS_ENV=production rake db:migrate
60 1 Julian Perelli
</pre>
61
62
Generate default configuration data:
63
<pre>
64 3 Julian Perelli
RAILS_ENV=production rake redmine:load_default_data
65 1 Julian Perelli
</pre>
66
(using “es” for Spanish language in terminal prompt)
67
68
Setup config file in config/configuration.yml
69
70
Change database_ciphr_key: *******
71
<pre>
72 3 Julian Perelli
rake db:encrypt RAILS_ENV=production
73 1 Julian Perelli
</pre>
74
75
h2. Apache
76
77
Setup Apache’s VirtualHost config
78
79
<pre>
80
# 8080 in this case is because we use a reverse proxy before Apache. Otherwise simply use "*:80"
81
82
<VirtualHost *:8080>
83
 ServerName redmine.example.com
84
 DocumentRoot /usr/local/share/redmine/public
85
 <Directory /usr/local/share/redmine/public>
86
   AllowOverride all
87
   Options -MultiViews
88
 </Directory>
89
</VirtualHost>
90
</pre>
91
92 3 Julian Perelli
Once you enable this virtual host (a2ensite redmine.example.com) and reload Apache (apache2ctl graceful), you should see your site running on http://redmine.example.com.
93 1 Julian Perelli
94
The default login/password is admin/admin (don't forget to change this).
95
96
h2. Sources of inspiration
97
98
We used the following resources as a starting point. Thanks to their respective authors.
99
100
* http://madpropellerhead.com/random/20100820-installing-redmine-on-debian-with-apache (outdated, for Lenny)
101
* http://www.redmine.org/projects/redmine/wiki/RedmineInstall
102
* http://hodza.net/2012/03/15/howto-install-redmine-on-debian-6-squeeze-ruby-on-rails-apache2-passenger/
103
* http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Debian_with_Ruby-on-Rails_and_Apache2-Passenger