How To Install Squid Proxy Cache on Fedora 39

Install Squid Proxy Cache on Fedora 39

In this tutorial, we will show you how to install Squid Proxy Cache on Fedora 39. Squid Proxy Cache is an open-source, high-performance caching proxy server designed to optimize web content delivery, reduce bandwidth usage, and improve response times. It supports various protocols, including HTTP, HTTPS, FTP, and more. Squid is widely used by businesses, educational institutions, and internet service providers to enhance their network performance and security.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Squid Proxy Cache on a Fedora 39.

Prerequisites

Before diving into the installation process, let’s ensure that you have everything you need:

  • A server running one of the following operating systems: Fedora 39.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • Basic knowledge of Linux commands and text editors is necessary. Familiarity with the command-line interface (CLI) and understanding of network protocols can be beneficial.
  • A stable internet connection is also required for package installation.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Squid Proxy Cache on Fedora 39

Step 1. Keeping your Fedora 39 LTS system up-to-date ensures that you have the latest security patches, bug fixes, and software enhancements. An updated system reduces the risk of potential issues during the Squid installation process. To update your Fedora system, open the terminal and type the following command:

sudo dnf clean all
sudo dnf update

Step 2. Installing Squid Proxy Cache on Fedora 39.

In the terminal, type the following command to install Squid:

sudo dnf install squid

Enter your password when prompted, and press Y to confirm the installation.

After the installation is complete, check the Squid version by executing:

squid -v

You should see the Squid version number and build information displayed in the terminal.

Step 3. Configuring Squid Proxy Cache.

The primary configuration file for Squid is squid.conf, located in the /etc/squid/ directory. This file contains various settings and directives that control Squid’s behavior, such as listening ports, access control lists, and caching policies.

Open the configuration file with a text editor, such as nano:

sudo nano /etc/squid/squid.conf

By default, Squid listens on port 3128. To change the listening port, locate the http_port directive and modify the port number. For example, to set the listening port to 8080, update the line as follows:

http_port 8080

 Access Control Lists (ACLs) define rules for granting or denying access to specific resources. To create an ACL, use the acl directive followed by a unique name, the ACL type, and any required arguments. For example, to allow access from the local network with the IP range 192.168.1.0/24, add the following lines:

acl localnet src 192.168.1.0/24

 The http_access directive controls client access to the proxy based on defined ACLs. To allow access for the localnet ACL created earlier, add the following line:

http_access allow localnet

 Ensure that the http_access deny all line is present at the end of the configuration file to deny access for any undefined ACLs.

To save your changes in nano, press Ctrl + X, then Y, and finally Enter. If you are using vi, press Esc, type :wq, and press Enter.

After configuring Squid, restart the service to apply the changes:

sudo systemctl restart squid

Step 4. Test the Squid Proxy Cache.

To test the proxy, configure your web browser or another application to use the Squid proxy server’s IP address and listening port. For example, if your proxy server’s IP address is 192.168.1.10 and the listening port is 8080, enter these values in your application’s proxy settings.

To verify that Squid is functioning correctly, access a website or download a file through the proxy. If the content loads successfully, Squid is working as expected. You can also check the Squid access log at /var/log/squid/access.log to confirm that client requests are being processed.

Congratulations! You have successfully installed Squid. Thanks for using this tutorial for installing the Squid Proxy Cache on your Fedora 39 system. For additional Apache or useful information, we recommend you check the official Squid Proxy website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!
r00t is a Server System Administrator with more than 7 years of experience in server administration, operating systems, and programming. They have a strong track record of managing, securing, and optimizing Linux-based infrastructure (Ubuntu, Debian, CentOS/AlmaLinux) as well as Windows Server, across on-premises, VPS, and cloud environments. Their expertise covers configuring and maintaining web servers (Nginx, Apache) and databases (MySQL/MariaDB, PostgreSQL). It also includes virtualization and containers (Proxmox, Docker), networking, firewalls, and security hardening. They are experienced in monitoring, backup and disaster recovery, and troubleshooting to keep services available and performing well. Skilled in Bash, Python, and PHP, they automate routine tasks, build maintenance scripts, and manage deployments, which makes operations more efficient and less error-prone. They are known for being meticulous, responsive during incidents, and willing to share knowledge with teams and the wider community. Outside of work, r00t enjoys experimenting with homelabs, open source software, and emerging infrastructure technologies.

Related Posts