Fichier minimal pour Squid
http_port 3128 #Ne pas "cacher" les données des formulaires acl QUERY urlpath_regex cgi-bin \? no_cache deny QUERY cache_mem 8 MBM maximum_object_size_in_memory 8 KB cache_dir ufs /var/spool/squid 100 16 256 cache_access_log /var/log/squid/access.log cache_log /var/log/squid/cache.log cache_store_log /var/log/squid/store.log # Ici mettez le nom de votre machine visible_hostname uranus.freeduc-sup.org pid_filename /var/run/squid.pid #Recommended minimum configuration: 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 # Test des fichiers @ip et mots clés acl porn url_regex "/etc/squid/mot_cle" acl salleTP_PAS_OK src "/etc/squid/adresse_ip" http_access deny porn http_access deny salleTP_PAS_OK # Authentification auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/users auth_param basic realm Squid proxy-caching web serve auth_param basic children 5 acl foo proxy_auth REQUIRED http_access allow foo #Default: #http_access deny all #Messages d'erreurs en FR error_directory /usr/share/squid/errors/French # Pour le proxy cache transparent httpd_accel_host virtual httpd_accel_port 80 httpd_accel_with_proxy on httpd_accel_uses_host_header on
Utiliser des fichiers externes pour la déclaration d'adresses ou de mots clés.
acl salleTP_OK src "/etc/squid/salleTP_OK.txt" acl porn url_regex "/etc/squid/porn.txt" acl salleTP_PAS_OK src "/etc/squid/salleTP_PAS_OK.txt" http access salleTP_OK http access porn http deny salleTP_PAS_OK
Utilisation d'une authentification simple similaire à celle mise en oeuvre dans les .htaccess. Créer le fichier par script ou manuellement avec htpasswd.
authenticate_program /usr/bin/ncsa_auth /etc/squid/users authenticate_children 5 acl_authenticate_users REQUIRED http_access authenticate_users
Combinaison par “ ET ” logique des plages horaire et des salles. Mettre la machine à l'heure avec ntpdate par exemple.
# Interdire les accès en dehors des plages horaires 8h-12h et 14h-18h S Sunday M Monday T Tuesday W Wednesday H Thrusday F Friday A Saturday acl am time MTWHF 08:00-12:00 acl PM time MTWHF 14:00-18:00 http_access allow am salleTP_PAS_OK http_access allow pm salleTP_PAS_OK