]> git.piffa.net Git - doc/.git/commitdiff
Prima stesura di Squid, da correggere
authorAndrea Manni <andrea@andreamanni.com>
Mon, 18 May 2009 11:02:02 +0000 (13:02 +0200)
committerAndrea Manni <andrea@andreamanni.com>
Mon, 18 May 2009 11:02:02 +0000 (13:02 +0200)
servizi.html
source/servizi.txt

index ef650023bcf1d4b608028327c898ae2cb90cd66d..9c85f5e2ba9b9ce54ce3d2fc5274645b4f9f164b 100644 (file)
           </ul>
         </li>
 
-        <li><a class="reference internal" href="#squid" id="id16"
-        name="id16">2&nbsp;&nbsp;&nbsp;Squid</a></li>
+        <li>
+          <a class="reference internal" href="#squid" id="id16"
+          name="id16">2&nbsp;&nbsp;&nbsp;Squid</a>
+
+          <ul class="auto-toc">
+            <li>
+              <a class="reference internal" href=
+              "#configurazione-squid-conf" id="id17" name=
+              "id17">2.1&nbsp;&nbsp;&nbsp;Configurazione:
+              squid.conf</a>
+
+              <ul class="auto-toc">
+                <li><a class="reference internal" href=
+                "#tag-maximum-object-size" id="id18" name=
+                "id18">2.1.1&nbsp;&nbsp;&nbsp;TAG:
+                maximum_object_size</a></li>
+
+                <li><a class="reference internal" href=
+                "#tag-cache-mem" id="id19" name=
+                "id19">2.1.2&nbsp;&nbsp;&nbsp;TAG:
+                cache_mem</a></li>
+
+                <li><a class="reference internal" href=
+                "#tag-minimum-object-size" id="id20" name=
+                "id20">2.1.3&nbsp;&nbsp;&nbsp;TAG:
+                minimum_object_size</a></li>
+              </ul>
+            </li>
+
+            <li>
+              <a class="reference internal" href=
+              "#negoziazione-degli-accesi-al-servizio" id="id21"
+              name="id21">2.2&nbsp;&nbsp;&nbsp;Negoziazione degli
+              accesi al servizio</a>
+
+              <ul class="auto-toc">
+                <li><a class="reference internal" href=
+                "#acl-e-http-access" id="id22" name=
+                "id22">2.2.1&nbsp;&nbsp;&nbsp;ACL e http
+                access</a></li>
+              </ul>
+            </li>
+
+            <li>
+              <a class="reference internal" href="#testare-squid"
+              id="id23" name="id23">2.3&nbsp;&nbsp;&nbsp;Testare
+              Squid</a>
+
+              <ul class="auto-toc">
+                <li><a class="reference internal" href="#wgetrc"
+                id="id24" name=
+                "id24">2.3.1&nbsp;&nbsp;&nbsp;wgetrc</a></li>
+              </ul>
+            </li>
+          </ul>
+        </li>
 
         <li>
-          <a class="reference internal" href="#apache" id="id17"
-          name="id17">3&nbsp;&nbsp;&nbsp;Apache</a>
+          <a class="reference internal" href="#apache" id="id25"
+          name="id25">3&nbsp;&nbsp;&nbsp;Apache</a>
 
           <ul class="auto-toc">
             <li><a class="reference internal" href=
-            "#pacchetti-da-installare" id="id18" name=
-            "id18">3.1&nbsp;&nbsp;&nbsp;Pacchetti da
+            "#pacchetti-da-installare" id="id26" name=
+            "id26">3.1&nbsp;&nbsp;&nbsp;Pacchetti da
             installare::</a></li>
 
             <li><a class="reference internal" href=
-            "#configurazione-di-apache" id="id19" name=
-            "id19">3.2&nbsp;&nbsp;&nbsp;Configurazione di
+            "#configurazione-di-apache" id="id27" name=
+            "id27">3.2&nbsp;&nbsp;&nbsp;Configurazione di
             Apache</a></li>
 
             <li><a class="reference internal" href="#apache-conf"
-            id="id20" name=
-            "id20">3.3&nbsp;&nbsp;&nbsp;apache.conf</a></li>
+            id="id28" name=
+            "id28">3.3&nbsp;&nbsp;&nbsp;apache.conf</a></li>
 
             <li>
               <a class="reference internal" href=
-              "#installazione-di-php" id="id21" name=
-              "id21">3.4&nbsp;&nbsp;&nbsp;Installazione di PHP</a>
+              "#installazione-di-php" id="id29" name=
+              "id29">3.4&nbsp;&nbsp;&nbsp;Installazione di PHP</a>
 
               <ul class="auto-toc">
                 <li><a class="reference internal" href=
-                "#test-del-modulo-php" id="id22" name=
-                "id22">3.4.1&nbsp;&nbsp;&nbsp;Test del modulo
+                "#test-del-modulo-php" id="id30" name=
+                "id30">3.4.1&nbsp;&nbsp;&nbsp;Test del modulo
                 php</a></li>
 
                 <li><a class="reference internal" href=
-                "#installazione-del-supporto-per-mysql" id="id23"
-                name="id23">3.4.2&nbsp;&nbsp;&nbsp;Installazione
+                "#installazione-del-supporto-per-mysql" id="id31"
+                name="id31">3.4.2&nbsp;&nbsp;&nbsp;Installazione
                 del supporto per Mysql</a></li>
 
                 <li><a class="reference internal" href=
-                "#phpmyadmin" id="id24" name=
-                "id24">3.4.3&nbsp;&nbsp;&nbsp;phpmyadmin</a></li>
+                "#phpmyadmin" id="id32" name=
+                "id32">3.4.3&nbsp;&nbsp;&nbsp;phpmyadmin</a></li>
 
                 <li><a class="reference internal" href=
                 "#installazione-del-supporto-per-postgresql" id=
-                "id25" name=
-                "id25">3.4.4&nbsp;&nbsp;&nbsp;Installazione del
+                "id33" name=
+                "id33">3.4.4&nbsp;&nbsp;&nbsp;Installazione del
                 supporto per Postgresql</a></li>
 
                 <li><a class="reference internal" href=
-                "#phppgadmin" id="id26" name=
-                "id26">3.4.5&nbsp;&nbsp;&nbsp;phppgadmin</a></li>
+                "#phppgadmin" id="id34" name=
+                "id34">3.4.5&nbsp;&nbsp;&nbsp;phppgadmin</a></li>
               </ul>
             </li>
 
             <li>
               <a class="reference internal" href="#virtual-hosts"
-              id="id27" name="id27">3.5&nbsp;&nbsp;&nbsp;Virtual
+              id="id35" name="id35">3.5&nbsp;&nbsp;&nbsp;Virtual
               hosts</a>
 
               <ul class="auto-toc">
                 <li><a class="reference internal" href=
-                "#gestione-dns" id="id28" name=
-                "id28">3.5.1&nbsp;&nbsp;&nbsp;Gestione DNS</a></li>
+                "#gestione-dns" id="id36" name=
+                "id36">3.5.1&nbsp;&nbsp;&nbsp;Gestione DNS</a></li>
 
                 <li><a class="reference internal" href=
-                "#virtual-host" id="id29" name=
-                "id29">3.5.2&nbsp;&nbsp;&nbsp;Virtual host</a></li>
+                "#virtual-host" id="id37" name=
+                "id37">3.5.2&nbsp;&nbsp;&nbsp;Virtual host</a></li>
               </ul>
             </li>
 
             <li>
               <a class="reference internal" href=
-              "#negoziazione-accessi" id="id30" name=
-              "id30">3.6&nbsp;&nbsp;&nbsp;Negoziazione accessi</a>
+              "#negoziazione-accessi" id="id38" name=
+              "id38">3.6&nbsp;&nbsp;&nbsp;Negoziazione accessi</a>
 
               <ul class="auto-toc">
                 <li><a class="reference internal" href=
-                "#limiti-su-base-ip" id="id31" name=
-                "id31">3.6.1&nbsp;&nbsp;&nbsp;Limiti su base
+                "#limiti-su-base-ip" id="id39" name=
+                "id39">3.6.1&nbsp;&nbsp;&nbsp;Limiti su base
                 ip</a></li>
               </ul>
             </li>
 
             <li>
               <a class="reference internal" href=
