{"id":665,"date":"2014-08-08T10:25:33","date_gmt":"2014-08-08T13:25:33","guid":{"rendered":"http:\/\/blog.abratel.com.br\/?p=665"},"modified":"2014-08-08T10:25:33","modified_gmt":"2014-08-08T13:25:33","slug":"criar-um-virtualhost-em-um-servidor-de-proxy-reverso","status":"publish","type":"post","link":"https:\/\/blog.abratel.com.br\/?p=665","title":{"rendered":"Criar um virtualhost em um servidor de proxy reverso"},"content":{"rendered":"<p>Exemplo: idata.teste.net<\/p>\n<p>Editar e alterar as defini\u00e7\u00f5es:<br \/>\nvim \/etc\/httpd\/vhosts.d\/idata.teste.net.conf<\/p>\n<p>NameVirtualHost idata.teste.net:80<br \/>\n<VirtualHost idata.teste.net:80><br \/>\n    ServerAdmin log@teste.net<br \/>\n    ServerName idata.teste.net<br \/>\n    DocumentRoot \/var\/www\/vhosts\/idata.teste.net<br \/>\n    Include \/etc\/httpd\/teste\/saas.teste.conf<br \/>\n    ErrorLog \/var\/log\/httpd\/idata.teste.net.error_log<br \/>\n    CustomLog \/var\/log\/httpd\/idata.teste.net.access_log combined<br \/>\n    HostnameLookups Off<br \/>\n    UseCanonicalName Off<br \/>\n    ServerSignature On<br \/>\n<\/VirtualHost><\/p>\n<p>Criar os arquivos de log:<br \/>\n[root@zeus uferes]# touch \/var\/log\/httpd\/idata.teste.net.access_log<br \/>\n[root@zeus uferes]# touch \/var\/log\/httpd\/idata.teste.net.error_log<br \/>\nCriar o documentroot:<br \/>\n[root@zeus uferes]# mkdir \/var\/www\/vhosts\/idata.teste.net<br \/>\nAdicionar a entrada no host<br \/>\n[root@zeus uferes]# vim \/etc\/hosts<br \/>\n192.168.200.137 idata.teste.net<br \/>\n192.168.200.137 serveridata<\/p>\n<p>Proxy Reverso:<\/p>\n<p>Criar a entrada para redirect na qual foi feita pelo INCLUDE na entrada do virtualhost:<br \/>\nvim \/etc\/httpd\/teste\/idata.teste.conf<\/p>\n<p># colocar ap\u00f3s o link http:\/\/serveridata a barra. Caso contrario ter\u00e1 problemas.<br \/>\nProxyPass                \/                        http:\/\/serveridata\/                    timeout=1080<br \/>\nProxyPassReverse        \/                         http:\/\/serveridata\/<\/p>\n<p>Teste o envio para o nome idata:<\/p>\n<p>[root@zeus uferes]# ping idata<br \/>\nPING idata (192.168.200.137) 56(84) bytes of data.<br \/>\n64 bytes from idata.teste.net (192.168.200.137): icmp_seq=1 ttl=64 time=0.238 ms<\/p>\n<p>Realize o reload das configura\u00e7\u00f5es:<br \/>\n\t[root@zeus uferes]# \/etc\/init.d\/httpd reload<br \/>\nReloading httpd:<\/p>\n<p>Direcione no DNS a entrada idata.teste.net para o ip do servidor Zeus.<br \/>\nCaso queira testar antes da modifica\u00e7\u00e3o, altera o host da sua esta\u00e7\u00e3o.<\/p>\n<p>Abrir no notepad como administrador e abrir o arquivo:<br \/>\nC:\\Windows\\System32\\drivers\\etc\\hosts<\/p>\n<p>Criar a entrada \u00e0 exemplo e salva-la:<\/p>\n<p>200.244.55.132 idata.teste.net<\/p>\n<p>No servidor idata (php \u2013 192.168.200.137)<\/p>\n<p>[root@vpn uferes]# vim \/etc\/httpd\/conf.d\/idata_zeus.conf<\/p>\n<p>NameVirtualHost serveridata:80<br \/>\n<VirtualHost serveridata:80><br \/>\n        SetEnv APPLICATION_ENV &#8220;production&#8221;<br \/>\n        php_value session.auto_start 0<\/p>\n<p>        ServerAdmin     teste@teste.net<br \/>\n        ServerName      serveridata<br \/>\n        DocumentRoot    \/var\/www\/idata\/zf2\/public<br \/>\n        ErrorLog        \/var\/log\/httpd\/idata_error_log<br \/>\n        TransferLog     \/var\/log\/httpd\/idata_access_log<br \/>\n        ServerSignature On<br \/>\n        <Directory \"\/var\/www\/idata\/zf2\/public\"><br \/>\n                DirectoryIndex index.php<br \/>\n                AllowOverride All<br \/>\n                Order allow,deny<br \/>\n                Allow from all<br \/>\n        <\/Directory><br \/>\n<\/VirtualHost><\/p>\n<p>[root@vpn uferes]# vim \/etc\/hosts<br \/>\n192.168.200.137 serveridata<\/p>\n<p>[root@vpn uferes]# \/etc\/init.d\/httpd reload<br \/>\nReloading httpd:<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Exemplo: idata.teste.net Editar e alterar as defini\u00e7\u00f5es: vim \/etc\/httpd\/vhosts.d\/idata.teste.net.conf NameVirtualHost idata.teste.net:80 ServerAdmin log@teste.net ServerName idata.teste.net DocumentRoot \/var\/www\/vhosts\/idata.teste.net Include \/etc\/httpd\/teste\/saas.teste.conf ErrorLog \/var\/log\/httpd\/idata.teste.net.error_log CustomLog \/var\/log\/httpd\/idata.teste.net.access_log combined HostnameLookups Off UseCanonicalName Off ServerSignature On Criar os arquivos de log: [root@zeus uferes]# touch \/var\/log\/httpd\/idata.teste.net.access_log [root@zeus uferes]# touch \/var\/log\/httpd\/idata.teste.net.error_log Criar o&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts\/665"}],"collection":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=665"}],"version-history":[{"count":1,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts\/665\/revisions"}],"predecessor-version":[{"id":666,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts\/665\/revisions\/666"}],"wp:attachment":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}