Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
| Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
|
fortgeschrittene:squid [2011/04/21 08:34] iw |
fortgeschrittene:squid [2024/08/07 10:39] (aktuell) ingo_wichmann [Squid starten und testen] |
||
|---|---|---|---|
| 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 localhost 3128 | + | netcat -v localhost 3128 |
| GET http://www.heise.de/ HTTP/1.1 | GET http://www.heise.de/ HTTP/1.1 | ||
| Host: www.heise.de | Host: www.heise.de | ||
| 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 ====== | ||
| + | (( Details siehe: http://wiki.squid-cache.org/SquidFaq/OperatingSquid )) | ||
| + | ===== PURGE Zugriff erlauben ===== | ||
| + | ''/etc/squid3/squid.conf'' : | ||
| + | |||
| + | <file> | ||
| + | acl PURGE method PURGE | ||
| + | http_access allow PURGE localhost | ||
| + | http_access deny PURGE | ||
| + | </file> | ||
| + | |||
| + | ===== 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 ====== | ====== 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: | ||
| echo -en "nutzer14:villa" | mimencode | echo -en "nutzer14:villa" | mimencode | ||
| - | telnet localhost 3128 | + | netcat -v localhost 3128 |
| GET http://www.heise.de/ HTTP/1.1 | GET http://www.heise.de/ HTTP/1.1 | ||
| Host: www.heise.de | Host: www.heise.de | ||