It’s not only to System Administrator and Network Administrator, who listens the phrase Proxy Server every now and then but we too. Proxy Server is now a corporate culture and is the need of the hour. Proxy server now a days is implemented from small schools, cafeteria to large MNCs. Squid (also known as proxy) is such an application which acts as proxy server and one of the most widely used tool of its kind.
This Interview article aims at strengthening your base from Interview point on the ground of proxy server and squid.
1. What do you mean by Proxy Server? What is the use of Proxy Server in Computer Networks?
Proxy servers are the backbone of WWW (World Wide Web). Most of the proxies of today are web proxies. A proxy server handles the complexity in between the Communication of client and Server. Moreover it provides anonymity on the web which simply means your identity and digital footprints are safe. Proxies can be configured to allow which sites client can see and which sites are blocked.
2. What is Squid?
3. What is the default port of squid and how to change its operating port?
Open ‘/etc/squid/squid.conf’ file and with your choice of editor.
# nano /etc/squid/squid.conf
Now change this port to any other unused port. Save the editor and exit.
http_port 3128
Restart the squid service as shown below.
# service squid restart
4. You works for a company the management of which ask you to block certain domains through squid proxy server. What are you going to do?
a. Create a file say ‘blacklist’ under directory ‘/etc/squid’.
# touch /etc/squid/blacklist
b. Open the file ‘/etc/squid/blacklist’ with nano editor.
# nano /etc/squid/blacklist
c. Add all the domains to the file blacklist with one domain per line.
.facebook.com .twitter.com .gmail.com .yahoo.com ...
d. Save the file and exit. Now open the Squid configuration file from location ‘/etc/squid/squid.conf’.
# nano /etc/squid/squid.conf
e. Add the lines below to the Squid configuration file.
acl BLACKLIST dstdom_regex -i “/etc/squid/blacklist” http_access deny blacklist
f. Save the configuration file and exit. Restart Squid service to make the changes effective.
# service squid restart
5. What is Media Range Limitation and partial download in Squid?
The squid’s feature of partial download is implemented well within windows update where downloads are requested in the form of small packets which can be paused. Because of this feature a update downloading windows machine can be restarted without any fear of data loss. Squid makes the Media Range Limitation and Partial Download possible only after storing a copy of whole data in it. Moreover the partial download gets deleted and not cached when user points to another page until Squid is specially configured somehow.
6. What is reverse proxy in squid?
Technically it is feasible to use single squid server to act both as normal proxy server and reverse proxy server at the same point of time.
7. Since Squid can be used as web-cache Daemon, is it possible to Clear its Cache? How?
a. First stop Squid proxy server and delete cache from the location ‘/var/lib/squid/cache’ directory.
# service squid stop # rm -rf /var/lib/squid/cache/*<
b. Create Swap directories.
# squid -z
8. A client approaches you, who is working. They want the web access time be restricted for their children. How will you achieve this scenario?
Say the web access allow time be 4’o clock to 7’o clock in the evening for three hours, sharply form Monday to Friday.
a. To restrict web access between 4 to 7 from Monday to Friday, open the Squid configuration file.
# nano /etc/squid/squid.conf
b. Add the following lines and save the file and exit.
acl ALLOW_TIME time M T W H F 16:00-19:00 shttp_access allow ALLOW_TIME
c. Restart the Squid Service.
# service squid restart
9. Squid stores data in which file format?
10. Where do cache gets stored by squid?
That’s all for now. I’ll be here again with another interesting article soon. Till then stay tuned and connected to Tecmint. Don’t forget to provide us with your valuable feedback the comment section below.
Thanks for your reply.
I don’t see any way to send you a private message, would you be interested in setting up what I asked about?
@Shawn,
Please send me at [email protected] or you can also seek for help at linuxsay.com..
Thank you the response.
A couple more questions if you don’t mind:
Can I set up a SOCKS proxy on the server, using an extra IP provided by the hosting provider. And, if so, can the IP used for the SOCKS proxy also be used as a normal extra IP address, if that makes sense. I’m hoping to be able to use the IP to log in to a different website that my site logs into on behalf of users of my site, and also use it as for the SOCKS proxy. The idea is to let users of my site configure their browser to use the SOCKS proxy so they can then go to the other site and log into it manually, so that the other site sees the SOCKS IP as safe for that user’s log in attempts in the future, by my site.
Again, thanks for your reply to my last post to any reply to this one.
@Shawn,
Yes, as I said in my last comment you can setup SOCKS proxy with extra IP address and also you can use that extra IP for other things too..
Hello
Maybe a stupid question, but can Squid be set up on a vps server that already has websites installed on it? I need a socks proxy for use with the website already installed on the server?
A reply would be greatly appreciated.
Thanks
@Shawn,
Yes you can setup Proxy on running Apache/Nginx web server with websites, there isn’t any problem using..
Very nice article, it was really helpful for me! Thank you!
I want a HTML based page on squid proxy,so that they can monitor each user’s daily internet use with accessed sites & total download of the day of each user.Any open source is available?
Yes, there is an open source tool called sarg, for more information about installation and configuration of sarg, follow below link.
https://www.tecmint.com/sarg-squid-analysis-report-generator-and-internet-bandwidth-monitoring-tool/
TnX
Hi,
Linux is case sensitive and in Q4 acl name should be same. I think there is some type mistake..
Rest of the article is good and helpful for interview…
Keep going…
great article & i need to know how to configure squid with authentication.
Thanks Chamara.
We will be coming with an article on squid setup and configuration soon.
Till then stay connected.
Hi,
I am using Squid 2.7 with Ubuntu 10.04, i am facing a problem that squid is not supporting MSOutlook.
Please let me know how can i connect.
Regards, Pradeep
configure the outlook settings in which you have configured the same for proxy settings in the machine.