<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="pt-BR">
	<id>https://wiki.projetoroot.com.br/index.php?action=history&amp;feed=atom&amp;title=HAProxy-Squid</id>
	<title>HAProxy-Squid - Histórico de revisão</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.projetoroot.com.br/index.php?action=history&amp;feed=atom&amp;title=HAProxy-Squid"/>
	<link rel="alternate" type="text/html" href="https://wiki.projetoroot.com.br/index.php?title=HAProxy-Squid&amp;action=history"/>
	<updated>2026-06-04T01:00:37Z</updated>
	<subtitle>Histórico de revisões para esta página neste wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.projetoroot.com.br/index.php?title=HAProxy-Squid&amp;diff=747&amp;oldid=prev</id>
		<title>Diegocosta: Criou página com &#039;== Sobre == Olá! Visitante, reunimos aqui, informações sobre o processo de instalação e configuração do HAProxy para utilização do Squid, ou seja, nós teremos um Pro...&#039;</title>
		<link rel="alternate" type="text/html" href="https://wiki.projetoroot.com.br/index.php?title=HAProxy-Squid&amp;diff=747&amp;oldid=prev"/>
		<updated>2021-05-21T16:48:21Z</updated>

		<summary type="html">&lt;p&gt;Criou página com &amp;#039;== Sobre == Olá! Visitante, reunimos aqui, informações sobre o processo de instalação e configuração do HAProxy para utilização do Squid, ou seja, nós teremos um Pro...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nova&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Sobre ==&lt;br /&gt;
Olá! Visitante, reunimos aqui, informações sobre o processo de instalação e configuração do HAProxy para utilização do Squid, ou seja, nós teremos um Proxy (squid) com alta disponibilidade (High Availability) em um cenário onde uma ou mais máquinas servidoras podem falhar e o serviço de proxy se mantem funcionando, com isso seu proxy não irá parar caso venha apresentar paradas de manutenção, queda de link, problemas de rede ou hardware.&lt;br /&gt;
&lt;br /&gt;
*** Site Oficial: http://www.haproxy.org/&lt;br /&gt;
&lt;br /&gt;
*** Documentação: http://www.haproxy.org/#docs&lt;br /&gt;
&lt;br /&gt;
== Vídeo ==&lt;br /&gt;
&amp;lt;embedvideo service=&amp;quot;youtube&amp;quot;&amp;gt;https://youtu.be/8xpXvzw-e48&amp;lt;/embedvideo&amp;gt;&lt;br /&gt;
Link: https://youtu.be/8xpXvzw-e48&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Configurar Host&lt;br /&gt;
&lt;br /&gt;
  nano /etc/hosts&lt;br /&gt;
  nano /etc/hostname&lt;br /&gt;
  nano /etc/network/interfaces&lt;br /&gt;
&lt;br /&gt;
* Instalar Pacotes &lt;br /&gt;
  apk add squid ucarp haproxy&lt;br /&gt;
  rc-update add squid&lt;br /&gt;
&lt;br /&gt;
* Configuração do Squid&lt;br /&gt;
  nano /etc/squid/squid.conf&lt;br /&gt;
  &lt;br /&gt;
  acl localnet src 10.0.0.0/8     # RFC1918 possible internal network&lt;br /&gt;
  acl localnet src 172.16.0.0/12  # RFC1918 possible internal network&lt;br /&gt;
  acl localnet src 192.168.0.0/16 # RFC1918 possible internal network&lt;br /&gt;
  &lt;br /&gt;
  cache_mem 16 MB&lt;br /&gt;
  cache_swap_low 90&lt;br /&gt;
  cache_swap_high 95&lt;br /&gt;
  maximum_object_size 4096 KB&lt;br /&gt;
  cache_dir ufs /var/cache/squid 1000 16 256&lt;br /&gt;
  cache_access_log /var/log/squid/access.log&lt;br /&gt;
  &lt;br /&gt;
  acl manager proto cache_object&lt;br /&gt;
  acl SSL_ports port 443 563&lt;br /&gt;
  acl Safe_ports port 80          # http&lt;br /&gt;
  acl Safe_ports port 21          # ftp&lt;br /&gt;
  acl Safe_ports port 443 563     # https, snews&lt;br /&gt;
  acl Safe_ports port 70          # gopher&lt;br /&gt;
  acl Safe_ports port 210         # wais&lt;br /&gt;
  acl Safe_ports port 1025-65535  # unregistered ports&lt;br /&gt;
  acl Safe_ports port 280         # http-mgmt&lt;br /&gt;
  acl Safe_ports port 488         # gss-http&lt;br /&gt;
  acl Safe_ports port 591         # filemaker&lt;br /&gt;
  acl Safe_ports port 777         # multiling http&lt;br /&gt;
  acl CONNECT method CONNECT&lt;br /&gt;
  &lt;br /&gt;
  icp_port 3130&lt;br /&gt;
  icp_access allow all&lt;br /&gt;
  &lt;br /&gt;
  cache_peer IP_Server1 sibling 3128 3130&lt;br /&gt;
  cache_peer IP_Server2 sibling 3128 3130&lt;br /&gt;
  cache_peer IP_Server3 sibling 3128 3130&lt;br /&gt;
  cache_peer IP_Server4 sibling 3128 3130&lt;br /&gt;
  &lt;br /&gt;
  http_access allow localnet&lt;br /&gt;
  http_access deny CONNECT !SSL_ports&lt;br /&gt;
  http_access deny all&lt;br /&gt;
  &lt;br /&gt;
  http_port 3128&lt;br /&gt;
  &lt;br /&gt;
  forwarded_for off&lt;br /&gt;
