GNU/Linux >> Linux の 問題 >  >> Ubuntu

Ubuntu18.04LTSにSquidプロキシサーバーをインストールする方法

このチュートリアルでは、SquidProxyServerをUbuntu18.04LTSにインストールする方法を示します。知らなかった方のために、SquidはHTTPをサポートするWebのキャッシュプロキシです。 HTTPS、FTPなど。Squidプロキシは、帯域幅を減らし、応答時間を増やすために、さまざまな組織やインターネットプロバイダーによって使用されています。

この記事は、少なくともLinuxの基本的な知識があり、シェルの使用方法を知っていること、そして最も重要なこととして、サイトを独自のVPSでホストしていることを前提としています。インストールは非常に簡単で、ルートアカウントで実行されていますが、そうでない場合は、'sudoを追加する必要があります。 ‘ルート権限を取得するコマンドに。 Ubuntu 18.04(Bionic Beaver)サーバーにSquidプロキシサーバーを段階的にインストールする方法を説明します。

Ubuntu 18.04 LTSBionicBeaverにSquidProxyServerをインストールする

手順1.まず、次のapt-getを実行して、すべてのシステムパッケージが最新であることを確認します。 ターミナルのコマンド。

sudo apt-get update
sudo apt-get upgrade

ステップ2.Ubuntu18.04LTSにSquidProxyをインストールします。

squidプロキシパッケージはUbuntuリポジトリから入手できます。次のコマンドを実行してインストールできます:

sudo apt install squid

手順3.SquidProxyを構成します。

まず、Squidプロキシサーバーを使用する前に、基本的な構成を行う必要があります。

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 SSL_ports port 9001           # webmin
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

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

ステップ4.Squidがユーザー認証の検証に使用できる認証ファイルを作成します。

#htpasswd -b /etc/squid/squid_passwd username password

例:

htpasswd -b -c /etc/squid/squid_passwd intan ramona

構成ファイルに変更を加えた後、ファイルを保存し、squidサーバーサービスを再起動して、ターミナルプロンプトで入力した次のコマンドを使用して変更を有効にします。

>
sudo systemctl restart squid

おめでとうございます!Squidが正常にインストールされました。Ubuntu18.04LTSBionicBeaverにSquidProxyServerをインストールするためにこのチュートリアルを使用していただき、ありがとうございます。追加のヘルプや役立つ情報については、公式を確認することをお勧めします。イカのウェブサイト。


Ubuntu
  1. Debian11にSquidプロキシをインストールする方法

  2. UbuntuにSquid3をインストールして構成する方法

  3. Ubuntu20.04LTSにSquidProxyをインストールする方法

  1. Ubuntu18.04LTSにMinecraftサーバーをインストールする方法

  2. Ubuntu20.04にSquidプロキシをインストールして構成する方法

  3. Debian10にSquidプロキシをインストールする方法

  1. CentOS7にSquidプロキシサーバーをインストールする方法

  2. Ubuntu18.04にSquidプロキシサーバーをセットアップしてインストールする方法

  3. CentOS8にSquidプロキシをインストールする方法