Project

General

Profile

Feature #22923 » HowTo_Install_Redmine_212_in_Ubuntu_1210_and_Apache_Passenger.txt

Jean-Philippe Lang, 2016-06-06 12:29

 
1
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
* For this to work maybe you shold edit /etc/hosts file adding a line "127.0.0.1 redmine.example.com"
9
* 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 ruby-dev
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
cd /usr/local/share/
20
wget http://rubyforge.org/frs/download.php/76495/redmine-2.1.2.tar.gz
21
tar -xzvf redmine-2.1.2.tar.gz
22
ln -s /usr/local/share/redmine-2.1.2 /usr/local/share/redmine
23
chown -R root:root /usr/local/share/redmine-2.1.2
24
</pre>
25

    
26
Install development libraries for MySQL and Imagick:
27
<pre>
28
apt-get install libmysqlclient-dev libmagickcore-dev libmagickwand-dev (install shitload of packages)
29
</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
bundle install --without development test postgresql sqlite
38
</pre>
39

    
40
h2. Creating the database
41

    
42
On a new installation you need to create the database and a user for redmine.
43
Open a mysql command prompt:
44
<pre>
45
mysql -u root -p
46
</pre>
47

    
48
At the mysql prompt enter the mysql commands:
49
<pre>
50
create user 'redmine' identified by 'redmine';
51
set password for 'redmine'@'localhost' = password('my_password');
52
grant all on redmine.* to 'redmine'@'localhost';
53
create database redmine;
54
quit;
55
</pre>
56

    
57
h2. Configuration
58

    
59
Copy /usr/local/share/redmine/config/database.yml.example to /usr/local/share/redmine/config/database.yml and edit this file in order to configure your database settings for "production" environment.
60
Example for a MySQL database using ruby1.8 or jruby:
61
<pre>
62
production:
63
  adapter: mysql2      (note: For Rails < 3.1 use mysql instead of mysql2)
64
  database: redmine
65
  host: localhost
66
  username: redmine
67
  password: my_password
68
</pre>
69

    
70
Generate a session store secret:
71
<pre>
72
rake generate_secret_token
73
</pre>
74

    
75
Generate the database structure:
76
<pre>
77
RAILS_ENV=production rake db:migrate
78
</pre>
79

    
80
Generate default configuration data:
81
<pre>
82
RAILS_ENV=production rake redmine:load_default_data
83
</pre>
84
(using “es” for Spanish language in terminal prompt)
85

    
86
h4. Database encryption
87

    
88
If you want to encrypt your redmine database do as follows:
89

    
90
# Copy the default config file @/usr/local/share/redmine/config/configuration.yml.example@ to @/usr/local/share/redmine/config/configuration.yml@
91
# Edit configuration.yml and create a cipher key there for the environment you've used so thus far - production. Be sure to read the comment in this file. They are very detailed and there for you.
92
# Run: <pre>
93
rake db:encrypt RAILS_ENV=production
94
</pre>
95

    
96
h2. Apache
97

    
98
Setup Apache’s VirtualHost config
99

    
100
<pre>
101
# 8080 in this case is because we use a reverse proxy before Apache. Otherwise simply use "*:80"
102

    
103
<VirtualHost *:8080>
104
 ServerName redmine.example.com
105
 DocumentRoot /usr/local/share/redmine/public
106
 <Directory /usr/local/share/redmine/public>
107
   AllowOverride all
108
   Options -MultiViews
109
 </Directory>
110
</VirtualHost>
111
</pre>
112

    
113
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.
114

    
115
The default login/password is admin/admin (don't forget to change this).
116

    
117
h2. Sources of inspiration
118

    
119
We used the following resources as a starting point. Thanks to their respective authors.
120

    
121
* http://madpropellerhead.com/random/20100820-installing-redmine-on-debian-with-apache (outdated, for Lenny)
122
* http://www.redmine.org/projects/redmine/wiki/RedmineInstall
123
* http://hodza.net/2012/03/15/howto-install-redmine-on-debian-6-squeeze-ruby-on-rails-apache2-passenger/
124
* http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Debian_with_Ruby-on-Rails_and_Apache2-Passenger
(1-1/5)