Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung | |||
centos:squid [14.11.2011 11:49. ] – [Authentifizierung mit NCSA-AUTH] django | centos:squid [20.04.2018 09:08. ] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== SQUID - Installation und Konfiguration ====== | ||
+ | {{: | ||
+ | Im ersten Schritt installieren wir den Proxy-Server **Squid**. | ||
+ | ===== Installation ===== | ||
+ | Wie soll es anders sein, funktioniert die Installation der benötigten Programme im gewohnten Rahmen via **yum**, welches wir als User **root** ausführen. | ||
+ | # su - | ||
+ | |||
+ | # yum install squid | ||
+ | Was uns das Paket **squid** alles mitbringt offenbart eine Blick, nach erfolgter Installation des Paketes, in das **RPM**. | ||
+ | < | ||
+ | Name : squid Relocations: | ||
+ | Version | ||
+ | Release | ||
+ | Install Date: Do 10 Dez 2009 14:00:30 CET Build Host: builder16.centos.org | ||
+ | Group : System Environment/ | ||
+ | Size : 3690075 | ||
+ | Signature | ||
+ | Summary | ||
+ | Description : | ||
+ | Squid is a high-performance proxy caching server for Web clients, | ||
+ | supporting FTP, gopher, and HTTP data objects. Unlike traditional | ||
+ | caching software, Squid handles all requests in a single, | ||
+ | non-blocking, | ||
+ | hot objects cached in RAM, caches DNS lookups, supports non-blocking | ||
+ | DNS lookups, and implements negative caching of failed requests. | ||
+ | |||
+ | Squid consists of a main server program squid, a Domain Name System | ||
+ | lookup program (dnsserver), | ||
+ | (ftpget), and some management and client tools. | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | /etc/squid | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ... | ||
+ | |||
+ | ... | ||
+ | / | ||
+ | / | ||
+ | ===== Konfiguration des Proxy' | ||
+ | Die Konfiguration des Proxyservers erfolgt über die zentrale Konfigurationsdatei // | ||
+ | # vim / | ||
+ | ==== Authentifizierung mit NCSA-AUTH ==== | ||
+ | Damit sich jeder Nutzer an jedem Rechner setzen und Verbindungen zum Internet aufbauen kann, aktivieren wir die **// | ||
+ | |||
+ | Zu erst überprüfen wir, ob der entsprechende Authentification-Helper vorhanden und installiert ist. | ||
+ | # rpm -ql squid | grep ncsa_auth | ||
+ | < | ||
+ | / | ||
+ | |||
+ | Dann legen wir uns ein entsprechendes Passwortfile (mit dem User bofh) an: | ||
+ | < | ||
+ | Die Option **-c** verwenden wir, da das File noch nicht existiert und wir ein entsprechendes anlegen wollen. Alle weiteren User werden dann mit | ||
+ | < | ||
+ | angelegt. | ||
+ | |||
+ | Zu guter Letzt konfigurieren wir nun **nsca_auth** für die Squid Autentifizierung in der Konfigurationsdatei **/ | ||
+ | Aktivierung der NSCA_Authentifizierung: | ||
+ | < | ||
+ | auth_param basic children 4 | ||
+ | auth_param basic realm Squid proxy-caching web server | ||
+ | auth_param basic credentialsttl 2 hours | ||
+ | auth_param basic casesensitive off</ | ||
+ | Aktivierung einer ACL für den Zugriff: | ||
+ | < | ||
+ | http_access allow ncsa_users</ | ||
+ | Somit beschränkt sich das gesamte Konfigurationsfile auf folgende Einträge: | ||
+ | < | ||
+ | http_port 3128 | ||
+ | hierarchy_stoplist cgi-bin ? | ||
+ | acl QUERY urlpath_regex cgi-bin \? | ||
+ | cache deny QUERY | ||
+ | acl apache rep_header Server ^Apache | ||
+ | broken_vary_encoding allow apache | ||
+ | logformat common %>a %ui %un [%tl] "%rm %ru HTTP/ | ||
+ | access_log / | ||
+ | auth_param basic program / | ||
+ | auth_param basic children 4 | ||
+ | auth_param basic realm Squid proxy-caching web server | ||
+ | auth_param basic credentialsttl 2 hours | ||
+ | auth_param basic casesensitive off | ||
+ | refresh_pattern ^ftp: | ||
+ | refresh_pattern ^gopher: | ||
+ | refresh_pattern . | ||
+ | acl all src 0.0.0.0/ | ||
+ | acl manager proto cache_object | ||
+ | acl localhost src 127.0.0.1/ | ||
+ | acl to_localhost dst 127.0.0.0/8 | ||
+ | acl SSL_ports port 443 | ||
+ | acl Safe_ports port 80 # http | ||
+ | acl Safe_ports port 21 # ftp | ||
+ | acl Safe_ports port 443 # https | ||
+ | acl Safe_ports port 70 # gopher | ||
+ | acl Safe_ports port 210 # wais | ||
+ | acl Safe_ports port 1025-65535 | ||
+ | acl Safe_ports port 280 # http-mgmt | ||
+ | acl Safe_ports port 488 # gss-http | ||
+ | acl Safe_ports port 591 # filemaker | ||
+ | acl Safe_ports port 777 # multiling http | ||
+ | acl CONNECT method CONNECT | ||
+ | acl ncsa_users proxy_auth REQUIRED | ||
+ | http_access allow ncsa_users | ||
+ | http_access allow manager localhost | ||
+ | http_access deny manager | ||
+ | http_access deny !Safe_ports | ||
+ | http_access deny CONNECT !SSL_ports | ||
+ | http_access allow localhost | ||
+ | http_access deny all | ||
+ | http_reply_access allow all | ||
+ | icp_access allow all | ||
+ | coredump_dir / | ||
+ | |||
+ | ==== Authentifizierung mit LDAP-AUTH ==== | ||
+ | Weitaus komfortabler, | ||
+ | |||
+ | Zu erst überprüfen wir, ob der entsprechende Authentification-Helper vorhanden und funktionsfähig ist. | ||
+ | # / | ||
+ | |||
+ | Anschließende geben wir folgende Werte ein: | ||
+ | **User-ID [Leerzeichen] Passwort** | ||
+ | also z.B. | ||
+ | < | ||
+ | In der Logdatei unseres LDAP-server wird dann der Erfolg entsprechend quittiert: | ||
+ | < | ||
+ | Feb 4 19:43:05 nss slapd[21642]: | ||
+ | Feb 4 19:43:05 nss slapd[21642]: | ||
+ | Feb 4 19:43:05 nss slapd[21642]: | ||
+ | Feb 4 19:43:05 nss slapd[21642]: | ||
+ | Feb 4 19:43:05 nss slapd[21642]: | ||
+ | Feb 4 19:43:05 nss slapd[21642]: | ||
+ | Feb 4 19:43:05 nss slapd[21642]: | ||
+ | Feb 4 19:43:05 nss slapd[21642]: | ||
+ | Mit **err=0** wird uns der erfolgreiche Test quittiert. | ||
+ | |||
+ | Im Gegensatz zur vorhergenannten Variante [[centos: | ||
+ | |||
+ | Anschließend konfigurieren wir nun **ldap_auth** für die Squid Autentifizierung in der Konfigurationsdatei **/ | ||
+ | Aktivierung der LDAP_Authentifizierung: | ||
+ | < | ||
+ | auth_param basic children 5 | ||
+ | auth_param basic realm Squid-Proxyserver im SOHO-LAN bei nausch.org | ||
+ | auth_param basic credentialsttl 15 minutes | ||
+ | auth_param basic casesensitive off | ||
+ | </ | ||
+ | Aktivierung einer ACL für den Zugriff: | ||
+ | < | ||
+ | http_access allow ldapauth</ | ||
+ | Somit beschränkt sich das gesamte Konfigurationsfile auf folgende Einträge: | ||
+ | < | ||
+ | http_port 3128 | ||
+ | hierarchy_stoplist cgi-bin ? | ||
+ | acl QUERY urlpath_regex cgi-bin \? | ||
+ | cache deny QUERY | ||
+ | acl apache rep_header Server ^Apache | ||
+ | broken_vary_encoding allow apache | ||
+ | logformat common %>a %ui %un [%tl] "%rm %ru HTTP/ | ||
+ | access_log / | ||
+ | auth_param basic program / | ||
+ | refresh_pattern ^ftp: | ||
+ | refresh_pattern ^gopher: | ||
+ | refresh_pattern . | ||
+ | acl all src 0.0.0.0/ | ||
+ | acl manager proto cache_object | ||
+ | acl localhost src 127.0.0.1/ | ||
+ | acl to_localhost dst 127.0.0.0/8 | ||
+ | acl SSL_ports port 443 | ||
+ | acl Safe_ports port 80 # http | ||
+ | acl Safe_ports port 21 # ftp | ||
+ | acl Safe_ports port 443 # https | ||
+ | acl Safe_ports port 70 # gopher | ||
+ | acl Safe_ports port 210 # wais | ||
+ | acl Safe_ports port 1025-65535 | ||
+ | acl Safe_ports port 280 # http-mgmt | ||
+ | acl Safe_ports port 488 # gss-http | ||
+ | acl Safe_ports port 591 # filemaker | ||
+ | acl Safe_ports port 777 # multiling http | ||
+ | acl CONNECT method CONNECT | ||
+ | acl ldapauth proxy_auth REQUIRED | ||
+ | http_access allow ldapauth | ||
+ | http_access allow manager localhost | ||
+ | http_access deny manager | ||
+ | http_access deny !Safe_ports | ||
+ | http_access deny CONNECT !SSL_ports | ||
+ | http_access allow localhost | ||
+ | http_access deny all | ||
+ | http_reply_access allow all | ||
+ | icp_access allow all | ||
+ | coredump_dir / | ||
+ | </ | ||
+ | Nach erfolgtem Start des squid (**service squid start**) sehen wir bei den Benutzeranmeldungen im squid.log (**/ | ||
+ | < | ||
+ | Aug 6 22:44:45 nss slapd[5821]: | ||
+ | Aug 6 22:44:45 nss slapd[5821]: | ||
+ | Aug 6 22:44:45 nss slapd[5821]: | ||
+ | Aug 6 22:44:45 nss slapd[5821]: | ||
+ | Aug 6 22:44:45 nss slapd[5821]: | ||
+ | Aug 6 22:44:45 nss slapd[5821]: | ||
+ | Aug 6 22:44:45 nss slapd[5821]: | ||
+ | Aug 6 22:44:45 nss slapd[5821]: | ||
+ | Aug 6 22:44:45 nss slapd[5821]: | ||
+ | </ | ||
+ | ===== Starten des Squid-Proxys ===== | ||
+ | Nun starten wir das erste mal unsere neuen Dienste und zwar zuerst den **squid**: | ||
+ | # service squid start | ||
+ | | ||
+ | ===== automatisches Starten der Dienste beim Systemstart | ||
+ | Damit der squid-Daemon automatisch bei jedem Systemstart startet, kann die Einrichtung der Start-Scripte über folgende Befehle erreicht werden: | ||
+ | # chkconfig squid on | ||
+ | |||
+ | Die Überprüfungung ob der Dienst (Daemon) squid auch wirklich bei jedem Systemstart automatisch mit gestartet werden, kann durch folgenden Befehle erreicht werden: | ||
+ | # chkconfig --list | grep squid | ||
+ | | ||
+ | |||
+ | Wichtig sind jeweils die Schalter **on** bzw. **Ein** bei den Runleveln - **2 3 4 5**. | ||
+ | ====== Content- und Virenfilter mit Dansguardian und ClamAV ====== | ||
+ | Die Konfiguration des Content- und Virenfilters mit Hilfe von [[http:// | ||
+ | |||