Configuring squid cache manager

From Notes_Wiki
Revision as of 11:43, 2 December 2012 by Saurabh (talk | contribs)

<yambe:breadcrumb>Squid proxy server configuration|Squid</yambe:breadcrumb>

Configuring squid cache manager

Configure web interface of squid cache manager

Squid comes with cache manager CGI application which can be used to see cache statistics using web browser.

We can use squid cache manager web interface using following steps:

  1. Make following changes in 'squid.conf':
    acl manager proto cache_object
    http_access allow manager localhost
    http_access allow manager saurabhpc
    http_access deny manager
    http_access allow PURGE localhost
    http_access allow PURGE saurabhpc
    http_access deny PURGE
    cachemgr_passwd <secret> all
  2. In file 'cachemgr.conf' put line same as 'http_port' in 'squid.conf'. For example
    192.168.36.230:8080
    Here squid is listening on IP 192.168.36.230:8080 and we want to use cachemgr.cgi to manage its cache
  3. Configure apache to run on other port than 80. For some reason cachemgr.cgi expects port no in request. If port is 80 then browsers do not send port number with URL and cachemgr cant handle it properly. So configure apache to listen on other port like 3128.
  4. Lastly edit '/etc/httpd/conf.d/squid.conf' and allow your IP to access '/Squid/cgi-bin/cachemgr.cgi '
  5. One you open the cache manager using browser. Then put same cache host and cache port as configured in 'http_port' in 'squid.conf'. Also use username as 'root' and password as '<secret>' configured in 'squid.conf' to login.
  6. Do not forget to put firewall rules to block others from accessing port on which apache is listening on dedicated proxy servers.