Project

General

Profile

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

Roland Giesler, 2013-01-18 14:48
On first access after installation, Redmine does not run, but it requests this to be installed

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 5 ian stoddart
apt-get install ruby rubygems libruby libapache2-mod-passenger ruby-dev
16 1 Julian Perelli
</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 4 Julian Perelli
cd /usr/local/share/
20 2 Julian Perelli
wget http://rubyforge.org/frs/download.php/76495/redmine-2.1.2.tar.gz
21 1 Julian Perelli
tar -xzvf redmine-2.1.2.tar.gz
22 7 ian stoddart
ln -s /usr/local/share/redmine-2.1.2 /usr/local/share/redmine
23 1 Julian Perelli
chown -R root:root /usr/local/share/redmine-2.1.2
24
</pre>
25
26 2 Julian Perelli
Install development libraries for MySQL and Imagick:
27 1 Julian Perelli
<pre>
28 2 Julian Perelli
apt-get install libmysqlclient-dev libmagickcore-dev libmagickwand-dev (install shitload of packages)
29 1 Julian Perelli
</pre>
30
31
h2. Running the Gem stuff
32
33
Install Bundler (removing useless module, which would otherwise create dependencies):
34
<pre>
35
gem install bundler
36
cd /usr/local/share/redmine/
37 3 Julian Perelli
bundle install --without development test postgresql sqlite
38 1 Julian Perelli
</pre>
39
40 8 Roland Giesler
Install mysql2-adapter
41
<pre>
42
gem install activerecord-mysql2-adapter
43
</pre>
44
45 6 ian stoddart
h2. Creating the database
46
47
On a new installation you need to create the database and a user for redmine.
48
Open a mysql command prompt:
49
<pre>
50
mysql -u root -p
51
</pre>
52
53
At the mysql prompt enter the mysql commands:
54
<pre>
55
create user 'redmine' identified by 'redmine';
56
set password for 'redmine'@'localhost' = password('my_password');
57
grant all on *.* to 'redmine'@'localhost';
58
create database redmine;
59
quit;
60
</pre>
61
62 1 Julian Perelli
h2. Configuration
63
64
Copy config/database.yml.example to config/database.yml and edit this file in order to configure your database settings for "production" environment.
65
Example for a MySQL database using ruby1.8 or jruby:
66
<pre>
67
production:
68 3 Julian Perelli
  adapter: mysql2
69 1 Julian Perelli
  database: redmine
70
  host: localhost
71
  username: redmine
72
  password: my_password
73
</pre>
74
75
Generate a session store secret:
76
<pre>
77 3 Julian Perelli
rake generate_secret_token
78 1 Julian Perelli
</pre>
79
80
Generate the database structure:
81
<pre>
82 3 Julian Perelli
RAILS_ENV=production rake db:migrate
83 1 Julian Perelli
</pre>
84
85
Generate default configuration data:
86
<pre>
87 3 Julian Perelli
RAILS_ENV=production rake redmine:load_default_data
88 1 Julian Perelli
</pre>
89
(using “es” for Spanish language in terminal prompt)
90
91
Setup config file in config/configuration.yml
92
93
Change database_ciphr_key: *******
94
<pre>
95 3 Julian Perelli
rake db:encrypt RAILS_ENV=production
96 1 Julian Perelli
</pre>
97
98
h2. Apache
99
100
Setup Apache’s VirtualHost config
101
102
<pre>
103
# 8080 in this case is because we use a reverse proxy before Apache. Otherwise simply use "*:80"
104
105
<VirtualHost *:8080>
106
 ServerName redmine.example.com
107
 DocumentRoot /usr/local/share/redmine/public
108
 <Directory /usr/local/share/redmine/public>
109
   AllowOverride all
110
   Options -MultiViews
111
 </Directory>
112
</VirtualHost>
113
</pre>
114
115 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.
116 1 Julian Perelli
117
The default login/password is admin/admin (don't forget to change this).
118
119
h2. Sources of inspiration
120
121
We used the following resources as a starting point. Thanks to their respective authors.
122
123
* http://madpropellerhead.com/random/20100820-installing-redmine-on-debian-with-apache (outdated, for Lenny)
124
* http://www.redmine.org/projects/redmine/wiki/RedmineInstall
125
* http://hodza.net/2012/03/15/howto-install-redmine-on-debian-6-squeeze-ruby-on-rails-apache2-passenger/
126
* http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Debian_with_Ruby-on-Rails_and_Apache2-Passenger