设为首页 收藏本站
查看: 1186|回复: 0

[经验分享] 我的Squid.conf

[复制链接]

尚未签到

发表于 2018-12-26 10:23:07 | 显示全部楼层 |阅读模式
没有什么花里胡哨的编译,就是 ./configure --enable-auth=basic,ntlm
略微根据实际情况改了一下squid.conf

挺好使,没事别乱改,想清楚再改。

[root@proxy scripts]# cat /Data/software/squid/etc/squid.conf
#Kerberos authentication
#auth_param negotiate program /Data/software/squid/libexec/squid_kerb_auth -d 3 -s HTTP/proxy.800best.net@800BEST.NET
#auth_param negotiate children 15
#auth_param negotiate keep_alive on
#ntlm_auth
auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp
auth_param ntlm children 20
#auth_param ntlm use_ntlm_negotiate on
#basic_auth
auth_param basic program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-basic
auth_param basic children 10
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
cachemgr_passwd xxxxx all   #cachemgr 密码
acl all src all
acl auth proxy_auth REQUIRED
#DeniedURLs and IPs
#acl DeniedURLs dstdomain -i .qq.com .tencent.com  #简单的过滤目的网站url规则
#acl DeniedIPs dst "/Data/software/squid/etc/deniedIPs.list" #简单的过滤目的网站IP规则
acl manager proto cache_object
acl webserver src 172.18.9.146/32
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl directout src '/Data/software/squid/etc/AllowedIPs.list"  #允许列表的不需要通过用户认证直接使用proxy
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 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 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 deny DeniedURLs
#http_access deny  DeniedIPs
http_access allow manager localhost
http_access allow manager webserver
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
http_access allow directout
http_access deny !auth
http_access allow auth
http_access deny all
#icp_access allow localnet  #no need to query icp peer
icp_access deny all
http_port 172.18.9.146:3128  #如果你有多块网卡多个IP,这样设置合理点
hierarchy_stoplist cgi-bin ?
access_log /Data/software/squid/var/logs/access.log squid
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
acl shoutcast rep_header X-HTTP09-First-Line ^ICY.[0-9]
upgrade_http0.9 deny shoutcast
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
cache_mem 256 MB   # 我是2G物理内存,我想留点余地。等用户多了,我再加点,目前运行挺好
maximum_object_size 20 MB
cache_dir ufs /Data/software/squid/var/cache 8000 32 256  #4块硬盘做的软RAID5,这样配置还算保守,这个改完好记住要重新初始化cache , 命令"squid -z"
cache_mgr sysadmin@800best.com
icp_port 0     #disable icp 暂时没钱,单节点,不需要icp




运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-655979-1-1.html 上篇帖子: Squid性能分析 下篇帖子: squid启动失败的解决办法
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表