SquidProxy 伺服器設定

來源:互聯網
上載者:User
一、安裝
  1. 源安裝:sudo apt-get install squid squid-common;
  2. 源碼安裝:

tar xvfz squid-2.5.STABLE.tar.gz;cd squid-2.5.STABLE2;

 

./configure --prefix=/var/squid 

--sysconfdir=/etc 

--enable-arp-acl 

--enable-linux-netfilter 

--enable-pthreads 

--enable-err-language="Simplify_Chinese" 

--enable-storeio=ufs,null 

--enable-default-err-language="Simplify_Chinese" 

--enable-auth="basic" 

--enable-baisc-auth-helpers="NCSA" 

--enable-underscore 

 

 

make;make install

二、基本配置(squid.conf檔案)

 

http_port 192.168.1.68:8080

 

cache_mgr ***@****.org

 

cache_dir ufs /var/spool/squid 32 16 256 

 

cache_mem 32 MB

 

cache_swap_low 90

 

cache_swap_high 95

 

visible_hostname **** Proxy

 

client_netmask 255.255.255.255

 

acl safe_ports port 80 21 443 563 70 210 1025-65535

 

 

 

acl all src 0.0.0.0/0

 

http_access allow safe_ports

 

http_access allow all

 

三、啟動Proxy 伺服器
  1. 初始化你在 squid.conf 裡配置的 cache 目錄:sudo squid -z
  2. 驗證 squid.conf 的 文法和配置:sudo squid -k parse
  3. 在前台啟動squid,並輸出啟動過程:sudo squid -N -d1
  4. 後台啟動squid伺服器:sudo squid -s
  5. 停止squidProxy 伺服器:sudo squid -k shutdown
四、更詳細的配置情況參考:

http://wiki.ubuntu.org.cn/Squid#.E6.9C.8D.E5.8A.A1.E5.99.A8.E9.85.8D.E7.BD.AE

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.