Proxy Server con filtraggio dei contenuti della navigazione: differenze tra le versioni

Riga 150: Riga 150:
<pre>
<pre>
# apt-get install squid3 squidclient
# apt-get install squid3 squidclient
</pre>
Il proxy Squid si configura attraverso il suo file di configurazione <tt>/etc/squid3/squid.conf</tt>, che ora creeremo in base alle nostre esigenze:
<pre>
mv /etc/squid3/squid.conf /etc/squid3/squid.conf.original
touch /etc/squid3/squid.conf
nano /etc/squid3/squid.conf
</pre>
con contenuto:
<pre>
# La porta di Squid
http_port 3128 transparent
# Se si modifica la linea seguente occorre lanciare:
# squid3 -f /etc/squid3/squid.conf -z
# per ricostruire la cache
cache_dir ufs /var/spool/squid3 1024 256 256
# I Log
cache_mgr info@miodominio.org
cache_access_log /var/log/squid3/access.log common
cache_log /var/log/squid3/cache.log
cache_store_log /var/log/squid3/store.log
cache_swap_log /var/log/squid3/cache_swap.log
emulate_httpd_log on
# Configuro l'autenticazione su OpenLDAP
# Abilitare le righe seguenti solo se si intende utilizzare
# un server LDAP per l'autenticazione degli utenti
auth_param basic program /usr/lib/squid3/squid_ldap_auth -b "ou=Users,dc=dominio,dc=local" -f "uid=%s" -h 127.0.0.1
auth_param basic children 25
auth_param basic realm Squid proxy Server
auth_param basic credentialsttl 2 hours
# Configurazione minima raccomandata
#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 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 Safe_ports port 22 # SSH
acl CONNECT method CONNECT
# Richiedo l'autenticazione LDAP per proseguire nella navigazione
acl ldapauth proxy_auth REQUIRED
acl authenticated proxy_auth REQUIRED
# Definizione delle reti
acl lan_eth src 10.1.1.0/255.255.255.0
acl lan_wifi src 10.3.1.0/255.255.255.0
# Autorizzo o no la navigazione
http_access allow localhost
http_access allow lan_eth
http_access allow lan_wifi
http_access deny all
# Attivo Squidguard
redirect_program /usr/bin/squidGuard -c /etc/squid3/squidGuard.conf
redirect_children 5
# Imposto l'hostname del Proxy server
visible_hostname firewall
</pre>
</pre>