-              "#user-authentication" id="id32" name=
-              "id32">3.7&nbsp;&nbsp;&nbsp;User Authentication</a>
+              "#user-authentication" id="id40" name=
+              "id40">3.7&nbsp;&nbsp;&nbsp;User Authentication</a>
 
               <ul class="auto-toc">
                 <li><a class="reference internal" href=
-                "#definire-la-cartella" id="id33" name=
-                "id33">3.7.1&nbsp;&nbsp;&nbsp;Definire la
+                "#definire-la-cartella" id="id41" name=
+                "id41">3.7.1&nbsp;&nbsp;&nbsp;Definire la
                 cartella</a></li>
 
                 <li><a class="reference internal" href=
-                "#creazione-del-database-delle-passwords" id="id34"
-                name="id34">3.7.2&nbsp;&nbsp;&nbsp;Creazione del
+                "#creazione-del-database-delle-passwords" id="id42"
+                name="id42">3.7.2&nbsp;&nbsp;&nbsp;Creazione del
                 database delle passwords</a></li>
 
                 <li><a class="reference internal" href="#id3" id=
-                "id35" name=
-                "id35">3.7.3&nbsp;&nbsp;&nbsp;Configurazione di
+                "id43" name=
+                "id43">3.7.3&nbsp;&nbsp;&nbsp;Configurazione di
                 Apache</a></li>
               </ul>
             </li>
 
             <li><a class="reference internal" href="#cavets" id=
-            "id36" name="id36">3.8&nbsp;&nbsp;&nbsp;Cavets</a></li>
+            "id44" name="id44">3.8&nbsp;&nbsp;&nbsp;Cavets</a></li>
           </ul>
         </li>
 
         <li>
           <a class="reference internal" href="#domain-name-system"
-          id="id37" name="id37">4&nbsp;&nbsp;&nbsp;Domain Name
+          id="id45" name="id45">4&nbsp;&nbsp;&nbsp;Domain Name
           System</a>
 
           <ul class="auto-toc">
             <li><a class="reference internal" href=
-            "#nomi-di-dominio" id="id38" name=
-            "id38">4.1&nbsp;&nbsp;&nbsp;Nomi di dominio</a></li>
+            "#nomi-di-dominio" id="id46" name=
+            "id46">4.1&nbsp;&nbsp;&nbsp;Nomi di dominio</a></li>
 
             <li><a class="reference internal" href=
-            "#tipologie-di-record" id="id39" name=
-            "id39">4.2&nbsp;&nbsp;&nbsp;Tipologie di
+            "#tipologie-di-record" id="id47" name=
+            "id47">4.2&nbsp;&nbsp;&nbsp;Tipologie di
             record</a></li>
 
             <li><a class="reference internal" href="#utilizzo" id=
-            "id40" name=
-            "id40">4.3&nbsp;&nbsp;&nbsp;Utilizzo</a></li>
+            "id48" name=
+            "id48">4.3&nbsp;&nbsp;&nbsp;Utilizzo</a></li>
 
             <li><a class="reference internal" href=
-            "#risoluzione-dei-nomi-di-dominio" id="id41" name=
-            "id41">4.4&nbsp;&nbsp;&nbsp;Risoluzione dei nomi di
+            "#risoluzione-dei-nomi-di-dominio" id="id49" name=
+            "id49">4.4&nbsp;&nbsp;&nbsp;Risoluzione dei nomi di
             dominio</a></li>
 
-            <li><a class="reference internal" href="#dig" id="id42"
-            name="id42">4.5&nbsp;&nbsp;&nbsp;Dig</a></li>
+            <li><a class="reference internal" href="#dig" id="id50"
+            name="id50">4.5&nbsp;&nbsp;&nbsp;Dig</a></li>
           </ul>
         </li>
 
-        <li><a class="reference internal" href="#dnsmasq" id="id43"
-        name="id43">5&nbsp;&nbsp;&nbsp;DNSmasq</a></li>
+        <li><a class="reference internal" href="#dnsmasq" id="id51"
+        name="id51">5&nbsp;&nbsp;&nbsp;DNSmasq</a></li>
 
         <li>
-          <a class="reference internal" href="#samba" id="id44"
-          name="id44">6&nbsp;&nbsp;&nbsp;Samba</a>
+          <a class="reference internal" href="#samba" id="id52"
+          name="id52">6&nbsp;&nbsp;&nbsp;Samba</a>
 
           <ul class="auto-toc">
             <li><a class="reference internal" href="#pacchetti" id=
-            "id45" name=
-            "id45">6.1&nbsp;&nbsp;&nbsp;Pacchetti</a></li>
+            "id53" name=
+            "id53">6.1&nbsp;&nbsp;&nbsp;Pacchetti</a></li>
 
             <li><a class="reference internal" href=
-            "#passwords-e-autenticazione" id="id46" name=
-            "id46">6.2&nbsp;&nbsp;&nbsp;Passwords e
+            "#passwords-e-autenticazione" id="id54" name=
+            "id54">6.2&nbsp;&nbsp;&nbsp;Passwords e
             autenticazione</a></li>
 
             <li><a class="reference internal" href=
-            "#creazione-utenti" id="id47" name=
-            "id47">6.3&nbsp;&nbsp;&nbsp;Creazione Utenti</a></li>
+            "#creazione-utenti" id="id55" name=
+            "id55">6.3&nbsp;&nbsp;&nbsp;Creazione Utenti</a></li>
 
             <li>
               <a class="reference internal" href=
-              "#creare-la-condivisione" id="id48" name=
-              "id48">6.4&nbsp;&nbsp;&nbsp;Creare la
+              "#creare-la-condivisione" id="id56" name=
+              "id56">6.4&nbsp;&nbsp;&nbsp;Creare la
               condivisione</a>
 
               <ul class="auto-toc">
                 <li><a class="reference internal" href=
                 "#sicurezza-permessi-di-esecuzione-sul-server" id=
-                "id49" name=
-                "id49">6.4.1&nbsp;&nbsp;&nbsp;Sicurezza: permessi
+                "id57" name=
+                "id57">6.4.1&nbsp;&nbsp;&nbsp;Sicurezza: permessi
                 di esecuzione sul server</a></li>
               </ul>
             </li>
 
             <li><a class="reference internal" href=
             "#configurazione-dell-applicativo-samba-vero-e-proprio"
-            id="id50" name=
-            "id50">6.5&nbsp;&nbsp;&nbsp;Configurazione
+            id="id58" name=
+            "id58">6.5&nbsp;&nbsp;&nbsp;Configurazione
             dell'applicativo Samba vero e proprio.</a></li>
 
             <li><a class="reference internal" href=
-            "#testare-il-servizio" id="id51" name=
-            "id51">6.6&nbsp;&nbsp;&nbsp;Testare il
+            "#testare-il-servizio" id="id59" name=
+            "id59">6.6&nbsp;&nbsp;&nbsp;Testare il
             Servizio</a></li>
           </ul>
         </li>
 
         <li>
-          <a class="reference internal" href="#firewall" id="id52"
-          name="id52">7&nbsp;&nbsp;&nbsp;Firewall</a>
+          <a class="reference internal" href="#firewall" id="id60"
+          name="id60">7&nbsp;&nbsp;&nbsp;Firewall</a>
 
           <ul class="auto-toc">
             <li><a class="reference internal" href="#links" id=
-            "id53" name="id53">7.1&nbsp;&nbsp;&nbsp;Links</a></li>
+            "id61" name="id61">7.1&nbsp;&nbsp;&nbsp;Links</a></li>
 
             <li><a class="reference internal" href="#ipfilter" id=
-            "id54" name=
-            "id54">7.2&nbsp;&nbsp;&nbsp;Ipfilter</a></li>
+            "id62" name=
+            "id62">7.2&nbsp;&nbsp;&nbsp;Ipfilter</a></li>
 
             <li>
               <a class="reference internal" href=
-              "#progettazione-di-un-firewall" id="id55" name=
-              "id55">7.3&nbsp;&nbsp;&nbsp;Progettazione di un
+              "#progettazione-di-un-firewall" id="id63" name=
+              "id63">7.3&nbsp;&nbsp;&nbsp;Progettazione di un
               firewall</a>
 
               <ul class="auto-toc">
                 <li><a class="reference internal" href=
