免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1696 | 回复: 0
打印 上一主题 下一主题

squid远程重载配置文件 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-04-08 18:07 |只看该作者 |倒序浏览
1、首先要允许squid进行远程管理
acl cachemgr proto cache_object  #允许进行远程管理
acl mgrsvr src 192.168.0.1  #限制远程管理的机器

2、某些管理项目是必须要配置cachemgr_passwd选项才能进行操作的,比如查看当前配置,重载配置等,下面可见性为hidden的都是需要在配置文件里面配置cachemgr_passwd才能进行操作的
./squidclient -p PORT mgr:menu
****************************************************************************
命令     描述        可见性
menu                   This Cachemanager Menu                  public
shutdown               Shut Down the Squid Process             hidden
reconfigure            Reconfigure the Squid Process           hidden
offline_toggle         Toggle offline_mode setting             hidden
config                 Current Squid Configuration             hidden
asndb                  AS Number Database                      public
carp                   CARP information                        public
cbdata                 Callback Data Registry Contents         public
comm_epoll_incoming    comm_incoming() stats                   public
client_list            Cache Client List                       public
squidaio_counts        Async IO Function Counters              public
diskd                  DISKD Stats                             public
dns                    Dnsserver Statistics                    public
events                 Event Queue                             public
external_acl           External ACL stats                      public
fqdncache              FQDN Cache Stats and Contents           public
forward                Request Forwarding Statistics           public
http_headers           HTTP Header Statistics                  public
ipcache                IP Cache Stats and Contents             public
mem                    Memory Utilization                      public
pconn                  Persistent Connection Utilization Histograms    public
redirector             URL Redirector Stats                    public
refresh                Refresh Algorithm Statistics            public
info                   General Runtime Information             public
service_times          Service Times (Percentiles)             public
filedescriptors        Process Filedescriptor Allocation       public
objects                All Cache Objects                       public
vm_objects             In-Memory and In-Transit Objects        public
openfd_objects         Objects with Swapout files open         public
io                     Server-side network read() size histograms      public
counters               Traffic and Resource Counters           public
peer_select            Peer Selection Algorithms               public
digest_stats           Cache Digest and ICP blob               public
5min                   5 Minute Average of Counters            public
60min                  60 Minute Average of Counters           public
utilization            Cache Utilization                       public
histograms             Full Histogram Counts                   public
active_requests        Client-side Active Requests             public
store_digest           Store Digest                            public
storedir               Store Directory Stats                   public
store_check_cachable_stats     storeCheckCachable() Stats      public
store_io               Store IO Interface Stats                public
store_log_tags         Histogram of store.log tags             public
server_list            Peer Cache Statistics                   public
non_peers              List of Unknown sites sending ICP messages      public
**********************************************************************************
我们要进行reconfigure,而reconfigure的可见性标记为hidden,所以要配置cachemgr_passwd
cachemgr_passwd your_password reconfigure
由于我们已经对远程服务器的IP做了限制,所以我们也可以配置不用密码
cachemgr_passwd none reconfigure

3、在配置文件里面允许相应的服务器进行重载操作,其他的禁止,然后先在本机进行重载,然后就可以远程进行重载配置文件了
http_access deny !mgrsvr cachemgr

4、在远程服务器上进行重载(远程的服务器需要有squidclient可执行文件),假设squid运行的端口为80,squid服务器IP为192.168.0.2,并且我们配置为不用密码认证:
./squidclient -h 192.168.0.2 -p 80 mgr:reconfigure

5、此功能对于批量的squid配置文件修改比较有用,其他远程管理功能配置方法类似,此处不再赘述。
   运用此方法加上squid2.7或squid3.0以上版本的配置文件的include选项,可以进行squid配置文件的批量更新,简单方便又安全。


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/67390/showart_1894367.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP