redmine-sei.tex
6.56 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
\section{Redmine}\label{redmine}
\subsection{Instalação do Epel}
\fbox{
\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 apr-util-devel subversion git postgresql-devel}
}}
\subsection{Instalação Postgresql}
\fbox{\parbox{\textwidth}{
\texttt{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{/etc/init.d/postgresql-9.3 initdb sudo /etc/init.d/postgresql-9.3 restart
}}}
\subsubsection{Modificar senha do Postgres}
\fbox{\parbox{\textwidth}{
\texttt{sudo -u postgres psql template1 \textgreater{}\textgreater{}ALTER USER
postgres with encrypted password `postgres';
}}}
\subsubsection{Configurando o Postgres}
\fbox{
\texttt{sudo vi /var/lib/pgsql/9.3/data/postgresql.conf}}
\fbox{
\texttt{change: listen\_addresses = 'localhost'}
\texttt{to: listen\_addresses = 'localhost'}}
\fbox{\parbox{\textwidth}{
\texttt{[ESC]:wq!
Edit pg\_hba.conf to grant the permissions}}}
\fbox{
\texttt{sudo vi /var/lib/pgsql/9.3/data/pg\_hba.conf}}
\subsubsection{Usar a permissão certa de usuário do Redmine no banco de dados do Redmine}
\fbox{\parbox{\textwidth}{
\texttt{
\# TYPE DATABASE USER ADDRESS METHOD
\# local is for Unix domain socket connections only
local all redmine md5
\# IPv4 local connections:
host all redmine 127.0.0.1/32 md5
\# IPv6 local connections:
host all redmine ::1/128 md5
}}}
\fbox{
\texttt{[ESC]:wq!}}
\subsubsection{Reiniciar Postgresql}
\fbox{
\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
openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel
sqlite-devel ruby-rdoc ruby-devel}}}
\fbox{
\texttt{sudo yum install rubygems libxslt-devel libxml2-devel.x86\_64}}
\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 gcc ImageMagick ImageMagick-devel
ImageMagick-perl
}}}
\subsection{Instalar Gem Bundle}
\fbox{\parbox{\textwidth}{
\texttt{
sudo gem install bundle --no-ri --no-rdoc
}}}
\subsection{Instalar NGINX}
\fbox{\parbox{\textwidth}{
\texttt{
cd /tmp wget
http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release centos-6-0.el6.ngx.noarch.rpm
}}}
\fbox{\parbox{\textwidth}{
\texttt{
sudo rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm sudo yum
install nginx -y sudo chkconfig nginx on
}}}
\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{
\texttt{cd /opt/redmine bundle install --without mysql sqlite}}
\subsection{Configurar postgresql}
\fbox{
\texttt{
sudo -u postgres psql}}
\fbox{\parbox{\textwidth}{
\texttt{
\begin{quote}
\begin{quote}
CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD `redmine' NOINHERIT VALID
UNTIL `infinity'; CREATE DATABASE redmine WITH ENCODING=`UTF8'
OWNER=redmine;
\end{quote}
\end{quote}
}}}
\subsection{Installing 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 sudo gem uninstall rake -v `10.3.2'
}}}
\subsection{Configurar database.yml na pasta do Redmine}
\fbox{\parbox{\textwidth}{
\texttt{cd config/ mv database.yml.example database.yml vi database.yml
}}}
\subsubsection{Comentar outras linhas e descomentar essas linhas:}
\fbox{\parbox{\textwidth}{
\texttt{
\#----------------------
production: adapter: postgresql database: redmine host: 10.18.0.10 (link
to database) 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 escolher pt-BR
}}}
\subsection{Configurar Unicorn}
\fbox{\parbox{\textwidth}{
\texttt{
cd /opt/redmine mkdir pids\\ vi config/unicorn.rb
}}}
\fbox{\parbox{\textwidth}{
\texttt{
Copy this code to file:
\#------------------------------------ \# 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{
sudo unicorn\_rails -c /opt/redmine/config/unicorn.rb -E production -l
0.0.0.0:3000 -D
}}}
\subsection{Instalar Plugin Backlogs}
De acordo com \url{http://www.redminebacklogs.net/en/installation.html}, execute os seguintes comandos:
\fbox{\parbox{\textwidth}{
\texttt{
cd /opt/redmine
}}}
\fbox{\parbox{\textwidth}{
\texttt{
bundle install --without development test
}}}
\fbox{\parbox{\textwidth}{
\texttt{
gem install holidays --version 1.0.3\\
gem install holidays
}}}
\fbox{\parbox{\textwidth}{
\texttt{
cd /opt/redmine/plugins\\
git clone https://github.com/backlogs/redmine\_backlogs.git\\
cd redmine\_backlogs\\
git tag\\
git checkout v1.0.6
}}}
\fbox{\parbox{\textwidth}{
\texttt{
cd /opt/redmine\\
RAILS\_ENV=production\\
export RAILS\_ENV\\
bundle exec rake db:migrate\\
bundle exec rake tmp:cache:clear\\
bundle exec rake tmp:sessions:clear\\
bundle exec rake redmine:backlogs:install (escolher sempre a opção 2)
}}}
\fbox{\parbox{\textwidth}{
\texttt{
service httpd restart
}}}