Squid Cache (squid.conf)
Fiz este arquivo para a configuração de um squid básico, porém transparente. Tirei os comentários para ficar mais leve.
Depois do squid instalado e do arquivo copiado para /etc/squid/squid.conf é preciso usar o iptables ou ipchains para direcionar os pacotes para o squid. As regras de iptables também estarão no arquivo.
Depois do squid instalado e do arquivo copiado para /etc/squid/squid.conf é preciso usar o iptables ou ipchains para direcionar os pacotes para o squid. As regras de iptables também estarão no arquivo.
hierarchy_stoplist cgi-bin ? cache_mem 16 MB cache_swap_low 90 cache_swap_high 95 maximum_object_size 4096 KB cache_dir ufs /var/cache/squid 1000 16 256 cache_access_log /var/log/squid/access.log ftp_user Squid@ # ACLS acl all src 0.0.0.0/0.0.0.0 acl manager proto cache_object acl localhost src 127.0.0.1/255.255.255.255 acl SSL_ports port 443 563 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 563 # https, snews acl Safe_ports port 70 # gopher acl Safe_ports port 210 # wais acl Safe_ports port 1025-65535 # unregistered ports acl Safe_ports port 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl CONNECT method CONNECT http_access allow manager localhost http_access deny manager http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow all icp_access allow all visible_hostname on httpd_accel_host virtual httpd_accel_port 80 httpd_accel_with_proxy on httpd_accel_uses_host_header on #IPTABLES #Estas linhas deverão ser acrescentadas em algum arquivo ex.: /etc/rc.local #. /etc/rc.d/init.d/functions #. /etc/sysconfig/network # echo 1 > /proc/sys/net/ipv4/ip_forward # /sbin/modprobe iptable_nat # iptables -F # iptables -t nat -F # iptables -t nat -A PREROUTING -s 0/0 -p tcp --dport 80 -j REDIRECT --to-port 3128 # iptables -t nat -A PREROUTING -s 0/0 -p udp --dport 80 -j REDIRECT --to-port 3128 # iptables -t nat -A POSTROUTING -s 0/0 -o eth1 -j MASQUERADE
Muito Obrigado