Squid-搭建代理伺服器
阿新 • • 發佈:2019-01-08
安裝
yum -y install squid 安裝
yum -y removed squid 解除安裝
配置
白名單驗證:
# /etc/squid/squid.conf acl client src xx.xx.xx.xx #ip白名單 acl localnet src 10.0.0.0/8 # RFC1918 possible internal network acl localnet src 172.16.0.0/12 # RFC1918 possible internal network acl localnet src 192.168.0.0/16 # RFC1918 possible internal network acl localnet src fc00::/7 # RFC 4193 local private network range acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines acl SSL_ports port 443 acl Safe_ports port 3128 acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 # https 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 http_access allow client cache_access_log /var/log/squid/access.log #訪問日誌路徑 cache_log /var/log/squid/cache.log cache_store_log /var/log/squid/store.log #visible_hostname proxy.test.com #可見主機名 cache_dir ufs /var/spool/squid 100 16 256 #ufs:快取資料的儲存格式 #/var/spool/squid 快取目錄 #100: 快取目錄佔磁碟空間大小(M) #16:快取空間一級子目錄個數 #256:快取空間二級子目錄個數
啟動
squid -z --初始化快取目錄
squid start --啟動
squid -k parse --檢查配置檔案