How To Install Squid On Centos 7
Squid Proxy Server is a popular proxy server that sits between client browser and your website and allows yous to hands cache frequently requested spider web pages on your site. It improves website speed & performance. In this commodity, nosotros will look at how to install & configure Squid Proxy Server in CentOS 7. You tin can also use these steps on Redhat & Fedora Linux systems.
How to Install & Configure Squid Proxy Server
Here are the steps to install & configure squid proxy server.
i. Update Software Repositories
Open up terminal and run the following command to update CentOS software repositories.
$ sudo yum -y update Also read : Extract .bz2 file in Linux
2. Install Squid Package
Run the post-obit command to install Squid Package.
$ yum -y install squid If you run across whatever prompts during installation, enter Y.
One time Squid server is installed, start it with the following control.
$ sudo systemctl start squid
If yous want to automatically start squid at the time of boot, run the following command.
$ sudo systemctl enable squid
If you desire to view the status of your squid server, run the following command
$ sudo systemctl status squid
Likewise read : How to View Hidden Files in Linux
3. Configure Squid Proxy Server
Side by side, nosotros volition configure Squid Proxy Server. Open its configuration file found at /etc/squid/squid.conf using a text editor.
$ sudo half dozen /etc/squid/squid.conf
Look for the following line
http_port 3128
If you desire to alter the port to some other number, replace 3128 with a port number of your choice. Too, set the proxy style to transparent if you don't desire the Squid proxy server to change the requests & responses of your website.
http_port 3128 transparent
Delight make sure that you have opened port 3128 on your firewall.
By default, Squid Proxy server is configured to block all incoming HTTP traffic using the following line.
http_access deny all Modify information technology to
http_access permit all Restart Squid proxy to use changes.
$ sudo systemctl restart squid Also read : How to Set "Undefined Variable" in PHP
iv. Configure Squid Client
On your client car, open up your web browser (due east.g. Firefox) and get to
Carte > Options > Network Settings > Settings
Select Manual proxy configuration in the displayed window. In the HTTP Proxy textbox, enter the IP address of machine that hosts your proxy server.
Also read : How to Merge Two Dictionaries in Python
At this indicate, y'all are good to use Squid Proxy. Nosotros have provided some optional configurations, in case you need them.
Create Access Control List (ACL)
If y'all are unable to access your proxy server from exterior its network, then create an admission command list. Open Squid Proxy configuration file
$ sudo vi /etc/squid/squid.conf
Add the following line to allow access from 54.43.32.21
acl localnet src 54.43.32.21 You tin also allow admission from an IP range using CIDR notations
acl localnet src 54.43.32.0/24 Also read : How to Run PHP Scripts Automatically
Set up basic hallmark
Squid also supports basic hallmark. Run the post-obit control to install httpd-tools
yum -y install httpd-tools
Once the installation is consummate, create new file
$ sudo touch /etc/squid/passwd && chown squid /etc/squid/passwd Use the following control to create countersign, replace user_name with your username
htpasswd /etc/squid/passwd user_name Enter the password for this new user, when prompted.
Open Squid Proxy configuration file
$ sudo six /etc/squid/squid.conf
Add together the following lines.
auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwd auth_param basic children 5 auth_param bones realm Squid Basic Authentication auth_param basic credentialsttl 2 hours acl auth_users proxy_auth REQUIRED http_access allow auth_users
Restart Squid Proxy Server to apply changes.
$ sudo systemctl restart squid Also read : How to Disable Directory Browsing in Apache Server
How to Cake Websites using Squid Proxy
Squid proxy too allows you to block specific websites. Create a new file to list blocked websites
$ sudo 6 /etc/squid/blocked.acl
Add the websites to exist blocked, one per line. Each starting with a dot.
.twitter.com .facebook.com .pinterest.com
Open Squid configuration file
$ sudo half-dozen /etc/squid/squid.conf
Add the following lines to a higher place your ACL list
acl blocked_websites dstdomain "/etc/squid/blocked.acl"http_access deny blocked_websites
Salvage and shut the file. Restart Squid Proxy to apply changes.
$ sudo systemctl restart squid
That's it. Now your listing of specified websites volition be blocked.
In this article, we have looked at how to install and configure Squid Proxy server. We take also looked diverse boosted configuration options.
Also read : How to Prevent Direct File Download In Apache
Related posts:
Source: https://fedingo.com/how-to-install-configure-squid-proxy-server-in-centos-7/
Posted by: sevignymues1965.blogspot.com

0 Response to "How To Install Squid On Centos 7"
Post a Comment