Chinaunix首页 | 论坛 | 博客
  • 博客访问: 137868
  • 博文数量: 38
  • 博客积分: 2010
  • 博客等级: 大尉
  • 技术积分: 460
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-24 15:48
文章分类

全部博文(38)

文章存档

2011年(1)

2009年(11)

2008年(26)

我的朋友

分类: 系统运维

2009-04-08 18:07:33

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配置文件的批量更新,简单方便又安全。
阅读(1257) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

stucologne2009-04-09 11:01:40

灰常强大

cearo2009-04-09 09:25:01

好贴