Squid:Squid

From aldeid
Jump to navigation Jump to search

Squid

Description

INCOMPLETE SECTION OR ARTICLE
This section/article is being written and is therefore not complete.
Thank you for your comprehension.

Installation

Pré-requis

INCOMPLETE SECTION OR ARTICLE
This section/article is being written and is therefore not complete.
Thank you for your comprehension.

Installation à partir des sources

# cd /usr/local/src/
# wget http://www.squid-cache.org/Versions/v3/3.0/squid-3.0.STABLE9.tar.gz
# tar xzvf squid-3.0.STABLE9.tar.gz
# cd squid-3.0.STABLE9/
# ./configure
# make all
# make install
Note
Pour connaître la liste des options de compilation, lancez ./configure --help.

Paramétrage

Création du groupe et de l'utilisateur squid

# id squid (pour vérifier l'existence éventuelle de l'utilisateur)
# groupadd squid
# useradd -g squid squid

Création des répertoires et fichiers et affectation des permissions :

# mkdir /var/log/squid/
# touch /var/log/squid/access.log
# touch /var/log/squid/store.log
# mkdir /var/cache/squid/
# touch /var/cache/squid/cache.log
# chown -R squid:squid /var/log/squid /var/cache/squid

Récupération du nom de la machine

# hostname
debian

Editer le fichier /usr/local/squid/etc/squid.conf

---
Replacez dans les sections appropriées :
 visible_hostname debian.aldeid.com
 cache_effective_user squid
 cache_effective_group squid
 pid_filename /var/log/squid/squid.pid
 cache_log /var/log/squid/cache.log
 cache_store_log /var/log/squid/store.log
 cache_dir ufs /var/cache/squid 100 16 256
---
Repérer dans le fichier de conf la ligne
 acl localhost src 127.0.0.1/255.255.255.255
et ajouter à la fin de cette section :
 acl aldeid src 172.16.196.0/255.255.255.0
---
Sous les lignes
 http_access allow manager localhost
 http_access deny manager
Ajouter
 http_access allow aldeid
 http_access deny all
---

Création de l'espace swap :

# /usr/local/squid/sbin/squid -z
2008/12/23 11:03:55| Creating Swap Directories
2008/12/23 11:03:55| /var/cache/squid exists
2008/12/23 11:03:55| Making directories in /var/cache/squid/00
2008/12/23 11:03:55| Making directories in /var/cache/squid/01
2008/12/23 11:03:55| Making directories in /var/cache/squid/02
2008/12/23 11:03:55| Making directories in /var/cache/squid/03
2008/12/23 11:03:55| Making directories in /var/cache/squid/04
2008/12/23 11:03:55| Making directories in /var/cache/squid/05
2008/12/23 11:03:55| Making directories in /var/cache/squid/06
2008/12/23 11:03:55| Making directories in /var/cache/squid/07
2008/12/23 11:03:56| Making directories in /var/cache/squid/08
2008/12/23 11:03:56| Making directories in /var/cache/squid/09
2008/12/23 11:03:56| Making directories in /var/cache/squid/0A
2008/12/23 11:03:56| Making directories in /var/cache/squid/0B
2008/12/23 11:03:56| Making directories in /var/cache/squid/0C
2008/12/23 11:03:56| Making directories in /var/cache/squid/0D
2008/12/23 11:03:56| Making directories in /var/cache/squid/0E
2008/12/23 11:03:56| Making directories in /var/cache/squid/0F

Démarrage de squid en mode debug (non-daemon mode)

