How to install and configure Squid Proxy in Ubuntu, Linux Mint
A proxy is necessarily a system that sits between your computer, and the computer you want to connect to. By using a proxy server, the web traffic runs through the proxy server on its way to the target address on a different server. The request then returns through the target server via the same proxy server showing the website to you.
Here are a few things that proxy can do for you.
So that’s basically what a proxy does. As a result of all this, it makes your system and network much more secure, fast, and reduces the response time.
Squid Proxy Server
Now that we have understood the deal with proxies, let’s talk about Squid. Squid Proxy Server is a full-featured proxy that is really popular in the Linux community. That is because it has everything that could possibly be wanted from a program of its kind.
Squid supports all major protocols. First one, the HTTP (Hyper-Text Transfer Protocol), which brings you the websites that you visit. Next, FTP (File Transfer Protocol), which is responsible for all kinds of downloads and uploads. Moreover, it caches data of SSL (Secure Sockets Layer). It is the protocol that ensures a secure connection. Finally, it also caches DNS (Domain Name System) data, which fetches the IP address of the websites that you visit. This makes the response time faster even further.
This might be a bit overwhelming for beginners, but if you notice through the descriptions, it basically covers everything that you do on the internet.
Now let’s begin with the installation.
Install and configure Squid Proxy in Ubuntu, Debian, and Mint
Step 1 – Installing and starting services.
First, update your system. This is not absolutely essential, but its good practice.
sudo apt-get install squid
Now you need to start and enable the service. So, enter these codes:
sudo systemctl start squid
sudo systemctl enable squid
Now for the testing (again good practice):
sudo systemctl status squid
The output should look something like this.
This is what the status check looks like in Linux Mint.
I wish it were this easy. But it’s not. By default, Squid’s settings are not configured properly, so we will have to configure it before we can use it. So let’s see what things need to be done.
Step 2 – Changing the default port
Now open the Squid configuration file with whatever text editor you’re comfortable with. For Ubuntu, the default is Gedit, for Mint Xed. I recommend using Gedit. If you don’t have it, you can install it using the following command:
sudo apt-get install gedit
sudo gedit /etc/squid/squid.conf
Sample output
This is what the Squid configuration file looks like. Don’t read too much of it, it will boggle your mind.
Now look up, or better yet, use the find feature to find the line that has ‘http_port 3128’. You can use the find feature by pressing CTRL + F in Gedit (and most of the other graphical text editors). The default port of Squid is 3128 and it is recommended to change it otherwise your system could be a bit vulnerable to attacks.
So replace the 3128 with the port that you want. Make sure to look up that port number on the internet, otherwise you might overlap some other important protocol’s port. We are using 8888 as an example.
Sample output
Changing the HTTP Port is highly recommended.
Step 3 – Controlling Access Control Lists
So much for the easy part. Now we have to add rules to the configuration files that will determine which users are allowed to access the system and which are not.
We will first specify the network range. Find a line using the keywords ‘acl localnet’. This must be what comes up:
Sample output
‘acl localnet’ part of the configuration file.
To find out what your network range is, fire up another terminal and write:
So from your IP address, replace the last part with ‘0’, and that is your network range. For example, my IP address is 192.168.43.161. So my network range is 192.168.43.0. In the line, I have to add 192.168.43.0/24. This includes all devices in this sub-network.
Now below all the lines starting with ‘acl’, add a line that adds your network range.
I have used the username ‘mint’. You can use anything for it. Now we provide access to the username ‘mint’.
This should do it. Now save the file.
Sample output
Now the .conf file has been configured. *Phew*!
Now we restart the Squid service.
sudo systemctl restart squid
This should enable the users of the sub-network to use the proxy.
And viola! You have successfully installed the proxy. This is basically it for installing the proxy, and blacklisting websites, allowing and disallowing certain users, and other advanced functions. How did your installation go? Do let us know your feedback in the comments below.
HOWTO Прокси в Linux Mint (Debian/Ubuntu)
У меня на работе все выходы во внешний мир идут через прокси-сервр. Его настройкой занимаются админы, тем не менее, и простые юзеры вынуждены регулярно вносить коррективы в настройки таких программ как браузеры, интернет-болталки и т.д. Поэтому тема настройки прокси-сервера весьма интересна и актуальна. На сайте Nix Daily прочитал прекрасно руководство по настройке прокси-сервера в домашних условиях путем правки конфигов. речь идет о Linux Mint, а значит решение актуально для Ubuntu, да и других дистрибутивов на базе Debian. Считаю, что это готовое HOWTO, поэтому решил разместить его в своей базе знаний. Отдельное спасибо автору статьи.
Встала задача настроить систему на использование прокси-сервера для выхода в интернет, но стандартная гномовская утилита насторойки прокси сервера лишь прописала настройку в инвайромент. В итоге немного порывшись в конфигах был достигнут желаемый результат.
прописываем соответственно:
Acquire::http::Proxy «http://domain\domainuser:[email protected]:8080″;
Acquire::ftp::Proxy «http://domain\domainuser:[email protected]:8080″;
Acquire. Proxy «true»;
раскоментируем строчки и прописываем нужное:
https_proxy = http://192.168.1.150:8080/
http_proxy = http://192.168.1.150:8080/
ftp_proxy = http://192.168.1.150:8080/
прописываем нужное :
http_proxy=»http:/192.168.1.150:8080″
ftp_proxy=»http://192.168.1.150:8080″
4. Настройка mintUpdate и Synaptic
1) В самом синаптике через gui настройте использование прокси сервера
(Настройки>Параметры>Сеть)
2) В mintUpdate (Правка>Параметры>Прокси) настройте прокси следующим образом:
прокси http://192.168.1.150 порт 8080
Конечно, ремонт лифтов это более сложная задача и от квалификации ремонтников зависит жизнь и здоровье обитателей дома или офиса. Поэтому такие работы стоит заказывать только опытным сотрудникам компании, имеющей безупречную репутацию.