How to install Squid on CentOS 5.3
This is a very quick run through of a basic squid install secured to your /24 network. To get started you will need to install the squid package with Yum, example show below:
[root@littlemac ~]# yum -y install squid
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package squid.x86_64 7:2.6.STABLE21-3.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================
Package Arch Version
Repository Size
=============================================================================================================================================
Installing:
squid x86_64 7:2.6.STABLE21-3.el5 base
1.3 M
Transaction Summary
=============================================================================================================================================
Install 1 Package(s) Update 0 Package(s) Remove 0 Package(s)
Total download size: 1.3 M
Downloading Packages:
squid-2.6.STABLE21-3.el5.x86_64.rpm | 1.3 MB
00:05
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : squid [1/1]
Installed: squid.x86_64 7:2.6.STABLE21-3.el5
Complete!
Then we need to make sure the service starts at boot time with the chkconfig command:
[root@littlemac ~]# chkconfig squid on
Squid may give an error with no visible_hostname property set, so add line below to the following config file: /etc/squid/squid.conf
visible_hostname YOUR_HOSTNAME_HERE
acl our_networks src 192.168.1.0/24 192.168.2.0/24
http_access allow our_networks
Where "YOUR_HOSTNAME_HERE" is the fully qualified domain name for the server and the IP address and mask is from your network
Finally, restart the squid service , as shown below using the service command
[root@littlemac ~]# service squid start
init_cache_dir /var/spool/squid... Starting squid: . [ OK ]
Now squid is installing and running, to make a quick check, use the lsof and telnet commands as shown in the example below:
[root@littlemac ~]# lsof -i | grep squid
squid 8399 squid 6u IPv4 899537 UDP *:50904
squid 8399 squid 13u IPv4 899541 TCP *:squid (LISTEN)
squid 8399 squid 14u IPv4 899542 UDP *:icpv2
[root@littlemac ~]# telnet localhost 3128
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
^]
telnet> quit
Connection closed.
This confirms the squid caching proxy is available and working, good luck installing your squid proxy server, add a comment or question if you need to.