# /usr/local/squid/sbin/squid -NCd10
2008/12/23 11:05:08| Starting Squid Cache version 3.0.STABLE9 for i686-pc-linux-gnu...
2008/12/23 11:05:08| Process ID 2771
2008/12/23 11:05:08| With 1024 file descriptors available
2008/12/23 11:05:08| Performing DNS Tests...
2008/12/23 11:05:09| Successful DNS name lookup tests...
2008/12/23 11:05:09| DNS Socket created at 0.0.0.0, port 1024, FD 5
2008/12/23 11:05:09| Adding domain localdomain from /etc/resolv.conf
2008/12/23 11:05:09| Adding nameserver 172.16.196.2 from /etc/resolv.conf
2008/12/23 11:05:09| Unlinkd pipe opened on FD 10
2008/12/23 11:05:09| Swap maxSize 102400 KB, estimated 7876 objects
2008/12/23 11:05:09| Target number of buckets: 393
2008/12/23 11:05:09| Using 8192 Store buckets
2008/12/23 11:05:09| Max Mem  size: 8192 KB
2008/12/23 11:05:09| Max Swap size: 102400 KB
2008/12/23 11:05:09| Rebuilding storage in /var/cache/squid (DIRTY)
2008/12/23 11:05:09| Using Least Load store dir selection
2008/12/23 11:05:09| chdir: /usr/local/squid/var/cache: (2) No such file or directory
2008/12/23 11:05:09| Current Directory is /var/cache/squid
2008/12/23 11:05:09| Loaded Icons.
2008/12/23 11:05:09| Accepting  HTTP connections at 0.0.0.0, port 3128, FD 11.
2008/12/23 11:05:09| Accepting ICP messages at 0.0.0.0, port 3130, FD 12.
2008/12/23 11:05:09| HTCP Disabled.
2008/12/23 11:05:09| Ready to serve requests.
2008/12/23 11:05:10| Done scanning /var/cache/squid swaplog (0 entries)
2008/12/23 11:05:10| Finished rebuilding storage from disk.
2008/12/23 11:05:10|         0 Entries scanned
2008/12/23 11:05:10|         0 Invalid entries.
2008/12/23 11:05:10|         0 With invalid flags.
2008/12/23 11:05:10|         0 Objects loaded.
2008/12/23 11:05:10|         0 Objects expired.
2008/12/23 11:05:10|         0 Objects cancelled.
2008/12/23 11:05:10|         0 Duplicate URLs purged.
2008/12/23 11:05:10|         0 Swapfile clashes avoided.
2008/12/23 11:05:10|   Took 1.00 seconds (  0.00 objects/sec).
2008/12/23 11:05:10| Beginning Validation Procedure
2008/12/23 11:05:10|   Completed Validation Procedure
2008/12/23 11:05:10|   Validated 25 Entries
2008/12/23 11:05:10|   store_swap_size = 0
2008/12/23 11:05:10| storeLateRelease: released 0 objects

Tester squid afin de corriger les éventuelles erreurs. Une fois que tout fonctionne correctement, lancer squid en mode daemon :

# /usr/local/squid/sbin/squid


Démarrage

/usr/local/squid/sbin/squid -D -sY

---CONF A TESTER --- auth_param basic program /usr/local/squid/libexec/ncsa_auth /usr/local/squid/etc/users auth_param basic children 5 auth_param basic realm Squid proxy-caching web server auth_param basic credentialsttl 2 hoursauth_param basic casesensitive off

acl AuthUsers proxy_auth REQUIRED acl reseau_local src 172.20.30.0/24 http_access allow reseau_local AuthUsers ---/CONF A TESTER ---


Liste des paramètres

+----------------+----------------------------------------------------------------+
| Paramètre      | Description                                                    |
+----------------+----------------------------------------------------------------+
| auth_param     | Paramètre d'authentification. Le format utilisé est :          |
|                |   auth_param <scheme> <parameter> [setting]                    |
|                |                                                                |
|                | où schema peut prendre les valeurs "basic" et "?????" :        |
|                |                                                                |
|                | SCHEME BASIC                                                   |
|                | ============                                                   |
|                | Les valeurs possibles de <parameter> sont :                    |
|                | * basic program <program> : par exemple :                      |
|                |     auth_param basic program /usr/local/squid/etc/passwd       |
|                | * realm
|                | * credentialsttl
|                | * 
|                | * 
|                | * 
|                | * 
|                | * 
INCOMPLETE SECTION OR ARTICLE
This section/article is being written and is therefore not complete.
Thank you for your comprehension.

Utilisation

INCOMPLETE SECTION OR ARTICLE
This section/article is being written and is therefore not complete.
Thank you for your comprehension.