Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Caching Server»How to install and configure Squid Proxy on Debian 8

    How to install and configure Squid Proxy on Debian 8

    RahulBy RahulOctober 21, 20183 Mins ReadUpdated:December 21, 2018

    Squid is a popular Proxy server for Unix like operating systems. It also used for the web filtering. Its widely used for increasing web server speed by caching repeated data. This tutorial helps you to install Squid proxy server on your Debian 8 Jessie system. Also provide basic configuration details of Proxy server to allow traffic, restrict specific websites with keyword or domain names.

    Step 1 – Install Squid on Debian 8

    Login to your Debian 8 system using root or sudo privileges user. Then run the following commands on the console to install Squid on Debian 8 system from the default package repository.

    sudo apt update
    sudo apt install squid
    

    Step 2 – Configure Squid Port

    Squid default runs on port 3128. It is your choice to keep running squid on default port or change it to some different port. To change port edit squid configuration file and changehttp_port value.

    /etc/squid/squid.conf

    http_port 3128
    

    After making changing let’s restart Squid service to reload the configuration changes

    sudo service squid restart
    

    Step 3 – Allow All Traffic

    Assuming you need a proxy server open to all, Then you need to allow all traffic on your proxy server. Edit the Squid configuration file and Comment the http_access deny all line. Then add the http_access allow all entry this file.

     http_access allow all
     #http_access deny all
    

    Squid allow all

    Step 4 – Block Specific Website with Squid

    Here you want to block some specific websites through the proxy server. Then add the following rules to block specific website just before the allow all rule. Below example will block yahoo.com and www.rediff.com.

    acl blocksite1 dstdomain yahoo.com
    acl blocksite2 dstdomain www.rediff.com
    http_access deny blocksite1
    http_access deny blocksite2
    

    If you have a large number of domain names, then create a file /etc/squid/blockwebsites.lst and put domain names one per line and add below rule in the squid configuration file.

    acl blocksitelist dstdomain "/etc/squid/blockwebsites.lst"
    http_access deny blocksitelist
    

    blockwebsites.lst file content example:

    cat /etc/squid/blockwebsites.lst
    
    yahoo.com
    www.rediff.com
    

    Step 5 – Block Specific Keyword with Squid

    You can also block websites for specific keywords. Add the following rules just before the allow all rule. Below is the example of blocking all pages having keyword yahoo or Gmail.

    acl blockkeyword1 url_regex yahoo
    acl blockkeyword2 url_regex gmail
    http_access deny blockkeyword1
    http_access deny blockkeyword2
    

    If you have a large number of keywords to block then create a file /etc/squid/blockkeywords.lst and put keywords one per line and add below rule in the squid configuration file.

    acl blockkeywordlist url_regex "/etc/squid/blockkeywords.lst"
    http_access deny blockkeywordlist
    

    blockkeywords.lst file content example:

    cat /etc/squid/blockkeywords.lst 
    
    yahoo
    gmail
    facebook
    

    Congratulation’s you have successfully install and configured Squid proxy server. Read next article to Configure Squid for Mac Address Based Filtering.

    debian 8 squid
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install Gulp.js on Ubuntu 18.04 & 16.04 LTS
    Next Article How To Install Gulp.js on Debian 10/9/8

    Related Posts

    How To Install Memcached on Ubuntu 20.04

    3 Mins Read

    How To Install Redis on Debian 10

    Updated:July 7, 20203 Mins Read

    How to Install Redis on Ubuntu 20.04

    3 Mins Read

    How To Install Memcached on Fedora 35/34/33

    Updated:April 18, 20223 Mins Read

    How to Setup Squid Proxy Server on Ubuntu 18.04 & 16.04

    Updated:November 29, 20183 Mins Read

    How To Delete All Data in Redis

    Updated:February 27, 20201 Min Read

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.