Outils pour utilisateurs

Outils du site


Panneau latéral

linux:proxy (lu 12258 fois)

Ceci est une ancienne révision du document !


Proxy

Installation de Squid

apt install squid

Par défaut le fichier de config est énorme, on peut voir le nécessaire avec la commande

sed -e '/^[#;]/d;/^$/d' /etc/squid/squid.conf
acl SSL_ports port 443
acl Safe_ports port 80		# http
acl Safe_ports port 21		# ftp
acl Safe_ports port 443		# https
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 deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost manager
http_access deny manager
http_access allow localhost
http_access deny all
http_port 3128
coredump_dir /var/spool/squid
refresh_pattern ^ftp:		1440	20%	10080
refresh_pattern ^gopher:	1440	0%	1440
refresh_pattern -i (/cgi-bin/|\?) 0	0%	0
refresh_pattern .		0	20%	4320

Un exemple de config (source: http://www.planet-libre.org/index.php?post_id=20956 )

#Port de Squid
http_port 443 #utile pour outrepasser des éventuels blocages de port

#Hostname du proxy
visible_hostname SuperProxy

#Masquage IP header HTTP (X-Forwarded-For: unknown)
forwarded_for off

#Logs
access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log

#Pas de cache
cache deny all

#Serveurs DNS (ici ceux de FDN)
dns_nameservers 80.67.169.12 80.67.169.40

#Cache DNS
positive_dns_ttl 5 minutes #réponse positive
negative_ttl 5 minutes #réponse en erreur

#On attends pas avant de stopper Squid (30s sinon, utilise si cache activé)
shutdown_lifetime 0 seconds

#On accepte tout le monde (déconseillé)
#http_access allow all

#Auth par mot de passe (très peu pratique d'après ce que j'ai vu)
#auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwords
#auth_param basic realm proxy
#acl authenticated proxy_auth REQUIRED
#http_access allow authenticated

#Maison (exemple d'ACL, pour autoriser l'accès à une IP)
acl maison src 123.123.123.123
http_access allow maison
linux/proxy.1507458808.txt.gz · Dernière modification: 08-10-2017 12:33 de edmc73