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- "http://devel.pramberger.at/getrepo?release=5" >> /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 iptables-save
Lots of thanks to your tutorial for installing squid 3 on centos.
I really need this!
Great work ….. indeed ….. thanks
Thanks, didn’t know it was able to install version 3 on centos 5.6. Will try it
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