{"id":543,"date":"2013-08-23T11:16:38","date_gmt":"2013-08-23T14:16:38","guid":{"rendered":"http:\/\/www.viazap.com.br\/?p=543"},"modified":"2013-09-03T10:32:45","modified_gmt":"2013-09-03T13:32:45","slug":"redmine-no-debian-instalacao-e-configuracao","status":"publish","type":"post","link":"https:\/\/blog.clusterweb.com.br\/?p=543","title":{"rendered":"Redmine no Debian &#8211; Instala\u00e7\u00e3o e configura\u00e7\u00e3o"},"content":{"rendered":"<table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"3\">\n<tbody>\n<tr>\n<td colspan=\"2\"><b>Instala\u00e7\u00e3o<\/b><\/p>\n<div>\n<h1>Pr\u00e9-instala\u00e7\u00e3o<\/h1>\n<p>\u00c9 prov\u00e1vel que os pacotes citados abaixo estejam instalados, mas se n\u00e3o estiverem, instale.<\/p>\n<p>Instale os requisitos de funcionamento, como servidor WEB, banco de dados, OpenSSL, pacotes para compilar:<\/p>\n<p><strong>$ sudo aptitude install gcc build-essential zlib1g zlib1g-dev zlibc libzlib-ruby libssl-dev libyaml-dev libcurl4-openssl-dev apache2-mpm-prefork apache2-prefork-dev libapr1-dev libxslt-dev checkinstall libyaml-0-2<!--more--><\/strong><\/p>\n<p>Ruby &#8211; baixe e compile (aten\u00e7\u00e3o, execute cada linha de comando por vez):<\/p>\n<p><strong>$ cd ~<br \/>\n$ wget<\/strong>\u00a0<a href=\"ftp:\/\/ftp.ruby-lang.org\/pub\/ruby\/1.9\/ruby-1.9.3-p448.tar.gz\">ftp:\/\/ftp.ruby-lang.org\/pub\/ruby\/1.9\/ruby-1.9.3-p448.tar.gz<\/a><br \/>\n<strong>$ tar xvfz ruby-1.9.3-p448.tar.gz<br \/>\n$ cd ruby-1.9.3-p448<br \/>\n$ .\/configure &#8211;enable-pthread &#8211;prefix=\/usr\/local<br \/>\n$ make<br \/>\n$ sudo make install<\/strong><\/p>\n<p>Teste o funcionamento do Ruby:<\/p>\n<p><strong>$ ruby -v<\/strong><\/p>\n<p>Deve aparecer um sa\u00edda parecida com essa:<\/p>\n<blockquote><p>ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]<\/p><\/blockquote>\n<p>Adicione o suporte OpenSSL ao Ruby:<\/p>\n<p><strong>$ cd ext\/openssl\/<br \/>\n$ ruby extconf.rb<br \/>\n$ make<br \/>\n$ sudo make install<\/strong><\/p>\n<p>O Ruby 1.9 vem com a RubyGems, por padr\u00e3o. Use o seguinte comando para verificar se ela est\u00e1 corretamente instalada:<\/p>\n<p><strong>$ gem -v<\/strong><\/p>\n<p>Deve aparecer na sa\u00edda um n\u00famero de vers\u00e3o semelhante a: 1.8.23<\/p>\n<p>Instalando &#8220;zlib&#8221;:<\/p>\n<p><strong>$ cd ruby-1.9.3-p448\/ext\/zlib\/<br \/>\n$ ruby extconf.rb<br \/>\n$ make<br \/>\n$ sudo make install<\/strong><\/p>\n<p>Instalando o Rails:<\/p>\n<p><strong>$ sudo gem install rails<\/strong><\/p>\n<p>Instalando o\u00a0<em>Passenger<\/em>\u00a0(servidor de aplica\u00e7\u00e3o):<\/p>\n<p><strong>$ sudo gem install passenger<br \/>\n$ sudo passenger-install-apache2-module<\/strong><\/p>\n<h1>Apache<\/h1>\n<p>Configurando o\u00a0<em>Apache<\/em>: insira o seguinte c\u00f3digo no arquivo &#8220;\/etc\/apache\/apache2.conf&#8221;:<\/p>\n<div>LoadModule passenger_module \/usr\/local\/lib\/ruby\/gems\/1.9.1\/gems\/passenger-4.0.10\/buildout\/apache2\/mod_passenger.so<br \/>\nPassengerRoot \/usr\/local\/lib\/ruby\/gems\/1.9.1\/gems\/passenger-4.0.10<br \/>\nPassengerDefaultRuby \/usr\/local\/bin\/ruby<\/div>\n<h1>Instalando o Redmine<\/h1>\n<p>Baixe o\u00a0<em>Redmine<\/em>\u00a0neste link:<\/p>\n<ul>\n<li><a href=\"http:\/\/rubyforge.org\/frs\/?group_id=1850\">RubyForge: Redmine: Project Filelist<\/a><\/li>\n<\/ul>\n<p>Obs.: descompacte o arquivo em: &#8220;\/home\/viaza132\/www&#8221;<\/p>\n<p>Prepare o sistema:<\/p>\n<p><strong>$ sudo gem install bundler mysql2<br \/>\n$ sudo aptitude install libmagickwand-dev libmysqlclient-dev<br \/>\n$ cd \/home\/viaza132\/www\/redmine-2.3.2<\/strong><\/p>\n<p>Configure a conex\u00e3o ao banco de dados.<\/p>\n<p>Crie o arquivo &#8220;\/home\/viaza132\/www\/redmine-2.3.2\/config\/database.yml&#8221; e insira o seguinte conte\u00fado nele:<\/p>\n<div>production:<br \/>\nadapter: mysql2<br \/>\ndatabase: redmine<br \/>\nhost: localhost<br \/>\nusername: redmine<br \/>\npassword: passwd<\/div>\n<p><strong>$ sudo bundle install &#8211;without postgresql<\/strong><\/p>\n<p>Crie o banco de dados.<\/p>\n<p>Abra um console de conex\u00e3o com seu banco de dados\u00a0<em>MySQL<\/em>\u00a0e execute os seguintes comandos:<\/p>\n<p>mysql -&gt;\u00a0<strong>create database redmine character set utf8;<\/strong><br \/>\nmysql -&gt;\u00a0<strong>create user &#8216;redmine&#8217;@&#8217;localhost&#8217; identified by &#8216;passwd&#8217;;<\/strong><br \/>\nmysql -&gt;\u00a0<strong>grant all privileges on redmine.* to &#8216;redmine&#8217;@&#8217;localhost&#8217;;<\/strong><\/p>\n<p>P.S.: para conectar ao MySQL via console, use o comando:<\/p>\n<p><strong>$ mysql -u root -psenha<\/strong>\u00a0\u00a0\u00a0# Substitua a palavra &#8220;senha&#8221; pela sua senha de root<\/p>\n<h1>Configura\u00e7\u00f5es finais<\/h1>\n<p>Crie um token de sess\u00e3o:<\/p>\n<p><strong>$ sudo rake generate_secret_token<\/strong><\/p>\n<p>Defina o ambiente de trabalho e crie as tabelas do BD:<\/p>\n<p><strong>$ sudo RAILS_ENV=production rake db:migrate<\/strong><\/p>\n<p>Fixe as permiss\u00f5es para garantir o correto funcionamento:<\/p>\n<p><strong>$ cd \/home\/viaza132\/wwwt\/redmine-2.3.2<br \/>\n$ sudo mkdir tmp tmp\/pdf public\/plugin_assets<br \/>\n$ sudo chown -R www-data:www-data files log tmp public\/plugin_assets<br \/>\n$ sudo chmod -R 755 files log tmp public\/plugin_assets<\/strong><\/p>\n<p>Testando se funcionou:<\/p>\n<p><strong>$ cd \/home\/viaza132\/wwwt\/redmine-2.3.2<br \/>\n$ sudo ruby script\/rails server webrick -e production<\/strong><\/p>\n<p>Agora no browser, abra o link:<\/p>\n<ul>\n<li><strong>http:\/\/localhost:3000<\/strong><\/li>\n<\/ul>\n<p>E teste!<\/p>\n<\/div>\n<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\"><b>Configura\u00e7\u00e3o<\/b><\/p>\n<div>\n<h1>Configurando Apache e Passenger<\/h1>\n<p>Execute:<\/p>\n<p><strong>$ cd \/etc\/apache2\/sites-available<br \/>\n$ vim redmine<\/strong><\/p>\n<p>O \u00faltimo comando ir\u00e1 abrir um arquivo novo para edi\u00e7\u00e3o. Dentro dele, insira o seguinte conte\u00fado, alterando &#8220;DocumentRoot e Directory&#8221; conforme suas configura\u00e7\u00f5es:<\/p>\n<div>&lt;VirtualHost *:80&gt;<br \/>\nServerName www.meudominio.com<br \/>\n# !!! Be sure to point DocumentRoot to &#8216;public&#8217;!<br \/>\nDocumentRoot \/home\/viaza132\/www\/redmine\/public<br \/>\n&lt;Directory \/home\/viaza132\/www\/redmine\/public&gt;<br \/>\n# This relaxes Apache security settings.<br \/>\nAllowOverride all<br \/>\n# MultiViews must be turned off.<br \/>\nOptions -MultiViews<br \/>\n&lt;\/Directory&gt;<br \/>\n&lt;\/VirtualHost&gt;<\/div>\n<p>Reinicie o Apache:<\/p>\n<p><strong>$ sudo service apache2 restart<\/strong><\/p>\n<p>Agora teste se o endere\u00e7o est\u00e1 funcionando:<\/p>\n<ul>\n<li><strong>http:\/\/www.meudominio.com<\/strong><\/li>\n<\/ul>\n<h1>Configurando o Git<\/h1>\n<p>Dentro do diret\u00f3rio raiz, crie um diret\u00f3rio chamado &#8220;git_repositories&#8221;:<\/p>\n<p><strong># cd \/home\/viaza132\/www\/redmine-2.3.2<br \/>\n# mkdir git_repositories<\/strong><\/p>\n<p>Instale o\u00a0<em>Git<\/em>:<\/p>\n<p><strong># aptitude install git git-cvs<\/strong><\/p>\n<p>D\u00ea as permiss\u00f5es necess\u00e1rias para que o Git possa executar:<\/p>\n<p><strong># chown git.git \/var\/redmine\/git_repositories<br \/>\n# cd git_repositories\/<br \/>\n# git clone &#8211;bare git:\/\/github.com\/ook\/donebox.git<\/strong><\/p>\n<p>O resultado com este \u00faltimo comando, deve ser algo como:<\/p>\n<blockquote><p>Initialized empty Git repository in \/var\/redmine\/git_repositories\/donebox\/<br \/>\nremote: Counting objects: 401, done.<br \/>\nremote: Compressing objects: 100% (246\/246), done.<br \/>\nremote: Total 401 (delta 134), reused 401 (delta 134)<br \/>\nReceiving objects: 100% (401\/401), 179.55 KiB | 185 KiB\/s, done.<br \/>\nResolving deltas: 100% (134\/134), done.<\/p><\/blockquote>\n<p>Pronto! Agora v\u00e1 no seu projeto:<\/p>\n<ul>\n<li>Na parte de reposit\u00f3rios, escolha:\u00a0<strong>Git<\/strong><\/li>\n<li>E coloque o caminho para o Git logo abaixo e salve-o:\u00a0<strong>\/var\/redmine\/git_repositories\/donebox\/<\/strong><\/li>\n<\/ul>\n<p>Aten\u00e7\u00e3o: este tutorial funciona para a configura\u00e7\u00e3o de apenas um Redmine no servidor. Para configura\u00e7\u00e3o de m\u00faltiplas instala\u00e7\u00f5es, sugiro pesquisar o funcionamento da ferramenta\u00a0<em>Mongrel Cluster<\/em>.<\/p>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Instala\u00e7\u00e3o Pr\u00e9-instala\u00e7\u00e3o \u00c9 prov\u00e1vel que os pacotes citados abaixo estejam instalados, mas se n\u00e3o estiverem, instale. Instale os requisitos de funcionamento, como servidor WEB, banco de dados, OpenSSL, pacotes para compilar: $ sudo aptitude install gcc build-essential zlib1g zlib1g-dev zlibc libzlib-ruby libssl-dev libyaml-dev libcurl4-openssl-dev apache2-mpm-prefork apache2-prefork-dev libapr1-dev libxslt-dev checkinstall libyaml-0-2<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[42],"tags":[40,17,181,313],"class_list":["post-543","post","type-post","status-publish","format-standard","hentry","category-leitura-recomendada","tag-configuracao","tag-debian","tag-instalacao","tag-redmine"],"_links":{"self":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts\/543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=543"}],"version-history":[{"count":2,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts\/543\/revisions"}],"predecessor-version":[{"id":559,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=\/wp\/v2\/posts\/543\/revisions\/559"}],"wp:attachment":[{"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.clusterweb.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}