redmine-sei.tex
5.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
\section{Redmine}
\label{redmine}
\subsection{Instalação do Epel}
\fbox{\parbox{\textwidth}{
\texttt{
rpm -Uvh http://fedora.uib.no/epel/6/x86\_64/epel-release-6-8.noarch.rpm
}}}
\subsection{Instalação de pacotes}
\fbox{\parbox{\textwidth}{
\texttt{sudo yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel \textbackslash
\\
apr-util-devel subversion git postgresql-devel wget vim}
}}
\subsection{Instalação Postgresql}
\fbox{\parbox{\textwidth}{
\texttt{
\scriptsize{
sudo yum localinstall http://yum.postgresql.org/9.3/redhat/rhel-6-x86\_64/pgdg-centos93-9.3-1.noarch.rpm -y
\\
sudo yum install postgresql93 postgresql93-devel postgresql93-libs postgresql93-server -y
}}}}
\subsubsection{Reiniciar Postgresql}
\fbox{\parbox{\textwidth}{
\texttt{
sudo /etc/init.d/postgresql-9.3 initdb
\\
sudo /etc/init.d/postgresql-9.3 restart
}}}
\subsubsection{Modificar senha do Postgres}
%Corrigindo aspas
\fbox{\parbox{\textwidth}{
\texttt{sudo -u postgres psql template1 -c \textbackslash
\\
"ALTER USER postgres with encrypted password 'postgres';"
}}}
\subsubsection{Configurando o Postgres}
\fbox{\parbox{\textwidth}{
\texttt{
sudo vim /var/lib/pgsql/9.3/data/postgresql.conf
\\
descomentar: \# listen\_addresses = 'localhost'
}}}
\subsubsection{Usar a permissão certa de usuário do Redmine no banco de dados do Redmine}
\fbox{\parbox{\textwidth}{
\texttt{sudo vim /var/lib/pgsql/9.3/data/pg\_hba.conf}}}
O arquivo deve ficar desta forma:
%Atualizando permissão dos usuários
\fbox{\parbox{\textwidth}{
\texttt{
\# TYPE DATABASE USER ADDRESS METHOD
\\
\# local is for Unix domain socket connections only
\\
local all redmine md5
\\
local all all peer
\\
\# IPv4 local connections:
\\
host all redmine 127.0.0.1/32 md5
\\
host all all 127.0.0.1/32 ident
\\
\# IPv6 local connections:
\\
host all redmine ::1/128 md5
\\
host all all ::1/128 ident
}}}
\subsubsection{Reiniciar Postgresql}
\fbox{\parbox{\textwidth}{
\texttt{sudo /etc/init.d/postgresql-9.3 restart}}}
\subsection{Instalar Requisitos das Gems}
\fbox{\parbox{\textwidth}{
\texttt{
sudo yum install gcc gcc-c++.x86\_64 make automake autoconf curl-devel \textbackslash
\\
openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel \textbackslash
\\
sqlite-devel ruby-rdoc ruby-devel rubygems libxslt-devel libxml2-devel.x86\_64 -y}}}
\subsection{Atualizar para a Gem 1.4.2}
\fbox{\parbox{\textwidth}{
\texttt{
wget http://production.cf.rubygems.org/rubygems/rubygems-1.4.2.tgz
\\
tar zxvf rubygems-1.4.2.tgz
\\
cd rubygems-1.4.2
\\
ruby setup.rb
\\
gem -v
}}}
\subsection{Instalar ImageMagick}
\fbox{\parbox{\textwidth}{
\texttt{
sudo yum install php-pear ImageMagick ImageMagick-devel ImageMagick-perl -y
}}}
\subsection{Instalar Gem Bundle}
\fbox{\parbox{\textwidth}{
\texttt{
sudo gem install bundle -\--no-ri -\--no-rdoc
}}}
\subsection{Instalar Redmine 2.5.1}
\fbox{\parbox{\textwidth}{
\texttt{
cd /opt
\\
svn co http://svn.redmine.org/redmine/branches/2.5-stable redmine
\\
sudo mkdir -p tmp/pdf public/plugin\_assets
}}}
\subsection{Instalar requisitos da Gem}
\fbox{\parbox{\textwidth}{
\texttt{
cd /opt/redmine
\\
bundle install --without mysql sqlite
}}}
\subsection{Configurar postgresql}
\fbox{\parbox{\textwidth}{
\texttt{
sudo -u postgres psql
}}}
Execute:
%Corrigindo
\fbox{\parbox{\textwidth}{
\texttt{
CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD 'redmine' NOINHERIT VALID UNTIL 'infinity';
\\
CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine;
\\
\textbackslash q
}}}
\subsection{Instalando Gems}
\fbox{\parbox{\textwidth}{
\texttt{
sudo gem install pg -v '0.17.1' -\--no-ri -\--no-rdoc
\\
sudo gem install unicorn -\--no-ri -\--no-rdoc
}}}
\subsection{Configurar database.yml na pasta do Redmine}
\fbox{\parbox{\textwidth}{
\texttt{
cd config
\\
mv database.yml.example database.yml
\\
vim database.yml
}}}
Comentar todas as linhas e descomentar estas baixo:
\fbox{\parbox{\textwidth}{
\texttt{
production:
\\
adapter: postgresql
\\
database: redmine
\\
host: <ip-banco-de-dados>
\\
username: redmine
\\
password: redmine
\\
encoding: utf8
}}}
\subsection{Popular Redmine}
\fbox{\parbox{\textwidth}{
\texttt{
rake generate\_secret\_token RAILS\_ENV=production
\\
rake db:migrate RAILS\_ENV=production
\\
rake redmine:load\_default\_data RAILS\_ENV=production
\\
(\emph{escolher pt-BR})
}}}
\subsection{Configurar Unicorn}
\fbox{\parbox{\textwidth}{
\texttt{
cd /opt/redmine
\\
mkdir pids
\\
vim config/unicorn.rb
}}}
Copie as linhas abaixo para unicorn.rb:
\fbox{\parbox{\textwidth}{
\texttt{
\#------------------------------------
\\
\# Set the working application directory
\\
\# working\_directory ``/path/to/your/app''
\\
working\_directory ``/opt/redmine''
\\
\# Unicorn PID file location
\\
\# pid ``/path/to/pids/unicorn.pid''
\\
pid ``/opt/redmine/pids/unicorn.pid''
\\
\# Path to logs
\\
\# stderr\_path ``/path/to/log/unicorn.log''
\\
\# stdout\_path ``/path/to/log/unicorn.log''
\\
stderr\_path ``/opt/redmine/log/unicorn.log''
\\
stdout\_path ``/opt/redmine/log/unicorn.log''
\\
\# Unicorn socket
\\
\#listen ``/tmp/unicorn.redmine.sock''
\\
listen ``/tmp/unicorn.redmine.sock''
\\
\# Number of processes
\\
\# worker\_processes 4
\\
worker\_processes 2
\\
\# Time-out
\\
timeout 30
\\
\#-------------------------------------
}}}
\subsection{Reiniciar Postgresql}
\fbox{\parbox{\textwidth}{
\texttt{
sudo /etc/init.d/postgresql-9.3 restart
}}}
\subsection{Rodar Redmine usando Unicorn}
\fbox{\parbox{\textwidth}{
\texttt{
\small{sudo unicorn\_rails -c /opt/redmine/config/unicorn.rb -E production -l
0.0.0.0:80 -D}
\\
(\emph{subir na porta 80 porque está em uma máquina diferente do GitLab.
O padrão do Redmine é a porta 3000.})
}}}