Project

General

Profile

Install-log » History » Version 6

Anthony Mallet, 2014-02-11 18:02

1 1 Anthony Mallet
h1. Installation log
2
3
{{collapse(gitolite)
4
5
* Create a @git@ user
6
<pre>
7
# useradd -d /opt/git ... git
8
</pre>
9
10
* Get current gitolite code
11
<pre>
12
# su - git
13
% mkdir $HOME/bin $HOME/src
14
% cd $HOME/src
15
% git clone git://github.com/sitaramc/gitolite
16
% $HOME/src/gitolite/install -to $HOME/bin
17
</pre>
18
19
* Configure an admin key, will be used later by redmine
20
<pre>
21
% gitolite setup -pk /some/where/id_dsa.pub
22
</pre>
23
}}
24
25
{{collapse(postgres)
26
* Create a redmine user and the database
27
<pre>
28
% psql -U ...
29
% create role redmine login encrypted password '...secret...' noinherit valid until 'infinity';
30
% create database redmine with encoding='UTF8' owner=redmine;
31
% [this is the default, but to be sure: ALTER DATABASE "redmine" SET datestyle="ISO,MDY";
32
</pre>
33
}}
34
35
{{collapse(redmine)
36 3 Anthony Mallet
37
There are two identical installations. One for redmine.laas.fr and one for openrobots.org. They are called @laas@ and @openrobots@ respectively. Only the @laas@ setup is detailed here. @openrobots@ setup is identical.
38
39 1 Anthony Mallet
* Install dependencies
40
<pre>
41
% su -
42
# yum install curl-devel openssl-devel
43
# yum install httpd-devel apr-devel apr-util-devel
44
# yum install ruby-devel rubygems rubygem-rake ImageMagick-devel
45
# gem install bundler
46
</pre>
47
48
* Create a redmine user
49
<pre>
50
% useradd -d /opt/redmine ... redmine
51
% su - redmine
52
# mkdir src gems files logs
53
</pre>
54
55
* Get current redmine code - hosted in the @redmine-laas@ project, branch @laas@.
56
<pre>
57
# cd src
58 3 Anthony Mallet
# git clone git://redmine.laas.fr/laas/redmine-laas/redmine laas
59
# cd laas
60 1 Anthony Mallet
# git checkout laas
61
</pre>
62
63
* Note that the @log@ and @plugin@ directories are symlinks to @$HOME@, for easier upgrades.
64
65
* Configure a few files, samples are provided in the @.example@ files at the same place.
66
<pre>
67
# emacs config/database.yml
68
# emacs config/configuration.yml
69
# emacs config/additional_environment.rb
70
</pre>
71
72
* Install some gems locally
73
<pre>
74
# bundle install --path /opt/redmine/gems --without development test
75
Your bundle is complete!
76
</pre>
77
78
* Setup PATHs etc.
79
<pre>
80
# emacs ~/.profile
81
 + export PATH=opt/redmine/gems/ruby/1.8/bin:/bin:/sbin:/usr/bin:/usr/sbin
82
 + export GEM_PATH=/opt/redmine/gems/ruby/1.8
83
</pre>
84
85 2 Anthony Mallet
* Some magic to setup rails/redmine etc.
86
<pre>
87
# rake generate_secret_token
88
# RAILS_ENV=production rake db:migrate
89
# RAILS_ENV=production rake redmine:load_default_data
90 1 Anthony Mallet
 + [en]
91 2 Anthony Mallet
</pre>
92
93
* Test everything is OK on @http://localhost:3000@. (not for production!)
94
<pre>
95
# ruby script/rails server webrick -e production
96
</pre>
97 1 Anthony Mallet
}}
98
99 2 Anthony Mallet
{{collapse(apache)
100
* Compile @passenger@ (installed as a gem thanks to @Gemfile.local@ in redmine (laas)
101
<pre>
102
% passenger-install-apache2-module
103
</pre>
104 1 Anthony Mallet
105 2 Anthony Mallet
* Configure httpd.conf as follow:
106
<pre>
107
# /etc/httpd/conf/httpd.conf
108
NameVirtualHost *:80
109
NameVirtualHost [::]:80
110
NameVirtualHost *:443
111
NameVirtualHost [::]:443
112
</pre>
113 1 Anthony Mallet
114 2 Anthony Mallet
 <pre>
115
# /etc/httpd/conf.d/redmine.conf
116
<VirtualHost *:443 [::]:443>
117
    SSLEngine on
118
    SSLCertificateFile /etc/pki/tls/certs/localhost.crt
119 1 Anthony Mallet
    SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
120 2 Anthony Mallet
121 1 Anthony Mallet
    ServerName redmine.laas.fr
122 2 Anthony Mallet
    ServerAdmin sysadmin@laas.fr
123 3 Anthony Mallet
    DocumentRoot /opt/redmine/src/laas/public
124 2 Anthony Mallet
    ErrorLog /opt/redmine/logs/httpd-errors
125
    CustomLog /opt/redmine/logs/httpd-access common
126
127
    LoadModule passenger_module /opt/redmine/gems/ruby/1.8/gems/passenger-4.0.24/buildout/apache2/mod_passenger.so
128
    PassengerRoot /opt/redmine/gems/ruby/1.8/gems/passenger-4.0.24
129 1 Anthony Mallet
    PassengerDefaultRuby /usr/bin/ruby
130 2 Anthony Mallet
    PassengerDefaultUser redmine
131 1 Anthony Mallet
132 3 Anthony Mallet
    <Directory /opt/redmine/src/laas/public>
133 2 Anthony Mallet
        AllowOverride all
134
        Options -MultiViews
135
        Allow from all
136
    </Directory>
137
</VirtualHost>
138 1 Anthony Mallet
139 2 Anthony Mallet
<VirtualHost *:80 [::]:80>
140
    ServerName redmine.laas.fr
141
    Redirect permanent / https://redmine.laas.fr/
142
</VirtualHost>
143
</pre>
144
145
* Reload
146
<pre>
147
# /etc/init.d/httpd reload
148
</pre>
149
}}
150
151
{{collapse(redmine plugins)
152 4 Anthony Mallet
* git hosting hosted in @redmine-laas/plugin@ project ...
153 2 Anthony Mallet
<pre>
154
% cd ~/plugins
155 1 Anthony Mallet
% git clone git://github.com/thorin/redmine_ldap_sync
156 2 Anthony Mallet
% git clone git://github.com/jbox-web/redmine_plugin_views_revisions
157 6 Anthony Mallet
% git clone https://github.com/cdwertmann/recaptcha.git
158 2 Anthony Mallet
</pre>
159
 <pre>
160 5 Anthony Mallet
% git clone git://localhost/laas/redmine-laas/redmine_git_hosting
161 2 Anthony Mallet
% cd redmine_git_hosting
162
</pre>
163
164
* Some magic to update redmine
165
<pre>
166
% cd ~/src/redmine
167
% bundle install
168
% RAILS_ENV=production rake redmine:plugins:migrate
169
% RAILS_ENV=production rake redmine:plugins:process_version_change
170
</pre>
171
172
* Setup gitolite
173
<pre>
174
# su - redmine
175
% mkdir .ssh
176
% ssh-keygen -N '' -f ~/.ssh/gitolite_admin_rsa # use the same key as already in gitolite
177
% emacs ~/.ssh/config
178 1 Anthony Mallet
 + Host localhost
179
 +  User git
180
 +  IdentityFile /opt/redmine/.ssh/gitolite_admin_rsa
181
 +  IdentitiesOnly yes
182 2 Anthony Mallet
</pre>
183 1 Anthony Mallet
184 2 Anthony Mallet
* Setup (manually) @RW+@ access to gitolite-admin for user @redmine@
185 1 Anthony Mallet
186 2 Anthony Mallet
* Allow @sudo@
187
<pre>
188
# sudo visudo
189 1 Anthony Mallet
 + redmine        ALL=(git)      NOPASSWD:ALL
190
 + git            ALL=(redmine)  NOPASSWD:ALL
191 2 Anthony Mallet
</pre>
192 1 Anthony Mallet
193 2 Anthony Mallet
* Setup redmine user name
194
<pre>
195
% git config --global user.email "redmine@laas.fr"
196
% git config --global user.name "Redmine"
197
</pre>
198 1 Anthony Mallet
199 2 Anthony Mallet
* Test
200
<pre>
201
% ssh localhost info
202
  R W    gitolite-admin
203
</pre>
204
}}
205 1 Anthony Mallet
206 2 Anthony Mallet
{{collapse(restart redmine)
207 1 Anthony Mallet
208 2 Anthony Mallet
* This works for any RoR software:
209
<pre>
210
% touch /opt/redmine/src/redmine/tmp/restart.txt
211
</pre>
212
}}