-                "#collocazione" id="id56" name=
-                "id56">7.3.1&nbsp;&nbsp;&nbsp;Collocazione</a></li>
+                "#collocazione" id="id64" name=
+                "id64">7.3.1&nbsp;&nbsp;&nbsp;Collocazione</a></li>
 
                 <li><a class="reference internal" href=
-                "#policy-di-default" id="id57" name=
-                "id57">7.3.2&nbsp;&nbsp;&nbsp;Policy di
+                "#policy-di-default" id="id65" name=
+                "id65">7.3.2&nbsp;&nbsp;&nbsp;Policy di
                 default</a></li>
 
                 <li><a class="reference internal" href="#hardware"
-                id="id58" name=
-                "id58">7.3.3&nbsp;&nbsp;&nbsp;Hardware</a></li>
+                id="id66" name=
+                "id66">7.3.3&nbsp;&nbsp;&nbsp;Hardware</a></li>
               </ul>
             </li>
 
             <li><a class="reference internal" href=
             "#percorso-dei-pacchetti-tra-tabelle-e-catene" id=
-            "id59" name="id59">7.4&nbsp;&nbsp;&nbsp;Percorso dei
+            "id67" name="id67">7.4&nbsp;&nbsp;&nbsp;Percorso dei
             pacchetti tra tabelle e catene</a></li>
 
             <li>
               <a class="reference internal" href=
-              "#concetti-di-base" id="id60" name=
-              "id60">7.5&nbsp;&nbsp;&nbsp;Concetti di base</a>
+              "#concetti-di-base" id="id68" name=
+              "id68">7.5&nbsp;&nbsp;&nbsp;Concetti di base</a>
 
               <ul class="auto-toc">
                 <li><a class="reference internal" href=
-                "#tabelle-catene-regole" id="id61" name=
-                "id61">7.5.1&nbsp;&nbsp;&nbsp;Tabelle, catene,
+                "#tabelle-catene-regole" id="id69" name=
+                "id69">7.5.1&nbsp;&nbsp;&nbsp;Tabelle, catene,
                 regole</a></li>
 
                 <li><a class="reference internal" href="#match" id=
-                "id62" name=
-                "id62">7.5.2&nbsp;&nbsp;&nbsp;Match</a></li>
+                "id70" name=
+                "id70">7.5.2&nbsp;&nbsp;&nbsp;Match</a></li>
 
                 <li><a class="reference internal" href="#targets"
-                id="id63" name=
-                "id63">7.5.3&nbsp;&nbsp;&nbsp;Targets</a></li>
+                id="id71" name=
+                "id71">7.5.3&nbsp;&nbsp;&nbsp;Targets</a></li>
               </ul>
             </li>
 
             <li><a class="reference internal" href=
-            "#tabella-filter" id="id64" name=
-            "id64">7.6&nbsp;&nbsp;&nbsp;Tabella Filter</a></li>
+            "#tabella-filter" id="id72" name=
+            "id72">7.6&nbsp;&nbsp;&nbsp;Tabella Filter</a></li>
 
             <li><a class="reference internal" href=
-            "#gestione-regole-rules" id="id65" name=
-            "id65">7.7&nbsp;&nbsp;&nbsp;Gestione regole
+            "#flush-automatico-per-macchine-remote" id="id73" name=
+            "id73">7.7&nbsp;&nbsp;&nbsp;Flush automatico per
+            macchine remote</a></li>
+
+            <li><a class="reference internal" href=
+            "#gestione-regole-rules" id="id74" name=
+            "id74">7.8&nbsp;&nbsp;&nbsp;Gestione regole
             (rules)</a></li>
           </ul>
         </li>
 
-        <li><a class="reference internal" href="#note" id="id66"
-        name="id66">8&nbsp;&nbsp;&nbsp;NOTE</a></li>
+        <li><a class="reference internal" href="#note" id="id75"
+        name="id75">8&nbsp;&nbsp;&nbsp;NOTE</a></li>
       </ul>
     </div>
 
@@ -1081,7 +1140,7 @@ deb-src http://volatile.debian.org/debian-volatile Lenny/volatile main
           <p>Questo file contiene le opzioni di apt, come ad
           esempio il proxy:</p>
           <pre class="literal-block">
-Acquire::http::Proxy "http://10.10.208.254:3128"
+Acquire::http::Proxy "http://10.10.208.254:3128";
 </pre>
 
           <p>Si tenga conto che se si imposta un proxy per apt sul
@@ -1095,11 +1154,258 @@ Acquire::http::Proxy "http://10.10.208.254:3128"
     <div class="section" id="squid">
       <h1><a class="toc-backref" href=
       "#id16">2&nbsp;&nbsp;&nbsp;Squid</a></h1>
