Project

General

Profile

Install-log » History » Version 2

Anthony Mallet, 2013-12-03 13:49

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