Installing Squid 3.1 on CentOS 5.6 with SELinux and cachemgr via Yum

This is a short guide on installing the latest version of Squid via Yum. I have a guide on installing via RPM here. This was tested on CentOS 5.6 but should also work on CentOS 6.x.

1. Get the PP repository.

wget -q -O- "" >> /etc/yum.repos.d/pramberger.repo

2. Install Squid (and Apache for cachemgr).

yum install httpd squid3

3. Make changes to squid.conf.

vi /etc/squid/squid.conf

4. Build Squid cache structure.

squid -z

5. Allow incoming connections through the firewall to Squid and Apache.

iptables -I RH-Firewall-1-INPUT -p tcp --dport 3128 -i eth0 -j ACCEPT
iptables -I RH-Firewall-1-INPUT -p tcp --dport 80 -i eth0 -j ACCEPT

6. Start Squid and Apache. Users should be able to browse through Squid at this point.

service squid start
service httpd start

7. In a browser, to go http://servername/squid to generate the policies. The page will show socket error. Fix by adding SE policies.

grep "AVC.*cachemgr" /var/log/audit/audit.log | audit2allow -M cachemgr
semodule -i cachemgr.pp

8. Make settings persistent.

chkconfig squid on
chkconfig httpd on
This entry was posted in Uncategorized. Bookmark the permalink.

4 Responses to Installing Squid 3.1 on CentOS 5.6 with SELinux and cachemgr via Yum

  1. alireza says:

    Lots of thanks to your tutorial for installing squid 3 on centos.
    I really need this!

  2. ali fraz says:

    Great work ….. indeed ….. thanks

  3. Brennero says:

    Thanks, didn’t know it was able to install version 3 on centos 5.6. Will try it

  4. Brennero says:

    Thanks, I’m having some issues when I run this
    grep “AVC.*cachemgr” /var/log/audit/audit.log | audit2allow -M cachemgr
    (unknown source)::ERROR ‘syntax error’ at token ” on line 6:

    /usr/bin/checkmodule: error(s) encountered while parsing configuration
    /usr/bin/checkmodule: loading policy configuration from cachemgr.te

    Thanks giving us squid version 3 on centos 5.6

Leave a Reply

Your email address will not be published. Required fields are marked *