Forward proxy service

squid

Squid is a high-performance proxy cache server. Squid supports FTP, gopher, HTTPS and HTTP protocols. Unlike general proxy caching software, squid uses a separate, non modular, I/O driven process to handle all client requests.

1. Server configuration

yum install squid
 Loaded plug-ins: langpacks
 Resolving dependencies
 -->Checking transactions
 --->Package squid.x86-64.7.3.3.8-11.el7 will be installed
 -->Processing dependency perl(DBI) required by package 7: squid-3.3.8-11.el7.x86 ʄ
-->Processing dependency perl(Data::Dumper), which is required by package 7: squid-3.3.8-11.el7.x86_
...

After opening the squid service, view the interface used

[root@www ~]# systemctl start squid
[root@www ~]# netstat -antlupe | grep squid
tcp6       0      0 :::3128                 :::*                    LISTEN      0          1997181    8529/(squid-1)      
udp        0      0 0.0.0.0:42829           0.0.0.0:*                           23         1997178    8529/(squid-1)      
udp6       0      0 :::46985                :::*                                23         1997177    8529/(squid-1)      

Edit the configuration file, / etc/squid/squid.conf

        55 # And finally deny all other access to this prox
        56 # http_access deny all  ##No access for all
        57 http_access allow all   ##Allow everyone access
        58 # Squid normally listens to port 3128
        59 http_port 3128
        60
        61 # Uncomment and adjust the following to add a disk cache directory.
        62 cache_dir ufs /var/spool/squid 100 16 256  ##  When accessing, it will be established in / var/spool/squid16A directory.16There are256Subdirectory, cache limit is100M,Exceed100M Automatic coverage

The cache directory described in the configuration file will not be displayed when the service is not restarted when it is just established
Display after restart,

[root@www ~]# cd /var/spool/squid/
[root@www squid]# ls
[root@www squid]# systemctl restart squid.service 
[root@www squid]# ls
00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F  swap.state
[root@www squid]# ls 00
00  0D  1A  27  34  41  4E  5B  68  75  82  8F  9C  A9  B6  C3  D0  DD  EA  F7
01  0E  1B  28  35  42  4F  5C  69  76  83  90  9D  AA  B7  C4  D1  DE  EB  F8
02  0F  1C  29  36  43  50  5D  6A  77  84  91  9E  AB  B8  C5  D2  DF  EC  F9
03  10  1D  2A  37  44  51  5E  6B  78  85  92  9F  AC  B9  C6  D3  E0  ED  FA
04  11  1E  2B  38  45  52  5F  6C  79  86  93  A0  AD  BA  C7  D4  E1  EE  FB
05  12  1F  2C  39  46  53  60  6D  7A  87  94  A1  AE  BB  C8  D5  E2  EF  FC
06  13  20  2D  3A  47  54  61  6E  7B  88  95  A2  AF  BC  C9  D6  E3  F0  FD
07  14  21  2E  3B  48  55  62  6F  7C  89  96  A3  B0  BD  CA  D7  E4  F1  FE
08  15  22  2F  3C  49  56  63  70  7D  8A  97  A4  B1  BE  CB  D8  E5  F2  FF
09  16  23  30  3D  4A  57  64  71  7E  8B  98  A5  B2  BF  CC  D9  E6  F3
0A  17  24  31  3E  4B  58  65  72  7F  8C  99  A6  B3  C0  CD  DA  E7  F4
0B  18  25  32  3F  4C  59  66  73  80  8D  9A  A7  B4  C1  CE  DB  E8  F5
0C  19  26  33  40  4D  5A  67  74  81  8E  9B  A8  B5  C2  CF  DC  E9  F6
//Server settings

Tags: ftp yum

Posted on Tue, 24 Mar 2020 11:35:34 -0400 by satanclaus