Linuxhotel Wiki

Wie ging das nochmal?

Benutzer-Werkzeuge

Webseiten-Werkzeuge


lpi2:squid

Squid Out of the Box

Benötigte Pakete

Fedora, Debian (bis 7), SuSE:

squid

Debian (ab 7):

squid3

Squid starten und testen

service squid start
netcat -v localhost 3128
GET http://www.heise.de/ HTTP/1.1 
Host: www.heise.de

(2 mal <Return>)

Konfigurationsdatei vor Neustart testen:

squid -k parse

Squid für das lokale Netzwerk

/etc/squid/squid.conf:

acl our_networks src 192.168.1.0/24
http_access allow our_networks

mehr RAM

cache_mem 256 MB

mehr Plattenplatz

cache_dir

danach mit

squid -z -N

das Cache-Verzeichnis neu aufbauen.

Eintrag aus Cache Löschen

1)

PURGE Zugriff erlauben

/etc/squid3/squid.conf :

acl PURGE method PURGE
http_access allow PURGE localhost
http_access deny PURGE

testen

Seite laden:

 http_proxy='localhost:3128' wget -q -O - http://www.linuxhotel.de/index.html | wc -l

Seite löschen:

squidclient -m PURGE http://www.linuxhotel.de/index.html

Benutzerauthentifizierung gegen PAM / /etc/shadow

/etc/squid/squid.conf:

/etc/squid/conf.d/pam_auth
auth_param basic program /usr/lib/squid/basic_pam_auth
acl password proxy_auth REQUIRED
acl homenet src 192.168.231.0/24
http_access allow homenet password
chmod g+s /usr/lib/squid/basic_pam_auth
service squid reload

Kleiner Test:

echo -en "nutzer14:villa" | mimencode
netcat -v localhost 3128
GET http://www.heise.de/ HTTP/1.1
Host: www.heise.de
Proxy-Authorization: Basic bnV0emVyMTQ6dmlsbGE=

Gängige Optionen

Cache auf 8 GB vergrößern:

cache_dir ufs /var/cache/squid 8000 16 256

Automatische Proxy-Configuration

nicht getestet

Benötigt: apache

/etc/mime.types : ( Debian 3.1 )

application/x-ns-proxy-autoconfig               pac

/etc/apache2/mod_mime-defaults.conf : ( SuSE 10.2 )

AddType application/x-ns-proxy-autoconfig               pac

/var/www/wpad.dat : ( Debian 3.1 )



lpi2/squid.txt · Zuletzt geändert: 2023/09/22 15:07 von ingo_wichmann