Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
lpi2:squid [2013/12/30 02:46] ingo_wichmann [Eintrag aus Cache Löschen] |
lpi2:squid [2024/08/07 10:39] (aktuell) |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== Squid Out of the Box ====== | ====== Squid Out of the Box ====== | ||
===== Benötigte Pakete ===== | ===== Benötigte Pakete ===== | ||
- | Fedora, Debian, SuSE: | + | Fedora, Debian (ab 12), SuSE: |
squid | squid | ||
+ | Debian (bis 11): | ||
+ | squid3 | ||
===== Squid starten und testen ===== | ===== Squid starten und testen ===== | ||
- | /etc/init.d/squid start | + | service squid start |
netcat -v localhost 3128 | netcat -v localhost 3128 | ||
GET http://www.heise.de/ HTTP/1.1 | GET http://www.heise.de/ HTTP/1.1 | ||
Zeile 14: | Zeile 16: | ||
Konfigurationsdatei vor Neustart testen: | Konfigurationsdatei vor Neustart testen: | ||
- | squid -k parse | + | squid -k check |
====== Squid für das lokale Netzwerk ====== | ====== Squid für das lokale Netzwerk ====== | ||
Zeile 22: | Zeile 24: | ||
http_access allow our_networks | http_access allow our_networks | ||
</file> | </file> | ||
+ | |||
+ | ====== 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 ====== | ====== Eintrag aus Cache Löschen ====== | ||
Zeile 30: | Zeile 42: | ||
<file> | <file> | ||
acl PURGE method PURGE | acl PURGE method PURGE | ||
- | acl localhost src 127.0.0.1 | ||
http_access allow PURGE localhost | http_access allow PURGE localhost | ||
http_access deny PURGE | http_access deny PURGE | ||
Zeile 44: | Zeile 55: | ||
====== Benutzerauthentifizierung gegen PAM / /etc/shadow ====== | ====== Benutzerauthentifizierung gegen PAM / /etc/shadow ====== | ||
''/etc/squid/squid.conf'': | ''/etc/squid/squid.conf'': | ||
- | <file> | + | <file txt /etc/squid/conf.d/pam_auth> |
- | auth_param basic program /usr/lib/squid/pam_auth | + | auth_param basic program /usr/lib/squid/basic_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 password proxy_auth REQUIRED | ||
- | acl our_networks src 192.168.1.0/24 | + | acl homenet src 192.168.231.0/24 |
- | http_access allow our_networks password | + | http_access allow homenet password |
</file> | </file> | ||
- | Bei Fedora müssen noch die Dateisystem-Rechte angepasst werden: | + | chmod g+s /usr/lib/squid/basic_pam_auth |
- | groupadd shadow | + | service squid reload |
- | 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: | Kleiner Test: |