&lt;br /&gt;
* Configurando Ucarp&lt;br /&gt;
&lt;br /&gt;
  ln -s /etc/init.d/ucarp /etc/init.d/ucarp.eth0&lt;br /&gt;
  cp /etc/conf.d/ucarp /etc/conf.d/ucarp.eth0&lt;br /&gt;
  nano /etc/conf.d/ucarp.eth0&lt;br /&gt;
&lt;br /&gt;
* Configurar conforme infra:&lt;br /&gt;
  UCARP_INTERFACE=eth0&lt;br /&gt;
  UCARP_SOURCEADDRESS= IP_REAL&lt;br /&gt;
  UCARP_VIRTUALADDRESS= IP_PARA_HA&lt;br /&gt;
  UCARP_VIRTUALPREFIX= MASK_SUBREDE&lt;br /&gt;
  UCARP_VHID= ID [1-255]&lt;br /&gt;
  UCARP_PASSFILE=/etc/ucarp/ucarp.pass # &amp;lt;&amp;lt;&amp;lt; Arquivo de SENHA&lt;br /&gt;
&lt;br /&gt;
* Criar arquivo de Senha  &lt;br /&gt;
  nano /etc/ucarp/ucarp.pass &lt;br /&gt;
  &lt;br /&gt;
  inserir senha (exemplo)&lt;br /&gt;
  teste12345&lt;br /&gt;
&lt;br /&gt;
* Colocar na inicialização o UCARP&lt;br /&gt;
  rc-update add ucarp.eth0&lt;br /&gt;
&lt;br /&gt;
* Configurando HA Proxy&lt;br /&gt;
&lt;br /&gt;
  nano /etc/haproxy/haproxy.cfg&lt;br /&gt;
&lt;br /&gt;
  global&lt;br /&gt;
          log /var/log/ha.log   local1&lt;br /&gt;
          log 127.0.0.1   local1 notice&lt;br /&gt;
          maxconn 4096&lt;br /&gt;
          user haproxy&lt;br /&gt;
          group haproxy&lt;br /&gt;
          daemon&lt;br /&gt;
  &lt;br /&gt;
  defaults&lt;br /&gt;
    # 30 minutes of waiting for a web request is crazy,&lt;br /&gt;
    # but some users do it, and then complain the proxy&lt;br /&gt;
    # broke the interwebs.&lt;br /&gt;
    timeout client 30m&lt;br /&gt;
    timeout server 30m&lt;br /&gt;
    # If the server doesnt respond in 4 seconds its dead&lt;br /&gt;
    timeout connect 4s&lt;br /&gt;
  &lt;br /&gt;
  listen HOSTNAME&lt;br /&gt;
  bind 0.0.0.0:80&lt;br /&gt;
  &lt;br /&gt;
    # mode tcp ou http ( tcp [sem verificação de camada 7] http [verifica a camada 7] )&lt;br /&gt;
    mode tcp&lt;br /&gt;
    balance roundrobin&lt;br /&gt;
    &lt;br /&gt;
    stats enable&lt;br /&gt;
    stats realm Statistics&lt;br /&gt;
    stats auth admin:admin&lt;br /&gt;
    stats scope .&lt;br /&gt;
    stats uri /stats?stats&lt;br /&gt;
  &lt;br /&gt;
    server cache1 IP_Server1:3128 check&lt;br /&gt;
    server cache2 IP_Server2:3128 check&lt;br /&gt;
    server cache3 IP_Server3:3128 check&lt;br /&gt;
    server cache4 IP_Server4:3128 check&lt;br /&gt;
  &lt;br /&gt;
* Colocar na inicialização o HAProxy&lt;br /&gt;
  rc-update add haproxy&lt;/div&gt;</summary>
		<author><name>Diegocosta</name></author>
	</entry>
</feed>