Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

Installing and Configuring Squid

In this learning activity, you will need to install and configure squid so that it only permits web access to *linuxacademy.com*.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 1h 30m
Published
Clock icon Nov 14, 2018

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Install Squid

    You will need to install Squid on Server1 (10.0.1.10):

    yum install squid

  2. Challenge

    Enable and Start Squid

    You will need to enable Squid:

    systemctl enable squid

    And start it:

    systemctl start squid

  3. Challenge

    Permit Squid Client Access through the Firewall

    You will need to permit clients to connect to the Squid service through the firewall:

    firewall-cmd --permanent --add-service=squid

    And reload the firewall configuration to pick up the change:

    firewall-cmd --reload

  4. Challenge

    Configure Squid

    You'll want to create an ACL that only allows clients to access linuxacademy.com. These go in /etc/squid/squid.conf after the line that says # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS.

    ...
    # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
    
    acl whitelist dstdomain .linuxacademy.com
    http_access allow whitelist
    ...
    

    You'll also need to comment out or remove the line:

    #http_access allow localnet

    And restart Squid:

    systemctl restart squid

  5. Challenge

    Test from a Client

    You'll need to export the http_proxy value to use Server1:

    export http_proxy="http://10.0.1.10:3128"

    And try curling the header of linuxacademy.com:

    curl -I linuxacademy.com

    This should work. Verify this is the only site that works by curling a different address:

    curl -I apache.org

    This should come back as forbidden.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans