Strumenti Utente

Strumenti Sito


proxy_server_squid3

Vediamo di configurare velocemente un server proxy, in questo caso squid3 su Debian

apt install squid3 squid3-common

per configurare editare /etc/squid3/squid.conf

# nano /etc/squid3/squid.conf

Con ip pubblico cerca nel file, decommenta ed aggiungi l' ip

#acl localnet src 10.0.0.0/8    # RFC1918 possible internal network ## ip eventuale pubblico e fisso x.x.x.x
#acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
 acl localnet src 192.168.0.0/16 # RFC1918 possible internal network ## ip della rete 
#acl localnet src fc00::/7       # RFC 4193 local private network range
#acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines

Se avete un ip pubblico dinamico, converrebbe aggiungere e la gamma di variazione del gestore, cioè 151.34 fissi .x.x sono i variabili, basta scrivere solo:

151.34.0.0/24 ossia da ***151.34.0.0*** ad 151.34.255.255

Oppure se il range è solo all' ultimo ottetto

151.34.3.X sarà 151.34.3.0/24 ossia da **151.34.3.0** ad **151.34.3.255**

Poi bisogna decommentare anche queste righe

http_access allow localhost
http_access allow localnet

A volte è necessario cambiare la porta per renderlo un pò più sicuro procediamo così:

http_port 3128 #porta di default

Cambiamola con

http_port 3024 #la porta deve essere una tra 1024 e 65534

Per Eventuale navigazione anonima bisogna modificare questa riga senza decommentare riscriviamo cambiandola:

#forwarded_for on
forwarded_for off

Qui altre modifiche leggendo post qua e la in rete, aggiungere tutto alla fine del conf

request_header_access Allow allow all
request_header_access Authorization allow all
request_header_access WWW-Authenticate allow all
request_header_access Proxy-Authorization allow all
request_header_access Proxy-Authenticate allow all
request_header_access Cache-Control allow all
request_header_access Content-Encoding allow all
request_header_access Content-Length allow all
request_header_access Content-Type allow all
request_header_access Date allow all
request_header_access Expires allow all
request_header_access Host allow all
request_header_access Mime-Version allow all
request_header_access Retry-After allow all
request_header_access Title allow all
request_header_access Connection allow all
request_header_access Proxy-Connection allow all
request_header_access User-Agent allow all
request_header_access Cookie allow all
request_header_access All deny all
request_header_access If-Modified-Since allow all
request_header_access Last-Modified allow all
request_header_access Location allow all
request_header_access Pragma allow all
request_header_access Accept allow all
request_header_access Accept-Charset allow all
request_header_access Accept-Encoding allow all
request_header_access Accept-Language allow all
request_header_access Content-Language allow all

E' tutto salviamo ed usciamo Riavviamo il proxy

/etc/init.d/squid3 restart

Esempi di configurazione

http_port 3128
icp_port 3130
cache_mem 8 MB
cache_dir ufs /usr/local/squid/var/cache 100 16 256
cache_access_log /usr/local/squid/var/logs/access.log
cache_log /usr/local/squid/var/logs/cache.log
cache_store_log /usr/local/squid/var/logs/store.log
emulate_httpd_log off
mime_table /usr/local/squid/etc/mime.conf
pid_filename /usr/local/squid/var/run/squid.pid
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 to_localhost dst 127.0.0.0/8
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 locallan src 192.168.0.0/255.255.255.0
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 localhost
http_access allow locallan
http_access deny all
cache_mgr [email protected]
cache_effective_user nobody
cache_effective_group nobody
visible_hostname proxy.nomedominio.net
append_domain .miodominio.net
proxy_server_squid3.txt · Ultima modifica: 2017/03/13 19:22 da amnesia