GNU/Linux >> Znalost Linux >  >> Cent OS

Jak nainstalovat a nakonfigurovat Squid 3 na CentOS

V tomto tutoriálu vám ukážeme, jak nainstalovat a nakonfigurovat Squid 3 na CentOS. Pro ty z vás, kteří nevěděli, Squid je cachovací proxy pro web podporující HTTP, HTTPS , FTP a další. Squid proxy používají různé organizace a poskytovatelé internetu ke snížení šířky pásma a ke zvýšení doby odezvy.

Tento článek předpokládá, že máte alespoň základní znalosti Linuxu, víte, jak používat shell, a co je nejdůležitější, hostujete svůj web na vlastním VPS. Instalace je poměrně jednoduchá a předpokládá, že běží v účtu root, pokud ne, možná budete muset přidat 'sudo ‘ k příkazům pro získání oprávnění root. Ukážu vám krok za krokem instalaci Squidu na server CentOS Linux.

Nainstalujte a nakonfigurujte Squid 3 na CentOS

Krok 1. Chcete-li nainstalovat, musíte nejprve aktualizovat yum úložiště a balíčky zadáním níže uvedeného příkazu:

sudo yum -y update

Krok 2. Nainstalujte a nakonfigurujte Squid 3 na CentOS.

Nainstalujte balíček squid a závislosti pomocí níže uvedeného příkazu:

sudo yum -y install squid

Krok 3. Konfigurace Squid.

Upravit konfigurační soubor chobotnice ‘/etc/squid/squid.conf '

nano /etc/squid/squid.conf
# Recommended minimum configuration:
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd
acl ncsa_users proxy_auth REQUIRED
http_access allow ncsa_users

acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
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 1025-65535    # unregistered ports
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

http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
http_port 3128

hierarchy_stoplist cgi-bin ?
coredump_dir /var/spool/squid
cache deny all

refresh_pattern ^ftp:        1440    20%    10080
refresh_pattern ^gopher:    1440    0%    1440
refresh_pattern -i (/cgi-bin/|\?) 0    0%    0
refresh_pattern .        0    20%    4320

icp_port 3130

forwarded_for off

request_header_access Allow allow all
request_header_access Authorization allow all
request_header_access Proxy-Authorization allow all
request_header_access Proxy-Authenticate allow all
request_header_access Cache-Control allow all
request_header_access Content-Encoding allow all
request_header_access Content-Length allow all
request_header_access Content-Type allow all
request_header_access Date allow all
request_header_access Expires allow all
request_header_access Host allow all
request_header_access If-Modified-Since allow all
request_header_access Last-Modified allow all
request_header_access Location allow all
request_header_access Pragma allow all
request_header_access Accept allow all
request_header_access Accept-Charset allow all
request_header_access Accept-Encoding allow all
request_header_access Accept-Language allow all
request_header_access Content-Language allow all
request_header_access Mime-Version allow all
request_header_access Retry-After allow all
request_header_access Title allow all
request_header_access Connection allow all
request_header_access Proxy-Connection allow all
request_header_access User-Agent allow all
request_header_access Cookie allow all
request_header_access All deny all
visible_hostname idroot.us

Krok 4. Vytvořte náš ověřovací soubor, který může Squid použít k ověření autentizace uživatelů:

htpasswd -b /etc/squid/squid_passwd username password

Příklad:

htpasswd -b -c /etc/squid/squid_passwd ranty ratna

Blahopřejeme! Úspěšně jste nainstalovali squid. Děkujeme, že jste použili tento návod k instalaci squid proxy na systém CentOS. Pro další pomoc nebo užitečné informace doporučujeme navštívit oficiální web squid.

P>


Cent OS
  1. Jak nainstalovat Squid na CentOS 7

  2. Jak nainstalovat Squid Proxy na CentOS 8

  3. Jak nainstalovat a nakonfigurovat Squid proxy na vašem CentOS VPS.

  1. Jak nainstalovat a nakonfigurovat Nginx na CentOS 7

  2. Jak nainstalovat a nakonfigurovat Redis na CentOS 7

  3. Jak nainstalovat a nakonfigurovat Squid 3 na Ubuntu

  1. Jak nainstalovat a nakonfigurovat GitLab na CentOS 7

  2. Jak nainstalovat a nakonfigurovat Redmine na CentOS 7

  3. Jak nainstalovat a nakonfigurovat Squid Proxy na CentOS 7