Squid Installation

squid installation and basic configuration

installation

yum install squid

Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package squid.i386 7:2.6.STABLE6-4.el5 set to be updated
--> Running transaction check
Dependencies Resolved
=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 squid                   i386       7:2.6.STABLE6-4.el5  updates           1.2 M
Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total download size: 1.2 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: squid                        ######################### [1/1]
Installed: squid.i386 7:2.6.STABLE6-4.el5
Complete!

curl http://people.redhat.com/jskala/squid/squid-2.6.STABLE23-1.el4/i386/squid-2.6.STABLE23-1.el4.i386.rpm

rpm -Uvh squid-2.6.STABLE23-1.el4.i386.rpm

basic configuration

  1. vi /etc/squid/squid.conf
acl our_networks src 192.168.1.0/24 192.168.2.0/24
http_access allow our_networks
  1. chkconfig squid on
  2. /etc/init.d/squid start

check and configurate network

if you got a the following error, you can deal it with the following command

hostname foo.example.com

the error can be check with the following file.

cat /var/log/squid/squid.out

FATAL: Could not determine fully qualified hostname.  Please set 'visible_hostname'

Squid Cache (Version 2.6.STABLE23): Terminated abnormally.
CPU Usage: 0.007 seconds = 0.003 user + 0.004 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
FATAL: Could not determine fully qualified hostname.  Please set 'visible_hostname'

Squid Cache (Version 2.6.STABLE23): Terminated abnormally.
CPU Usage: 0.007 seconds = 0.005 user + 0.002 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
  1. netstat -tulpn | grep 3128
  1. vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state --state NEW,ESTABLISHED,RELATED -m tcp -p tcp --dport 3128 -j ACCEPT
  1. /etc/init.d/iptables restart