+
+      <p>Per installare Squid si usino i pacchetti:</p>
+      <pre class="literal-block">
+squid3
+</pre>
+
+      <div class="section" id="configurazione-squid-conf">
+        <h2><a class="toc-backref" href=
+        "#id17">2.1&nbsp;&nbsp;&nbsp;Configurazione:
+        squid.conf</a></h2>
+
+        <p>Segue un estratto del file di configurazione:</p>
+        <pre class="literal-block">
+#TAG: cache_dir (1628)
+#       Usage:
+#
+#       cache_dir Type Directory-Name Fs-specific-data [options]
+#
+#       You can specify multiple cache_dir lines to spread the
+#       cache among different disk partitions.
+#       ...
+#Default:
+# cache_dir ufs /var/spool/squid3 100 16 256
+cache_dir aufs /var/spool/squid3 300 24 256
+#         algoritmo
+#              path della cache
+#                                dimensione in MB
+#                                    directory primo livello
+#                                       secondo livello di directory
+</pre>
+
+        <p>Se si modifica la struttura del filesytem della cache di
+        Squid, ad esempio variando il numero delle directory, puo'
+        essere (ed in genere lo e') opportuno rigenerare la
+        struttura della cache di squid. Tipicamente e' opportuno
+        cancellare la vecchia cache e poi generarne una nuova:</p>
+        <pre class="literal-block">
+# /etc/init.d/squid3 stop
+# rm -r /var/spool/squid3/??
+# squid3 -z
+# /etc/init.d/squid3 start
+</pre>
+
+        <div class="section" id="tag-maximum-object-size">
+          <h3><a class="toc-backref" href=
+          "#id18">2.1.1&nbsp;&nbsp;&nbsp;TAG:
+          maximum_object_size</a></h3>
+
+          <p>Questa direttiva imposta la dimensione massima degli
+          oggetti che vengono slvati sul supporto di storaggio,
+          oggetti di dimensioni superiori verranno scaricati ma non
+          tenuti in cache.</p>
+
+          <p>TAG: maximum_object_size (1760):</p>
+          <pre class="literal-block">
+# TAG: maximum_object_size (1760)
+#       Objects larger than this size will NOT be saved on disk.  The
+#       value is specified in kilobytes, and the default is 4MB.  If
+#       you wish to get a high BYTES hit ratio, you should probably
+#       increase this (one 32 MB object hit counts for 3200 10KB
+#       hits).  If you wish to increase speed more than your want to
+#       save bandwidth you should leave this low.
+#
+#       NOTE: if using the LFUDA replacement policy you should increase
+#       this value to maximize the byte hit rate improvement of LFUDA!
+#       See replacement_policy below for a discussion of this policy.
+#
+#Default:
+# maximum_object_size 4096 KB
+maximum_object_size 150 MB
+</pre>
+        </div>
+
+        <div class="section" id="tag-cache-mem">
+          <h3><a class="toc-backref" href=
+          "#id19">2.1.2&nbsp;&nbsp;&nbsp;TAG: cache_mem</a></h3>
+
+          <p><em>Cache_mem</em> imposta quanta memoria RAM
+          utilizzare per la cache di Squid. Questo dipendera' dalla
+          RAM disponibile sul sistema, e da quanta di questa volete
+          mettere a disposizione di Squid. Questo paramentro
+          influisce sulle prestazioni e sul degrado dei supporti di
+          storaggio (sopratutto se magnetici).</p>
+
+          <p>TAG: cache_mem (1566):</p>
+          <pre class="literal-block">
+#       'cache_mem' specifies the ideal amount of memory to be used
+#       for:
+#               * In-Transit objects
+#               * Hot Objects
+#               * Negative-Cached objects
+#Default:
+# cache_mem 8 M
+cache_mem 100 M
+</pre>
+        </div>
+
+        <div class="section" id="tag-minimum-object-size">
+          <h3><a class="toc-backref" href=
+          "#id20">2.1.3&nbsp;&nbsp;&nbsp;TAG:
+          minimum_object_size</a></h3>
+
+          <p>Questo paramentro imposta la dimensione minima degli
+          oggetti salvati nella cache. Settato a <tt class=
+          "docutils literal"><span class="pre">0</span></tt> o a
+          valori molto piccoli puo' influire negativamente sulla
+          deframmentazione del filesytem e consumare un numero
+          elevato di <em>inode</em>.</p>
+
+          <p>TAG: minimum_object_size:</p>
+          <pre class="literal-block">
+#  TAG: minimum_object_size     (bytes)
+#       Objects smaller than this size will NOT be saved on disk.  The
+#       value is specified in kilobytes, and the default is 0 KB, which
+#       means there is no minimum.
+#
+#Default:
+# minimum_object_size 0 KB
+minimum_object_size 0 KB
+</pre>
+        </div>
+      </div>
+
+      <div class="section" id=
+      "negoziazione-degli-accesi-al-servizio">
+        <h2><a class="toc-backref" href=
+        "#id21">2.2&nbsp;&nbsp;&nbsp;Negoziazione degli accesi al
+        servizio</a></h2>
+
+        <p>Squid e' uno di quei servizi soggetto a problemi di tipo
+        <em>open relay</em>, si deve quindi limitare la rete che
+        puo' accedere al servizio.</p>
+
+        <div class="section" id="acl-e-http-access">
+          <h3><a class="toc-backref" href=
+          "#id22">2.2.1&nbsp;&nbsp;&nbsp;ACL e http access</a></h3>
+
+          <p>Si proceda a creare una <tt class=
+          "docutils literal"><span class="pre">ACL</span></tt> di
+          tipo <tt class="docutils literal"><span class=
+          "pre">src</span></tt> per identificare la lostra rete
+          locale, poi si abiliti l'accesso a questa con la
+          direttiva <tt class="docutils literal"><span class=
+          "pre">http_access</span></tt>. Tutto quanto non e'
+          espressamente autorizzato viene poi negato da un
+          <tt class="docutils literal"><span class=
+          "pre">http_access</span> <span class="pre">deny</span>
+          <span class="pre">all</span></tt> finale.</p>
+          <pre class="literal-block">
+#  TAG: acl
+#       Defining an Access List
+#
+#       Every access list definition must begin with an aclname and acltype,
+#       followed by either type-specific arguments or a quoted filename that
+#       they are read from.
+#       ...
+#       ***** ACL TYPES AVAILABLE *****
+#
+#       acl aclname src ip-address/netmask ...          # clients IP address
+# riga 588
+
+# Example rule allowing access from your local networks.
+# Adapt to list your (internal) IP networks from where browsing
+# should be allowed
+#acl localnet src 10.0.0.0/8    # RFC1918 possible internal network
+#acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
+#acl localnet src 192.168.0.0/16        # RFC1918 possible internal network
+#
+acl localnet src 10.10.208.0/24
+# Riga 606
+#  TAG: http_access
+#       Allowing or Denying access based on defined access lists
+#
+#       Access to the HTTP port:
+#       http_access allow|deny [!]aclname ...
+#
+#       NOTE on default values:
+#
+#       If there are no "access" lines present, the default is to deny
+#       the request.
+
+# Riga 643
+# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
+
+# Example rule allowing access from your local networks.
+# Adapt localnet in the ACL section to list your (internal) IP networks
+# from where browsing should be allowed
+#http_access allow localnet
+http_access allow localnet
+</pre>
+        </div>
+      </div>
+
+      <div class="section" id="testare-squid">
+        <h2><a class="toc-backref" href=
+        "#id23">2.3&nbsp;&nbsp;&nbsp;Testare Squid</a></h2>
+
+        <p>Configurato squid e' fondamentale testarne il corretto
+        funzionamento per assicurarsi di non aver creato un
+        <em>open-relay</em>. Per fare dei test significativi serve
+        utilizzare degli host remoti: ci si connetta via ssh a
+        questi per poi utilizzare <tt class=
+        "docutils literal"><span class="pre">wget</span></tt> da
+        riga di comando.</p>
+
+        <div class="section" id="wgetrc">
+          <h3><a class="toc-backref" href=
+          "#id24">2.3.1&nbsp;&nbsp;&nbsp;wgetrc</a></h3>
+
+          <p>Nel file <tt class="docutils literal"><span class=
+          "pre">.wgetrc</span></tt> (si noti il punto iniziale: e'
+          un file nascosto) si puo' impostare il proxy per wget. Si
+          utililizzi l'indirizzo ip del server che si vuole
+          testare, e si seguano i log <tt class=
+          "docutils literal"><span class=
+          "pre">/var/log/squid3/access.log</span></tt> sul
+          server.</p>
+
+          <p>Da notare che la prova va' fatta su una macchina della
+          rete che si vuole testare, non da <em>localhost</em>. Per
+          altro se si utilizzasse <em>direttamente</em> <tt class=
+          "docutils literal"><span class=
+          "pre">localhost</span></tt> non si testerebbe la
+          <em>ACL</em> predisposta, dato che si si rientrerebbe
+          nella ACL (pre-configurata di default) <tt class=
+          "docutils literal"><span class=
+          "pre">localhost</span></tt>.</p>
+
+          <dl class="docutils">
+            <dt>.wgetrc</dt>
+
+            <dd>http_proxy=10.10.208.178:3128</dd>
+          </dl>
+
+          <p>Si proceda a scaricare dal client scelto con un
+          wget:</p>
+          <pre class="literal-block">
+wget http://www.google.it
+</pre>
+
+          <p>Si puo' controllare il corretto funzionamento del
+          server seguendo i log di accesso a Squid:</p>
+          <pre class="literal-block">
+# tail -f /var/log/squid3/access.log
+</pre>
+        </div>
+      </div>
     </div>
 
     <div class="section" id="apache">
       <h1><a class="toc-backref" href=
-      "#id17">3&nbsp;&nbsp;&nbsp;Apache</a></h1>
+      "#id25">3&nbsp;&nbsp;&nbsp;Apache</a></h1>
 
       <p>Apache HTTP Server, o piu' comunemente Apache, e' il nome
       dato alla piattaforma server Web modulare piu' diffusa (ma
@@ -1117,7 +1423,7 @@ Acquire::http::Proxy "http://10.10.208.254:3128"
 
       <div class="section" id="pacchetti-da-installare">
         <h2><a class="toc-backref" href=
-        "#id18">3.1&nbsp;&nbsp;&nbsp;Pacchetti da
+        "#id26">3.1&nbsp;&nbsp;&nbsp;Pacchetti da
         installare::</a></h2>
 
         <blockquote>
@@ -1131,7 +1437,7 @@ Acquire::http::Proxy "http://10.10.208.254:3128"
 
       <div class="section" id="configurazione-di-apache">
         <h2><a class="toc-backref" href=
-        "#id19">3.2&nbsp;&nbsp;&nbsp;Configurazione di
+        "#id27">3.2&nbsp;&nbsp;&nbsp;Configurazione di
         Apache</a></h2>
 
         <p>I file di configurazione di apache si trovano nella
@@ -1190,7 +1496,7 @@ Acquire::http::Proxy "http://10.10.208.254:3128"
 
       <div class="section" id="apache-conf">
         <h2><a class="toc-backref" href=
-        "#id20">3.3&nbsp;&nbsp;&nbsp;apache.conf</a></h2>
+        "#id28">3.3&nbsp;&nbsp;&nbsp;apache.conf</a></h2>
 
         <p>File di configurazione del servizio Apache, contiene le
         impostazioni generiche (ad esempio utilizzo della RAM e
@@ -1247,7 +1553,7 @@ Acquire::http::Proxy "http://10.10.208.254:3128"
 
       <div class="section" id="installazione-di-php">
         <h2><a class="toc-backref" href=
-        "#id21">3.4&nbsp;&nbsp;&nbsp;Installazione di PHP</a></h2>
+        "#id29">3.4&nbsp;&nbsp;&nbsp;Installazione di PHP</a></h2>
 
         <p>Pacchetti da installare: <tt class=
         "docutils literal"><span class="pre">php5</span>
@@ -1255,7 +1561,7 @@ Acquire::http::Proxy "http://10.10.208.254:3128"
 
         <div class="section" id="test-del-modulo-php">
           <h3><a class="toc-backref" href=
-          "#id22">3.4.1&nbsp;&nbsp;&nbsp;Test del modulo
+          "#id30">3.4.1&nbsp;&nbsp;&nbsp;Test del modulo
           php</a></h3>
 
           <p>Creare nella cartella <tt class=
@@ -1285,7 +1591,7 @@ Acquire::http::Proxy "http://10.10.208.254:3128"
         <div class="section" id=
         "installazione-del-supporto-per-mysql">
           <h3><a class="toc-backref" href=
-          "#id23">3.4.2&nbsp;&nbsp;&nbsp;Installazione del supporto
+          "#id31">3.4.2&nbsp;&nbsp;&nbsp;Installazione del supporto
           per Mysql</a></h3>
 
           <p>Installare i pacchetti:</p>
@@ -1302,7 +1608,7 @@ php5-mysql phpmyadmin
 
         <div class="section" id="phpmyadmin">
           <h3><a class="toc-backref" href=
-          "#id24">3.4.3&nbsp;&nbsp;&nbsp;phpmyadmin</a></h3>
+          "#id32">3.4.3&nbsp;&nbsp;&nbsp;phpmyadmin</a></h3>
 
           <p>L'interfaccia web Phpmyadmin non richede
           necessariamente la presenza di un database Mysql locale,
@@ -1327,7 +1633,7 @@ php5-mysql phpmyadmin
         <div class="section" id=
         "installazione-del-supporto-per-postgresql">
           <h3><a class="toc-backref" href=
-          "#id25">3.4.4&nbsp;&nbsp;&nbsp;Installazione del supporto
+          "#id33">3.4.4&nbsp;&nbsp;&nbsp;Installazione del supporto
           per Postgresql</a></h3>
 
           <p>Installare i pacchetti:</p>
@@ -1344,7 +1650,7 @@ php5-pgsql phppgadmin
 
         <div class="section" id="phppgadmin">
           <h3><a class="toc-backref" href=
-          "#id26">3.4.5&nbsp;&nbsp;&nbsp;phppgadmin</a></h3>
+          "#id34">3.4.5&nbsp;&nbsp;&nbsp;phppgadmin</a></h3>
 
           <p>L'interfaccia web Phppgadmin per il database server
           PostgreSQL non richede necessariamente la presenza di un
@@ -1369,7 +1675,7 @@ php5-pgsql phppgadmin
 
       <div class="section" id="virtual-hosts">
         <h2><a class="toc-backref" href=
-        "#id27">3.5&nbsp;&nbsp;&nbsp;Virtual hosts</a></h2>
+        "#id35">3.5&nbsp;&nbsp;&nbsp;Virtual hosts</a></h2>
 
         <blockquote>
           <ul class="simple">
@@ -1410,7 +1716,7 @@ php5-pgsql phppgadmin
 
         <div class="section" id="gestione-dns">
           <h3><a class="toc-backref" href=
-          "#id28">3.5.1&nbsp;&nbsp;&nbsp;Gestione DNS</a></h3>
+          "#id36">3.5.1&nbsp;&nbsp;&nbsp;Gestione DNS</a></h3>
 
           <p>Prima di tutto per poter impostare i virtual hosts
           dovete avere un server DNS che risolva i vostri nomi di
@@ -1493,7 +1799,7 @@ php5-pgsql phppgadmin
 
         <div class="section" id="virtual-host">
           <h3><a class="toc-backref" href=
-          "#id29">3.5.2&nbsp;&nbsp;&nbsp;Virtual host</a></h3>
+          "#id37">3.5.2&nbsp;&nbsp;&nbsp;Virtual host</a></h3>
 
           <p>Esempio di Virtual host:</p>
           <pre class="literal-block">
@@ -1605,7 +1911,7 @@ php5-pgsql phppgadmin
 
       <div class="section" id="negoziazione-accessi">
         <h2><a class="toc-backref" href=
-        "#id30">3.6&nbsp;&nbsp;&nbsp;Negoziazione accessi</a></h2>
+        "#id38">3.6&nbsp;&nbsp;&nbsp;Negoziazione accessi</a></h2>
 
         <p>Tipicamente quando si installa un server web il proprio
         desiderio e' di dare accesso ai materiali disponibili al
@@ -1618,7 +1924,7 @@ php5-pgsql phppgadmin
 
         <div class="section" id="limiti-su-base-ip">
           <h3><a class="toc-backref" href=
-          "#id31">3.6.1&nbsp;&nbsp;&nbsp;Limiti su base ip</a></h3>
+          "#id39">3.6.1&nbsp;&nbsp;&nbsp;Limiti su base ip</a></h3>
 
           <p>La forma piu' semplice di restrizine degli accessi e'
           su base degli indirizzi IP dei client: tipicamente i siti
@@ -1673,7 +1979,7 @@ php5-pgsql phppgadmin
 
       <div class="section" id="user-authentication">
         <h2><a class="toc-backref" href=
-        "#id32">3.7&nbsp;&nbsp;&nbsp;User Authentication</a></h2>
+        "#id40">3.7&nbsp;&nbsp;&nbsp;User Authentication</a></h2>
 
         <p>A volte conviene negoziare gli accessi ad un area di un
         sito tramite autenticazione basata sull'accopiata <em>nome
@@ -1690,7 +1996,7 @@ php5-pgsql phppgadmin
 
         <div class="section" id="definire-la-cartella">
           <h3><a class="toc-backref" href=
-          "#id33">3.7.1&nbsp;&nbsp;&nbsp;Definire la
+          "#id41">3.7.1&nbsp;&nbsp;&nbsp;Definire la
           cartella</a></h3>
 
           <p>Decidere quale sara' il <em>path</em> della cartella
@@ -1707,7 +2013,7 @@ php5-pgsql phppgadmin
         <div class="section" id=
         "creazione-del-database-delle-passwords">
           <h3><a class="toc-backref" href=
-          "#id34">3.7.2&nbsp;&nbsp;&nbsp;Creazione del database
+          "#id42">3.7.2&nbsp;&nbsp;&nbsp;Creazione del database
           delle passwords</a></h3>
 
           <p>Un modo semplice per gestire una database di
@@ -1745,7 +2051,7 @@ htpasswd -c /home/utente/passwords luca
 
         <div class="section" id="id3">
           <h3><a class="toc-backref" href=
-          "#id35">3.7.3&nbsp;&nbsp;&nbsp;Configurazione di
+          "#id43">3.7.3&nbsp;&nbsp;&nbsp;Configurazione di
           Apache</a></h3>
 
           <p>Ora possiamo passare alla configurazione vera e
@@ -1820,7 +2126,7 @@ require valid-user
 
       <div class="section" id="cavets">
         <h2><a class="toc-backref" href=
-        "#id36">3.8&nbsp;&nbsp;&nbsp;Cavets</a></h2>
+        "#id44">3.8&nbsp;&nbsp;&nbsp;Cavets</a></h2>
 
         <p>Problemi di cache:</p>
 
@@ -1845,7 +2151,7 @@ require valid-user
 
     <div class="section" id="domain-name-system">
       <h1><a class="toc-backref" href=
-      "#id37">4&nbsp;&nbsp;&nbsp;Domain Name System</a></h1>
+      "#id45">4&nbsp;&nbsp;&nbsp;Domain Name System</a></h1>
 
       <p>Domain Name System (spesso indicato con DNS) e' un
       servizio utilizzato per la risoluzione di nomi di host in
@@ -1870,7 +2176,7 @@ require valid-user
 
       <div class="section" id="nomi-di-dominio">
         <h2><a class="toc-backref" href=
-        "#id38">4.1&nbsp;&nbsp;&nbsp;Nomi di dominio</a></h2>
+        "#id46">4.1&nbsp;&nbsp;&nbsp;Nomi di dominio</a></h2>
 
         <p>Un nome a dominio e' costituito da una serie di stringhe
         separate da punti, ad esempio it.wikipedia.org. A
@@ -1892,7 +2198,7 @@ require valid-user
 
       <div class="section" id="tipologie-di-record">
         <h2><a class="toc-backref" href=
-        "#id39">4.2&nbsp;&nbsp;&nbsp;Tipologie di record</a></h2>
+        "#id47">4.2&nbsp;&nbsp;&nbsp;Tipologie di record</a></h2>
 
         <p>Ad un nome DNS possono corrispondere diversi tipi di
         informazioni. Per questo motivo, esistono diversi tipi di
@@ -1947,7 +2253,7 @@ require valid-user
 
       <div class="section" id="utilizzo">
         <h2><a class="toc-backref" href=
-        "#id40">4.3&nbsp;&nbsp;&nbsp;Utilizzo</a></h2>
+        "#id48">4.3&nbsp;&nbsp;&nbsp;Utilizzo</a></h2>
 
         <p>I computer vengono identificati in rete grazie agli
         indirizzi <em>IP</em>, questi pero' non sono comodi per gli
@@ -1964,7 +2270,7 @@ PING www.l.google.com (74.125.43.104) 56(84) bytes of data.
 
       <div class="section" id="risoluzione-dei-nomi-di-dominio">
         <h2><a class="toc-backref" href=
-        "#id41">4.4&nbsp;&nbsp;&nbsp;Risoluzione dei nomi di
+        "#id49">4.4&nbsp;&nbsp;&nbsp;Risoluzione dei nomi di
         dominio</a></h2>
 
         <p>Ci sono vari strumenti per interrogare i server DNS e
@@ -2029,7 +2335,7 @@ ns4.mydomain.com.       96208   IN      A       63.251.83.74
 
       <div class="section" id="dig">
         <h2><a class="toc-backref" href=
-        "#id42">4.5&nbsp;&nbsp;&nbsp;Dig</a></h2>
+        "#id50">4.5&nbsp;&nbsp;&nbsp;Dig</a></h2>
 
         <p>Vediamo alcune opzioni utili nell'utilizzo di <tt class=
         "docutils literal"><span class="pre">dig</span></tt> per
@@ -2106,7 +2412,7 @@ l.google.com.           80856   IN      NS      g.l.google.com.
 
     <div class="section" id="dnsmasq">
       <h1><a class="toc-backref" href=
-      "#id43">5&nbsp;&nbsp;&nbsp;DNSmasq</a></h1>
+      "#id51">5&nbsp;&nbsp;&nbsp;DNSmasq</a></h1>
 
       <p>Dnsmasq puo' svolgere le funzioni di un DNS cache /
       forwarder e un server DHCP caratterizzato dalla facilita' di
@@ -2145,7 +2451,7 @@ l.google.com.           80856   IN      NS      g.l.google.com.
 
     <div class="section" id="samba">
       <h1><a class="toc-backref" href=
-      "#id44">6&nbsp;&nbsp;&nbsp;Samba</a></h1>
+      "#id52">6&nbsp;&nbsp;&nbsp;Samba</a></h1>
 
       <p>Samba e' un progetto libero che fornisce servizi di
       condivisione di file e stampanti a client SMB/CIFS.</p>
@@ -2166,7 +2472,7 @@ l.google.com.           80856   IN      NS      g.l.google.com.
 
       <div class="section" id="pacchetti">
         <h2><a class="toc-backref" href=
-        "#id45">6.1&nbsp;&nbsp;&nbsp;Pacchetti</a></h2>
+        "#id53">6.1&nbsp;&nbsp;&nbsp;Pacchetti</a></h2>
 
         <p>Pacchetti da installare per utilizzare Samba in
         modalita' client <a class="footnote-reference" href="#id5"
@@ -2219,7 +2525,7 @@ dpkg-reconfigure samba-common
 
       <div class="section" id="passwords-e-autenticazione">
         <h2><a class="toc-backref" href=
-        "#id46">6.2&nbsp;&nbsp;&nbsp;Passwords e
+        "#id54">6.2&nbsp;&nbsp;&nbsp;Passwords e
         autenticazione</a></h2>
 
         <p>Per poter configurare Samba in modo che usi un sistema
@@ -2280,7 +2586,7 @@ dpkg-reconfigure samba-common
 
       <div class="section" id="creazione-utenti">
         <h2><a class="toc-backref" href=
-        "#id47">6.3&nbsp;&nbsp;&nbsp;Creazione Utenti</a></h2>
+        "#id55">6.3&nbsp;&nbsp;&nbsp;Creazione Utenti</a></h2>
 
         <p>Creiamo per primo l'utente sotto GNU/Linux, facendo
         attenzione a <em>non dargli una shell di sistema</em>. Gli
@@ -2317,7 +2623,7 @@ smbpasswd  sambo
 
       <div class="section" id="creare-la-condivisione">
         <h2><a class="toc-backref" href=
-        "#id48">6.4&nbsp;&nbsp;&nbsp;Creare la
+        "#id56">6.4&nbsp;&nbsp;&nbsp;Creare la
         condivisione</a></h2>
 
         <p>La condivisione altro non e' che una cartella sul server
@@ -2344,7 +2650,7 @@ smbpasswd  sambo
         <div class="section" id=
         "sicurezza-permessi-di-esecuzione-sul-server">
           <h3><a class="toc-backref" href=
-          "#id49">6.4.1&nbsp;&nbsp;&nbsp;Sicurezza: permessi di
+          "#id57">6.4.1&nbsp;&nbsp;&nbsp;Sicurezza: permessi di
           esecuzione sul server</a></h3>
 
           <p>Bisognerebbe notare sul server i permessi di
@@ -2374,7 +2680,7 @@ smbpasswd  sambo
       <div class="section" id=
       "configurazione-dell-applicativo-samba-vero-e-proprio">
         <h2><a class="toc-backref" href=
-        "#id50">6.5&nbsp;&nbsp;&nbsp;Configurazione
+        "#id58">6.5&nbsp;&nbsp;&nbsp;Configurazione
         dell'applicativo Samba vero e proprio.</a></h2>
 
         <p>Avendo preparato gli utenti (ancora una volta: non si
@@ -2414,7 +2720,7 @@ smbpasswd  sambo
 
       <div class="section" id="testare-il-servizio">
         <h2><a class="toc-backref" href=
-        "#id51">6.6&nbsp;&nbsp;&nbsp;Testare il Servizio</a></h2>
+        "#id59">6.6&nbsp;&nbsp;&nbsp;Testare il Servizio</a></h2>
 
         <p>Come testare il servizio</p>
 
@@ -2454,7 +2760,7 @@ mount -t smbfs //localhost/sambo_share /mnt/sambo_mount/ --verbose -o user=sambo
 
     <div class="section" id="firewall">
       <h1><a class="toc-backref" href=
-      "#id52">7&nbsp;&nbsp;&nbsp;Firewall</a></h1>
+      "#id60">7&nbsp;&nbsp;&nbsp;Firewall</a></h1>
 
       <p>In Informatica, nell'ambito delle reti di computer, un
       firewall (termine inglese dal significato originario di
@@ -2504,7 +2810,7 @@ mount -t smbfs //localhost/sambo_share /mnt/sambo_mount/ --verbose -o user=sambo
 
       <div class="section" id="links">
         <h2><a class="toc-backref" href=
-        "#id53">7.1&nbsp;&nbsp;&nbsp;Links</a></h2>
+        "#id61">7.1&nbsp;&nbsp;&nbsp;Links</a></h2>
 
         <ul class="simple">
           <li><a class="reference external" href=
@@ -2518,7 +2824,7 @@ mount -t smbfs //localhost/sambo_share /mnt/sambo_mount/ --verbose -o user=sambo
 
       <div class="section" id="ipfilter">
         <h2><a class="toc-backref" href=
-        "#id54">7.2&nbsp;&nbsp;&nbsp;Ipfilter</a></h2>
+        "#id62">7.2&nbsp;&nbsp;&nbsp;Ipfilter</a></h2>
 
         <p>Link: <a class="reference external" href=
         "http://iptables-tutorial.frozentux.net/iptables-tutorial.html#IPFILTERING">
@@ -2554,7 +2860,7 @@ mount -t smbfs //localhost/sambo_share /mnt/sambo_mount/ --verbose -o user=sambo
 
       <div class="section" id="progettazione-di-un-firewall">
         <h2><a class="toc-backref" href=
-        "#id55">7.3&nbsp;&nbsp;&nbsp;Progettazione di un
+        "#id63">7.3&nbsp;&nbsp;&nbsp;Progettazione di un
         firewall</a></h2>
 
         <p>Per implementare un firewall bisogna decidere un aio di
@@ -2563,7 +2869,7 @@ mount -t smbfs //localhost/sambo_share /mnt/sambo_mount/ --verbose -o user=sambo
 
         <div class="section" id="collocazione">
           <h3><a class="toc-backref" href=
-          "#id56">7.3.1&nbsp;&nbsp;&nbsp;Collocazione</a></h3>
+          "#id64">7.3.1&nbsp;&nbsp;&nbsp;Collocazione</a></h3>
 
           <p>DMZ e MZ, internet, intranet, extranet. Frammentazione
           della rete, decidere se diversi reparti di una azienda si
@@ -2595,7 +2901,7 @@ mount -t smbfs //localhost/sambo_share /mnt/sambo_mount/ --verbose -o user=sambo
 
         <div class="section" id="policy-di-default">
           <h3><a class="toc-backref" href=
-          "#id57">7.3.2&nbsp;&nbsp;&nbsp;Policy di default</a></h3>
+          "#id65">7.3.2&nbsp;&nbsp;&nbsp;Policy di default</a></h3>
 
           <p>Drop o Accept: conseguenze per sicurezza, facilita' di
           gestione.</p>
@@ -2603,7 +2909,7 @@ mount -t smbfs //localhost/sambo_share /mnt/sambo_mount/ --verbose -o user=sambo
 
         <div class="section" id="hardware">
           <h3><a class="toc-backref" href=
-          "#id58">7.3.3&nbsp;&nbsp;&nbsp;Hardware</a></h3>
+          "#id66">7.3.3&nbsp;&nbsp;&nbsp;Hardware</a></h3>
 
           <p>Sostanzialmente potremmo distinquere due tipologie di
           hardware:</p>
@@ -2631,7 +2937,7 @@ mount -t smbfs //localhost/sambo_share /mnt/sambo_mount/ --verbose -o user=sambo
       <div class="section" id=
       "percorso-dei-pacchetti-tra-tabelle-e-catene">
         <h2><a class="toc-backref" href=
-        "#id59">7.4&nbsp;&nbsp;&nbsp;Percorso dei pacchetti tra
+        "#id67">7.4&nbsp;&nbsp;&nbsp;Percorso dei pacchetti tra
         tabelle e catene</a></h2>
 
         <p>link: <a class="reference external" href=
@@ -2641,11 +2947,11 @@ mount -t smbfs //localhost/sambo_share /mnt/sambo_mount/ --verbose -o user=sambo
 
       <div class="section" id="concetti-di-base">
         <h2><a class="toc-backref" href=
-        "#id60">7.5&nbsp;&nbsp;&nbsp;Concetti di base</a></h2>
+        "#id68">7.5&nbsp;&nbsp;&nbsp;Concetti di base</a></h2>
 
         <div class="section" id="tabelle-catene-regole">
           <h3><a class="toc-backref" href=
-          "#id61">7.5.1&nbsp;&nbsp;&nbsp;Tabelle, catene,
+          "#id69">7.5.1&nbsp;&nbsp;&nbsp;Tabelle, catene,
           regole</a></h3>
 
           <p>Iptables lavora su 3 tabelle (tables) di default:</p>
@@ -2672,7 +2978,7 @@ mount -t smbfs //localhost/sambo_share /mnt/sambo_mount/ --verbose -o user=sambo
 
         <div class="section" id="match">
           <h3><a class="toc-backref" href=
-          "#id62">7.5.2&nbsp;&nbsp;&nbsp;Match</a></h3>
+          "#id70">7.5.2&nbsp;&nbsp;&nbsp;Match</a></h3>
 
           <p>I Match di una regola (rule) servono a testare un
           pacchetto per valutare se corrisponda a certe
@@ -2724,7 +3030,7 @@ mount -t smbfs //localhost/sambo_share /mnt/sambo_mount/ --verbose -o user=sambo
 
         <div class="section" id="targets">
           <h3><a class="toc-backref" href=
-          "#id63">7.5.3&nbsp;&nbsp;&nbsp;Targets</a></h3>
+          "#id71">7.5.3&nbsp;&nbsp;&nbsp;Targets</a></h3>
 
           <p>Se un pacchetto soddisfa le condizioni del Match
           <em>salta</em> (jump) su uno dei target possibili, in
@@ -2853,7 +3159,7 @@ mount -t smbfs //localhost/sambo_share /mnt/sambo_mount/ --verbose -o user=sambo
 
       <div class="section" id="tabella-filter">
         <h2><a class="toc-backref" href=
-        "#id64">7.6&nbsp;&nbsp;&nbsp;Tabella Filter</a></h2>
+        "#id72">7.6&nbsp;&nbsp;&nbsp;Tabella Filter</a></h2>
 
         <p>E' quella implicita e predefinita (-t filter) Riguarda
         le attivitÃ&nbsp; di filtraggio del traffico. Ha 3 catene
@@ -2874,9 +3180,37 @@ mount -t smbfs //localhost/sambo_share /mnt/sambo_mount/ --verbose -o user=sambo
         -j ACCEPT</p>
       </div>
 
+      <div class="section" id=
+      "flush-automatico-per-macchine-remote">
+        <h2><a class="toc-backref" href=
+        "#id73">7.7&nbsp;&nbsp;&nbsp;Flush automatico per macchine
+        remote</a></h2>
+
+        <p>Se state provando una configurazione del firewall per
+        una macchina remota e' buona norma per evitare brutte
+        figure attivare uno script che faccia il <em>flush</em>
+        delle regole dopo qualche minuto. Potreste infatti
+        inavvertitamente impostare una regola che vi impedisca di
+        raggiungere la macchina remota, cosi' da non poter neanche
+        eliminare quella regola e ripristinare la situazioe
+        precedente.</p>
+
+        <p><em>Veramnete</em>, prima di lavorare sul firewall di
+        una macchina remota inpostate almeno un <tt class=
+        "docutils literal"><span class="pre">at</span> <span class=
+        "pre">now</span> <span class="pre">+5</span> <span class=
+        "pre">min</span></tt> o con un'oretta di margine per fare
+        il <em>flush</em> delle regole (su tutte le tabelle):</p>
+        <pre class="literal-block">
+    at now +5 min
+at&gt; /sbin/iptables -F
+at&gt; [CTR+d]
+</pre>
+      </div>
+
       <div class="section" id="gestione-regole-rules">
         <h2><a class="toc-backref" href=
-        "#id65">7.7&nbsp;&nbsp;&nbsp;Gestione regole
+        "#id74">7.8&nbsp;&nbsp;&nbsp;Gestione regole
         (rules)</a></h2>
 
         <p>Il comando iptables viene usato per ogni attivitÃ&nbsp;
@@ -2944,7 +3278,7 @@ mount -t smbfs //localhost/sambo_share /mnt/sambo_mount/ --verbose -o user=sambo
 
     <div class="section" id="note">
       <h1><a class="toc-backref" href=
-      "#id66">8&nbsp;&nbsp;&nbsp;NOTE</a></h1>
+      "#id75">8&nbsp;&nbsp;&nbsp;NOTE</a></h1>
 
       <ul class="simple">
         <li>controllare apache</li>
index cf8e88e9e8c816f200172aa4a13f6cbd7848f3e4..12a372a0b3361bfadc9b41c9ea5c45aa80c94a9a 100644 (file)
@@ -235,7 +235,7 @@ Gli archivi sono generalmente:
 
 Questo file contiene le opzioni di apt, come ad esempio il proxy::
 
-    Acquire::http::Proxy "http://10.10.208.254:3128"
+    Acquire::http::Proxy "http://10.10.208.254:3128";
 
 Si tenga conto che se si imposta un proxy per apt sul proprio portatile e tornati a casa propria si vuole scaricare nuovi pacchetti si dovra' disabilitare il proxy.
 
@@ -243,6 +243,175 @@ Si tenga conto che se si imposta un proxy per apt sul proprio portatile e tornat
 Squid
 ======
 
+Per installare Squid si usino i pacchetti::
+
+       squid3
+
+
+Configurazione: squid.conf
+-------------------------------
+
+Segue un estratto del file di configurazione::
+
+       #TAG: cache_dir (1628)
+       #       Usage:
+       #
+       #       cache_dir Type Directory-Name Fs-specific-data [options]
+       #
+       #       You can specify multiple cache_dir lines to spread the
+       #       cache among different disk partitions.
+       #       ...
+       #Default:
+       # cache_dir ufs /var/spool/squid3 100 16 256
+       cache_dir aufs /var/spool/squid3 300 24 256
+       #         algoritmo
+       #              path della cache
+       #                                dimensione in MB
+       #                                    directory primo livello
+       #                                       secondo livello di directory 
+
+Se si modifica la struttura del filesytem della cache di Squid, ad esempio variando il numero delle directory, puo' essere (ed in genere lo e') opportuno rigenerare la struttura della cache di squid. Tipicamente e' opportuno cancellare la vecchia cache e poi generarne una nuova::
+
+       # /etc/init.d/squid3 stop
+       # rm -r /var/spool/squid3/??
+       # squid3 -z
+       # /etc/init.d/squid3 start
+
+TAG: maximum_object_size
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Questa direttiva imposta la dimensione massima degli oggetti che vengono slvati sul supporto di storaggio, oggetti di dimensioni superiori verranno scaricati ma non tenuti in cache.
+
+TAG: maximum_object_size (1760)::
+
+       # TAG: maximum_object_size (1760)
+       #       Objects larger than this size will NOT be saved on disk.  The
+       #       value is specified in kilobytes, and the default is 4MB.  If
+       #       you wish to get a high BYTES hit ratio, you should probably
+       #       increase this (one 32 MB object hit counts for 3200 10KB
+       #       hits).  If you wish to increase speed more than your want to
+       #       save bandwidth you should leave this low.
+       #
+       #       NOTE: if using the LFUDA replacement policy you should increase
+       #       this value to maximize the byte hit rate improvement of LFUDA!
+       #       See replacement_policy below for a discussion of this policy.
+       #
+       #Default:
+       # maximum_object_size 4096 KB
+       maximum_object_size 150 MB
+       
+TAG: cache_mem
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+*Cache_mem* imposta quanta memoria RAM utilizzare per la cache di Squid.
+Questo dipendera' dalla RAM disponibile sul sistema, e da quanta di questa volete mettere a disposizione di Squid.
+Questo paramentro influisce sulle prestazioni e sul degrado dei supporti di storaggio (sopratutto se magnetici).
+
+TAG: cache_mem   (1566)::
+
+       #       'cache_mem' specifies the ideal amount of memory to be used
+       #       for:
+       #               * In-Transit objects
+       #               * Hot Objects
+       #               * Negative-Cached objects
+       #Default:
+       # cache_mem 8 M
+       cache_mem 100 M
+
+
+TAG: minimum_object_size
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Questo paramentro imposta la dimensione minima degli oggetti salvati nella cache. Settato a ``0`` o a valori molto piccoli puo' influire negativamente sulla deframmentazione del filesytem e consumare un numero elevato di *inode*.
+
+TAG: minimum_object_size::
+
+       #  TAG: minimum_object_size     (bytes)
+       #       Objects smaller than this size will NOT be saved on disk.  The
+       #       value is specified in kilobytes, and the default is 0 KB, which
+       #       means there is no minimum.
+       #
+       #Default:
+       # minimum_object_size 0 KB
+       minimum_object_size 0 KB
+
+Negoziazione degli accesi al servizio
+---------------------------------------
+
+Squid e' uno di quei servizi soggetto a problemi di tipo *open relay*, si deve quindi limitare la rete che puo' accedere al servizio.
+
+ACL e http access
+~~~~~~~~~~~~~~~~~~~~~
+Si proceda a creare una ``ACL`` di tipo ``src`` per identificare la lostra rete locale, poi si abiliti l'accesso a questa con la direttiva ``http_access``. Tutto quanto non e' espressamente autorizzato viene poi negato da un ``http_access deny all`` finale.
+
+::
+
+       #  TAG: acl
+       #       Defining an Access List
+       #
+       #       Every access list definition must begin with an aclname and acltype,
+       #       followed by either type-specific arguments or a quoted filename that
+       #       they are read from.
+       #       ...
+       #       ***** ACL TYPES AVAILABLE *****
+       #
+       #       acl aclname src ip-address/netmask ...          # clients IP address
+       # riga 588
+       
+       # Example rule allowing access from your local networks.
+       # Adapt to list your (internal) IP networks from where browsing
+       # should be allowed
+       #acl localnet src 10.0.0.0/8    # RFC1918 possible internal network
+       #acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
+       #acl localnet src 192.168.0.0/16        # RFC1918 possible internal network
+       #
+       acl localnet src 10.10.208.0/24    
+       # Riga 606
+       #  TAG: http_access
+       #       Allowing or Denying access based on defined access lists
+       #
+       #       Access to the HTTP port:
+       #       http_access allow|deny [!]aclname ...
+       #
+       #       NOTE on default values:
+       #
+       #       If there are no "access" lines present, the default is to deny
+       #       the request.
+       
+       # Riga 643
+       # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
+       
+       # Example rule allowing access from your local networks.
+       # Adapt localnet in the ACL section to list your (internal) IP networks
+       # from where browsing should be allowed
+       #http_access allow localnet
+       http_access allow localnet
+
+Testare Squid
+---------------
+
+Configurato squid e' fondamentale testarne il corretto funzionamento per assicurarsi di non aver creato un *open-relay*. Per fare dei test significativi serve utilizzare degli host remoti: ci si connetta via ssh a questi per poi utilizzare ``wget`` da riga di comando.
+
+
+wgetrc
+~~~~~~~~~
+
+Nel file ``.wgetrc`` (si noti il punto iniziale: e' un file nascosto) si puo' impostare il proxy per wget. Si utililizzi l'indirizzo ip del server che si vuole testare, e si seguano i log ``/var/log/squid3/access.log`` sul server.
+
+Da notare che la prova va' fatta su una macchina della rete che si vuole testare, non da *localhost*. Per altro se si utilizzasse *direttamente* ``localhost`` non si testerebbe la *ACL* predisposta, dato che si si rientrerebbe nella ACL (pre-configurata di default) ``localhost``.
+
+.wgetrc
+       http_proxy=10.10.208.178:3128
+
+Si proceda a scaricare dal client scelto con un wget::
+
+       wget http://www.google.it
+
+Si puo' controllare il corretto funzionamento del server seguendo i log di accesso a Squid::
+
+       # tail -f /var/log/squid3/access.log
+
+
 Apache
 ========
 
@@ -1070,6 +1239,16 @@ Analoga a: iptables -I INPUT -p tcp --dport 80 -j ACCEPT
 Esempio per permettere ad un pacchetto con IP sorgente 10.0.0.4 di raggiungere il server 192.168.0.1 attraversando il firewall:
 iptables -I FORWARD -s 10.0.0.4 -d 192.168.0.1 -j ACCEPT
 
+Flush automatico per macchine remote
+---------------------------------------
+
+Se state provando una configurazione del firewall per una macchina remota e' buona norma per evitare brutte figure attivare uno script che faccia il *flush* delle regole dopo qualche minuto. Potreste infatti inavvertitamente impostare una regola che vi impedisca di raggiungere la macchina remota, cosi' da non poter neanche eliminare quella regola e ripristinare la situazioe precedente.
+
+*Veramnete*, prima di lavorare sul firewall di una macchina remota inpostate almeno un ``at now +5 min`` o con un'oretta di margine per fare il *flush* delle regole (su tutte le tabelle)::
+
+           at now +5 min
+        at> /sbin/iptables -F
+       at> [CTR+d]