Installazione
Installa gli strumenti Squid3 e Apache.
apt-get install squid3 apache2-utils
Useremo Apache htpasswd per generare una password. Se non vuoi installare pacchetti aggiuntivi, puoi usare perl per generare la tua password.
Eseguire il backup e sostituire Squid3 Configuration
Eseguire il backup delle impostazioni correnti di Squid3.
cp /etc/squid3/squid.conf /etc/squid3/squid.conf.bak
Apri e sostituisci il contenuto /etc/squid3/squid.confcon quanto segue:
http_port 3128
auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/.passwd
auth_param basic children 1
auth_param basic credentialsttl 1 minute
auth_param basic casesensitive off
acl auth proxy_auth REQUIRED
acl localhost src 127.0.0.0/8
http_access allow auth
http_access allow localhost
http_access deny all
cache deny all
forwarded_for delete
request_header_access Via deny all
Note: la porta predefinita per Squid è 3128 , cambiarla in un'altra porta per una migliore sicurezza.
Crea utente Squid3
Crea un nuovo utente per accedere al server Squid3.
htpasswd -c /etc/squid3/.passwd YOUR_USER_NAME
Se non hai installato lo strumento Apache, usa perl per creare la tua autenticazione.
echo -e "YOUR_USERNAME:`perl -le 'print crypt("YOUR_PASSWORD","salt")'`" > /etc/squid3/.passwd
Riavvia il servizio Squid3 e il lavoro è fatto.
/etc/init.d/squid3 restart