15.2. Installing and Running Squid

In Red Hat Enterprise Linux, the squid package provides the Squid Caching Proxy. Run the rpm -q squid command to see if the squid package is installed. If not, enter the following command as the root user to install it:
~]# yum install squid
Run the systemctl start squid command as the root user to start Squid:
~]# systemctl start squid
Squid will start listening on port 3128 (default) on all network interfaces on the machine.
Run the systemctl status squid command to confirm whether Squid is running. An example output is attached.
~]# systemctl status squid
● squid.service - Squid caching proxy
   Loaded: loaded (/usr/lib/systemd/system/squid.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2016-04-06 13:15:05 CEST; 2min 17s ago
[output truncated]
Run the ps -eZ | grep squid command to view the Squid processes:
~]# ps -eZ | grep squid
unconfined_u:system_r:squid_t:s0 2522 ?        00:00:00 squid
unconfined_u:system_r:squid_t:s0 2524 ?        00:00:00 squid
unconfined_u:system_r:squid_t:s0 2526 ?        00:00:00 ncsa_auth
unconfined_u:system_r:squid_t:s0 2527 ?        00:00:00 ncsa_auth
unconfined_u:system_r:squid_t:s0 2528 ?        00:00:00 ncsa_auth
unconfined_u:system_r:squid_t:s0 2529 ?        00:00:00 ncsa_auth
unconfined_u:system_r:squid_t:s0 2530 ?        00:00:00 ncsa_auth
unconfined_u:system_r:squid_t:s0 2531 ?        00:00:00 unlinkd
If you are interested in detailed performance statistics about Squid from a command line environment, use the squidclient tool that can access the Squid service and retrieve its statistics. For example, to get some general performance statistic, enter the following command on the Squid server:
~]# squidclient -p squid-port mgr:info
To stop Squid, issue this command:
~]# systemctl stop squid

Squid Log Files

The Squid proxy server log files are stored in the /var/log/squid/ directory. The log file that stores information about proxied requests is the /var/log/squid/access.log file.