• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to Install and configure Squid proxy server on CentOS 8.1

  • 00:58 Yum install squid -y
  • 02:32 systemctl status squid
  • 02:49 vim /etc/squid/squid.conf
  • 09:10 firewall-cmd --permanent --add-port=3128/tcp
  • 10:00 systemctl restart squid
  • 12:35 tail -f /var/log/squid/access.log
{{postValue.id}}

How to Install and configure Squid proxy server on CentOS 8.1

Introduction:

Squid is a caching and forwarding HTTP web proxy. It is used for speeding up a web server by caching repeated requests, caching web, DNS and other computer network lookups. This is made for a shared network resources and filtering traffic. This tutorial covers the installation process of squid proxy on CentOS 8.1

Installation process:

To Install proxy server, use below command

[root@linuxhelp ~]# yum install squid
Last metadata expiration check: 2:19:14 ago on Friday 23 October 2020 12:53:06 PM IST.
Dependencies resolved.
Installing:
 squid                 x86_64       7:4.4-8.module_el8.2.0+319+d18e041f.1       AppStream       3.5 M
Installing dependencies:
 libecap               x86_64       1.0.1-2.module_el8.2.0+319+d18e041f         AppStream        29 k
 perl-Digest-SHA       x86_64       1:6.02-1.el8                                AppStream        66 k
Is this ok [y/N]: y
Downloading Packages:
(1/3): libecap-1.0.1-2.module_el8.2.0+319+d18e041f.x86_64.rpm         120 kB/s |  29 kB     00:00    
 (3/3): squid-4.4-8.module_el8.2.0+319+d18e041f.1.x86_64.rpm           779 kB/s | 3.5 MB     00:04    
------------------------------------------------------------------------------------------------------
Total                                                                 731 kB/s | 3.6 MB     00:05     
:                                                                              1/1
  Installing       : perl-Digest-SHA-1:6.02-1.el8.x86_64   
   ……
   …….
   ……..                                       
  libecap-1.0.1-2.module_el8.2.0+319+d18e041f.x86_64                                                  
  perl-Digest-SHA-1:6.02-1.el8.x86_64                                                                 
Complete!

To start squid proxy service type

[root@linuxhelp ~]# systemctl start squid

Now enable the squid service

[root@linuxhelp ~]# systemctl enable squid
Created symlink /etc/systemd/system/multi-user.target.wants/squid.service → /usr/lib/systemd/system/squid.service.

Check status for squid proxy server using below command

[root@linuxhelp ~]# systemctl status squid
● squid.service - Squid caching proxy
   Loaded: loaded (/usr/lib/systemd/system/squid.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2020-10-23 15:14:26 IST; 21s ago
 

Now open squid configuration file.

[root@linuxhelp ~]# vim /etc/squid/squid.conf

Now in squid.conf file create an “acl”

acl localnet src 192.168.7.0/24
http_access allow localnet

Now to put some rules create an acl

acl badsites url_regex “/etc/squid/badsites”
http_access deny badsites

to create “badsite” file to put some links which to be block

[root@linuxhelp ~]# vim /etc/squid/badsites

Give the links which needs to be blocked in file.

.facebook.com
.flipkart.com
.amazon.in

To add squid port number in firewall to allow it pass through it

[root@linuxhelp ~]# firewall-cmd --permanent --add-port=3128/tcp
Warning: ALREADY_ENABLED: 3128:tcp
success

Reload the firewall

[root@linuxhelp ~]# firewall-cmd --reload
success

restart squid to reflect changes what have been made

[root@linuxhelp ~]# systemctl restart squid

move to client pc to configure squid proxy server Ip address snap1 This is “access-denied “page badsites file blocked by squid proxy server. snap2 Google is allowed hence this page is loading snap3

With this, the method of installation squid proxy server on CentOS8.1 comes to an end.

Tags:
sebastian
Author: 

Comments ( 1 )

abhishekkumar
I follow your tutorial, all commands go to successful But my internet is not working why
Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What is the default port of the squid ?

A

The default port on which squid runs is 3128.

Q

From where squid configuration file can be accessed?

A

We can access it by Vim using vim /etc/squid/squid.conf.

Q

Squid stores data in which file format?

A

Squid stores data in ufs (Unix File System) format also called the Berkeley Fast File System.

Q

What is the location of cache storage in the Squid?

A

The squid stores cache in /var/spool/squid.

Q

What this command "squid -z" will do ?

A

this command will create cache directories.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Luke ?
workbench for debian

I am using workbench in CentOS whereas now I need to use Debian Operating system so could you please help to install and use in Debian?

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.