Install-log » History » Version 4
Anthony Mallet, 2014-01-20 18:54
update redmine_git_hosting url
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 | </pre> |
||
158 | <pre> |
||
159 | 4 | Anthony Mallet | % git clone git://localhost/laas/redmine-laas/plugin/redmine_git_hosting |
160 | 2 | Anthony Mallet | % cd redmine_git_hosting |
161 | </pre> |
||
162 | |||
163 | * Some magic to update redmine |
||
164 | <pre> |
||
165 | % cd ~/src/redmine |
||
166 | % bundle install |
||
167 | % RAILS_ENV=production rake redmine:plugins:migrate |
||
168 | % RAILS_ENV=production rake redmine:plugins:process_version_change |
||
169 | </pre> |
||
170 | |||
171 | * Setup gitolite |
||
172 | <pre> |
||
173 | # su - redmine |
||
174 | % mkdir .ssh |
||
175 | % ssh-keygen -N '' -f ~/.ssh/gitolite_admin_rsa # use the same key as already in gitolite |
||
176 | % emacs ~/.ssh/config |
||
177 | 1 | Anthony Mallet | + Host localhost |
178 | + User git |
||
179 | + IdentityFile /opt/redmine/.ssh/gitolite_admin_rsa |
||
180 | + IdentitiesOnly yes |
||
181 | 2 | Anthony Mallet | </pre> |
182 | 1 | Anthony Mallet | |
183 | 2 | Anthony Mallet | * Setup (manually) @RW+@ access to gitolite-admin for user @redmine@ |
184 | 1 | Anthony Mallet | |
185 | 2 | Anthony Mallet | * Allow @sudo@ |
186 | <pre> |
||
187 | # sudo visudo |
||
188 | 1 | Anthony Mallet | + redmine ALL=(git) NOPASSWD:ALL |
189 | + git ALL=(redmine) NOPASSWD:ALL |
||
190 | 2 | Anthony Mallet | </pre> |
191 | 1 | Anthony Mallet | |
192 | 2 | Anthony Mallet | * Setup redmine user name |
193 | <pre> |
||
194 | % git config --global user.email "redmine@laas.fr" |
||
195 | % git config --global user.name "Redmine" |
||
196 | </pre> |
||
197 | 1 | Anthony Mallet | |
198 | 2 | Anthony Mallet | * Test |
199 | <pre> |
||
200 | % ssh localhost info |
||
201 | R W gitolite-admin |
||
202 | </pre> |
||
203 | }} |
||
204 | 1 | Anthony Mallet | |
205 | 2 | Anthony Mallet | {{collapse(restart redmine) |
206 | 1 | Anthony Mallet | |
207 | 2 | Anthony Mallet | * This works for any RoR software: |
208 | <pre> |
||
209 | % touch /opt/redmine/src/redmine/tmp/restart.txt |
||
210 | </pre> |
||
211 | }} |