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

Julian Perelli, 2012-11-07 18:29

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