Squid Proxy Server Interview Questions & Answers

  1. Question 1. What Is Proxy Server And Why It Is Used ?

    Answer :

    A proxy server provides Internet access to different users at same time i.e by sharing a single Internet connection. A good proxy server also provides for caching of the requests, which helps to access data from local resources rather fetching the data from web thus reducing access time and bandwidth.

  2. Question 2. What Is Squid And Its Features ?

    Answer :

    Squid is proxy server for UNIX like operating system, A Squid proxy server filters Web traffic and caches frequently accessed files. A proxy server limits Internet bandwidth usage, speeds up Web access, and lets you filter URLs. Centrally blocking advertisements and dangerous downloads is cost effective and transparent for the end user. Squid is a high per-formance implementation of a free Open-Source, full-featured proxy caching server.

  3. Linux Interview Questions

  4. Question 3. What Is The Default Configuration File Of Squid ?

    Answer :

    ‘/etc/squid/squid.conf‘ is the default configuration file of Squid.

  5. Question 4. What Is The Default Port Of Squid And How To Change It ?

    Answer :

    Default port of squid is 3128 and we can change the default port by the editing the file /etc/squid/squid.conf:

    http_port 3128

    Change this port according to your setup. After editing the file one should restart the squid service.

  6. Linux Tutorial

  7. Question 5. How To Restart The Squid Service In Centos And Rhel?

    Answer :

    Service squid restart or /etc/init.d/squid restart

  8. Exchange Server 2010 Interview Questions

  9. Question 6. What Are The Different Filters That We Can Apply Using Squid ?

    Answer :

    Some of the filters are listed below :

    • domains of client or server
    • IP subnets of client or server
    • URL path
    • Full URL including parameters
    • keywords
    • ports
    • protocols: HTTP, FTP
    • methods: GET, POST, HEAD, CONNECT
  10. Question 7. What Is Acl In Squid ?

    Answer :

    ACL stands for Access Control List , using ACL access to internet can be controlled  in terms of access during particular time interval, caching, access to particular or group of sites, etc.Squid access control has two different components i.e. ACL elements and access list. An access list infact allows or deny the access to the service.

  11. Groupware servers Interview Questions

  12. Question 8. What Are The Important Acl Elements In Squid ?

    Answer :

    A few important type of ACL elements are listed below:

    src : Source i.e. client’s IP addresses

    dst : Destination i.e. server’s IP addresses

    srcdomain : Source i.e. client’s domain name

    dstdomain : Destination i.e. server’s domain name

    time : Time of day and day of week

    url_regex : URL regular expression pattern matching

    urlpath_regex: URL-path regular expression pattern matching, leaves out the protocol and hostname

    proxy_auth : User authentication through external processes

    maxconn : Maximum number of connections limit from a single client IP address

    To apply the controls, one has to first define set of ACL and then apply rules on them. The format of an ACL statement is

    acl acl_element_name type_of_acl_element values_to_acl

  13. Question 9. Write A Rule Allowing Only Selected Machines To Have Access To The Internet ?

    Answer :

    Edit the config file /etc/squid/squid.conf :

    acl allowed_clients src

    http_access allow allowed_clients

    http_access deny !allowed_clients

    Above rule will allow only machine whose IPs are, & to have access to Internet and the rest of IP addresses (not listed ) are denied the service. After editing the file don’t forget to restart the squid service.

  14. Samba Server Interview Questions

  15. Question 10. Allow Internet Access During Particular Period Of Time ?

    Answer :

    Edit the file ‘/etc/squid/squid.conf’ and add the below rules :

    acl allowed_clients src

    acl regular_days time MTWHF 10:00-16:00

    http_access allow allowed_clients regular_days

    http_access deny allowed_clients

    This will allow the access to all the clients in network to access the net from Monday to Friday from 10:00am to 4:00 pm.

  16. Question 11. How To Enable Multiple Time Internet Access To Different Clients In Squid ?

    Answer :

    Edit the config file and add below rules :

    acl hosts1 src192.168.1.10

    acl hosts2 src

    acl hosts3 src

    acl morning time 10:00-13:00

    acl lunch time 13:30-14:30

    acl evening time 15:00-18:00

    http_access allow host1 morning

    http_access allow host1 evening

    http_access allow host2 lunch

    http_access allow host3 evening

    http_access deny all

    The above rule will allow host1 access during both morning as well as evening hours; where as host2 and host3 will be allowed access only during lunch and evening hours respectively.

  17. Mail Server Interview Questions

  18. Question 12. How To Block Websites Using Squid ?

    Answer :

    Squid can prevent the access to a particular site or to sites which contain a particular word. This can be implemented by adding the below rules in the ‘/etc/squid/squid.conf’ file.

    acl allowed_clients src

    acl banned_sites url_regex “/etc/banned.list”

    http_access deny banned_sites

    http_access allow allowed_clients

    Create a file /etc/banned.list , add all the sites that you want to block.

  19. Linux Interview Questions

  20. Question 13. How To Limit The Number Of Connections From A Client Machine In Squid ?

    Answer :

    Squid can limit number the of connections from the client machine and this is possible through the maxconn element. To use this option, client_db feature should be enabled first.

    acl mynetwork

    acl numconn maxconn 5

    http_access deny mynetwork numconn

    maxconn ACL uses less-than comparison. This ACL is matched when the number of connections is greater than the specified value. This is the main reason for which this ACL is not used with the http_access allow rule.

  21. Question 14. What Is Reverse Proxy ?

    Answer :

    A reverse proxy is a type of proxy server or ‘webserver acceleration’ (using http_port 80 accel vhost) , in this type of proxy server , the cache serves an unlimited number of clients for a limited number of or just one web server. 

  22. Question 15. What Is Transparent Proxy ?

    Answer :

    Transparent proxy is a type of proxy server where clients are not aware that their requests are processed through the proxy. The main benefit of setting transparent proxy is that  system admins do not have to setup up individual browsers to work with proxies, squid will transparently pick up the appropriate packets and cache requests.

  23. Qmail Interview Questions

  24. Question 16. How To Clear Squid Cache ?

    Answer :

    To clear the squid cache , first stop the squid service and run below command :

    # service squid stop

    # rm -rf /var/lib/squid/cache/*

    Not create swap directories :

    # squid –z

  25. Question 17. How To Check Live Running Logs Of Squid ?

    Answer :

    To see the live logs of squid use the below command :

    # tailf /var/log/squid/access.log

  26. Exchange Server 2007 Interview Questions