Docsity

como configurar squid, Manuais, Projetos, Pesquisas de Tecnologias de Rede e TCP/IP

Toggle sidebar
bg1
Configuração do arquivo squid.conf
http_port 192.168.0.15:1990
visible_hostname Microcamp-Bonsucesso
# acesso total a todos os IPs da rede
acl todos src all
############### Inicio do cache ##########
cache_mem 64 MB
maximum_object_size_in_memory 64 KB
maximum_object_size 512 MB
minimum_object_size 0 KB
cache_swap_low 90
cache_swap_high 95
cache_dir ufs /var/spool/squid3 2048 16 256
cache_access_log /var/log/squid3/access.log
error_directory /usr/share/squid3/errors/pt-br
refresh_pattern ^ftp: 15 20% 2280
refresh_pattern ^gopher: 15 0% 2280
refresh_pattern . 15 20% 2280
############## fim do cache #############
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 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 901 # swat
acl Safe_ports port 1025-65535 # portas altas
########### inicio do bloqueio ou permissao por sites ##############
acl sitedebloqueio dstdomain "/etc/squid3/sitedebloqueio"
http_access deny sitedebloqueio
acl downloads urlpath_regex \.avi$ \.mvb$ \.mp3$ \.mp4$ \.mp4? \.exe$ \.exe? \.avi? \.mvb?
\.mp3?
http_access deny downloads
acl extensoes url_regex -i .exe .mp3 .vqf .tar.gz .gz .rpm .zip .rar .avi .mpe .mpg .rm .iso .raw
.wav .mov .torrent
http_access deny extensoes
pf3

Pré-visualização parcial do texto

Baixe como configurar squid e outras Manuais, Projetos, Pesquisas em PDF para Tecnologias de Rede e TCP/IP, somente na Docsity!

Configuração do arquivo squid.conf

http_port 192.168.0.15: visible_hostname Microcamp-Bonsucesso

acesso total a todos os IPs da rede

acl todos src all ############### Inicio do cache ########## cache_mem 64 MB maximum_object_size_in_memory 64 KB maximum_object_size 512 MB minimum_object_size 0 KB cache_swap_low 90 cache_swap_high 95 cache_dir ufs /var/spool/squid3 2048 16 256 cache_access_log /var/log/squid3/access.log cache_mgr [email protected] error_directory /usr/share/squid3/errors/pt-br refresh_pattern ^ftp: 15 20% 2280 refresh_pattern ^gopher: 15 0% 2280 refresh_pattern. 15 20% 2280 ############## fim do cache ############# 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 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl Safe_ports port 901 # swat acl Safe_ports port 1025-65535 # portas altas ########### inicio do bloqueio ou permissao por sites ############## acl sitedebloqueio dstdomain "/etc/squid3/sitedebloqueio" http_access deny sitedebloqueio acl downloads urlpath_regex .avi$ .mvb$ .mp3$ .mp4$ .mp4? .exe$ .exe? .avi? .mvb? .mp3? http_access deny downloads acl extensoes url_regex -i .exe .mp3 .vqf .tar.gz .gz .rpm .zip .rar .avi .mpe .mpg .rm .iso .raw .wav .mov .torrent http_access deny extensoes

############ fim do bloqueio ou permissao por sites ############### acl redelocal src 192.168.20.0/ http_access deny !redelocal acl purge method PURGE acl CONNECT method CONNECT http_access allow manager localhost http_access deny manager http_access allow purge localhost http_access deny purge http_access deny !Safe_ports http_access allow localhost http_access allow redelocal http_access deny todos

Crie o Diretório swap

Este comando irá criar o diretório de swap cache do Squid squid3 -z Obs. Repare que o comando squid3 -z irá criar as subpastas de cache do Squid3, verifique com o comando ls /var/spool/squid

crie o diretório onde serão armazenados o cache e os logs,

através dos comandos abaixo:

mkdir /usr/local/squid/var/cache mkdir /usr/local/squid/var/logs chown squid.squid /usr/local/squid/ -R /usr/local/squid/sbin/squid -z reiniciando o squid: /etc/init.d/squid restart