Centos下ProxyProxy 伺服器配置

來源:互聯網
上載者:User


安裝套件

yum -y install squid*
cp /etc/squid/squid.conf /etc/squid/squid.conf.bak
vi /etc/squid/squid.conf

#請視使用人數和硬碟狀況加大 cache 資料夾容量
cache_dir ufs /var/spool/squid 1000 16 256

#限制允許連線範圍,請依自己學校狀況修改
acl hostname src 192.168.1.0/24

http_access deny all
http_access allow localhost
http_access allow hostname

#Recommended minimum configuration:
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443 563     # https snews
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
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

#限制允許連線範圍,請依自己學校狀況修改 111cn.net

service squid restart

 
 
NAT 與 Proxy :transparent proxy 加快網路傳輸
#Fedora core 7 新的 squid 版本 Transparent Proxy 設定簡化,整合到 http_port 的 option 內了。


vi /etc/squid/squid.conf

http_port 3128 transparent
httpd_accel_host virtual
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

service squid restart

--------------------------------------------
#Fodora Core 6 以前的版本 squid Transparent Proxy 設定在 squid 設定檔內加上如下四行
vi /etc/squid/squid.conf


httpd_accel_host ha.shsps.kh.edu.tw
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.