Linuxhotel Wiki

Wie ging das nochmal?

Benutzer-Werkzeuge

Webseiten-Werkzeuge


lpi2:squid

Dies ist eine alte Version des Dokuments!


Squid Out of the Box

Benötigte Pakete

Fedora, Debian, SuSE:

squid

Squid starten und testen

/etc/init.d/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

Benutzerauthentifizierung gegen PAM / /etc/shadow

/etc/squid/squid.conf:

auth_param basic program /usr/lib/squid/pam_auth 
# in älteren squid-Versionen heißt es ''authenticate_program /usr/lib/squid/pam_auth'' statt auth_param ...
acl password proxy_auth REQUIRED
acl our_networks src 192.168.1.0/24
http_access allow our_networks password

Bei Fedora müssen noch die Dateisystem-Rechte angepasst werden:

groupadd shadow
chgrp shadow /etc/shadow
chmod g+r /etc/shadow
chgrp shadow /usr/lib/squid/pam_auth
chmod g+s /usr/lib/squid/pam_auth
/etc/init.d/squid restart

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.1328535843.txt.gz · Zuletzt geändert: 2013/12/30 02:42 (Externe Bearbeitung)