############################################## ### Installation of Squid3 on Ubuntu 14.04 LTS ############################################## ####NB: 1.Replace x.x.x.xwith the IP of the inyterface where the proxy will listen to. ### Search your cache for the squid package. root@dns-resolver:/# apt-cache search squid3 squid3 - A full featured Web Proxy cache (HTTP proxy) squid3-cgi - A full featured Web Proxy cache (HTTP proxy) - control CGI squid3-common - A full featured Web Proxy cache (HTTP proxy) - common files squid3-dbg - A full featured Web Proxy cache (HTTP proxy) - Debug symbols squidclient - A full featured Web Proxy cache (HTTP proxy) - control utilityty ### Verify that squid is not installed. root@dns-resolver:/# dpkg --list | grep squid ##Install Squid root@dns-resolver:/# apt-get install squid3 Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: squid-langpack squid3-common Suggested packages: squidclient squid3-cgi resolvconf smbclient The following NEW packages will be installed: squid-langpack squid3 squid3-common 0 upgraded, 3 newly installed, 0 to remove and 98 not upgraded. Need to get 1,234kB of archives. After this operation, 8,696kB of additional disk space will be used. Do you want to continue [Y/n]? y ### Verify that squid has been installed. root@dns-resolver:/# dpkg --list | grep squid ii squid-langpack 20100111-1 Localized error pages for Squid ii squid3 3.0.STABLE19-1ubuntu0.2 A full featured Web Proxy cache (HTTP proxy) ii squid3-common 3.0.STABLE19-1ubuntu0.2 A full featured Web Proxy cache (HTTP proxy ### Locate the inportant files and directories. root@dns-resolver:/# which squid3 /usr/sbin/squid3 root@dns-resolver:/# whereis squid3 squid3: /usr/sbin/squid3 /etc/squid3 /usr/lib/squid3 /usr/lib64/squid3 /usr/share/squid3 /usr/share/man/man8/squid3.8.gz ### Make a copy of the squid config file before beginning to edit it. root@dns-resolver:/# mv /etc/squid3/squid.conf /etc/squid3/squid.conf.orig `/etc/squid3/squid.conf' -> `/etc/squid3/squid.conf.orig' root@dns-resolver:/# ### Edit the squid.conf file to resemble what is below. root@dns-resolver:/# egrep -v "^#|^$" /etc/squid3/squid.conf.orig acl manager proto cache_object acl localhost src 127.0.0.1/32 ::1 acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 acl instructor_net src 192.168.0.0/24 # Your users network acl SSL_ports port 443 acl SSL_ports port 2083 # Access To CPanel acl SSL_ports port 993 # IMAP over SSL acl SSL_ports port 995 # POP3 over SSL acl SSL_ports port 2096 # CPanel Webmin over SSL acl SSL_ports port 8006 # Proxmox acl SSL_ports port 8443 # UniFI acl SSL_ports port 10000 # Webmin acl Safe_ports port 80 # http acl Safe_ports port 21 # ftp acl Safe_ports port 443 # https acl Safe_ports port 70 # gopher acl Safe_ports port 210 # wais acl Safe_ports port 1025-65535 # unregistered ports acl Safe_ports port 280 # http-mgmt acl Safe_ports port 488 # gss-http acl Safe_ports port 591 # filemaker acl Safe_ports port 777 # multiling http acl Safe_ports port 143 # IMAP acl Safe_ports port 110 acl Safe_ports port 2095 # CPanel Webmail acl CONNECT method CONNECT http_access allow manager localhost http_access deny manager http_access deny !Safe_ports http_access deny CONNECT !SSL_ports http_access allow localhost http_access allow instructor_net http_access deny all http_port x.x.x.x:3128 cache_mem 256 MB maximum_object_size_in_memory 2048 KB cache_dir ufs /var/spool/squid3 5120 16 256 logfile_rotate 10 cache_log /var/log/squid3/cache.log coredump_dir /var/spool/squid3 refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880 refresh_pattern . 0 20% 4320 max_filedescriptors 2048 ### Ensure that the config file has no syntax errors after editing. ###open a new config file and copy the conetnt above, then save the file root@dns-resolver:/ vi /etc/squid3/squid.conf root@dns-resolver:/# /usr/sbin/squid3 -f /etc/squid3/squid.conf -k parse 2013/08/21 10:49:28| Processing Configuration File: /etc/squid3/squid.conf (depth 0) 2013/08/21 10:49:28| Processing: acl manager proto cache_object 2013/08/21 10:49:28| Processing: acl localhost src 127.0.0.1/32 ::1 2013/08/21 10:49:28| Processing: acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 2013/08/21 10:49:28| Processing: acl instructor_net src 10.10.0.0/24 # training Network 2013/08/21 10:49:28| Processing: acl SSL_ports port 443 2013/08/21 10:49:28| Processing: acl SSL_ports port 2083 # Access To CPanel 2013/08/21 10:49:28| Processing: acl SSL_ports port 993 # IMAP over SSL 2013/08/21 10:49:28| Processing: acl SSL_ports port 995 # POP3 over SSL 2013/08/21 10:49:28| Processing: acl SSL_ports port 2096 # CPanel Webmin over SSL 2013/08/21 10:49:28| Processing: acl Safe_ports port 80 # http 2013/08/21 10:49:28| Processing: acl Safe_ports port 21 # ftp 2013/08/21 10:49:28| Processing: acl Safe_ports port 443 # https 2013/08/21 10:49:28| Processing: acl Safe_ports port 70 # gopher 2013/08/21 10:49:28| Processing: acl Safe_ports port 210 # wais 2013/08/21 10:49:28| Processing: acl Safe_ports port 1025-65535 # unregistered ports 2013/08/21 10:49:28| Processing: acl Safe_ports port 280 # http-mgmt 2013/08/21 10:49:28| Processing: acl Safe_ports port 488 # gss-http 2013/08/21 10:49:28| Processing: acl Safe_ports port 591 # filemaker 2013/08/21 10:49:28| Processing: acl Safe_ports port 777 # multiling http 2013/08/21 10:49:28| Processing: acl Safe_ports port 143 # IMAP 2013/08/21 10:49:28| Processing: acl Safe_ports port 110 2013/08/21 10:49:28| Processing: acl Safe_ports port 2095 # CPanel Webmail 2013/08/21 10:49:28| Processing: acl CONNECT method CONNECT 2013/08/21 10:49:28| Processing: http_access allow manager localhost 2013/08/21 10:49:28| Processing: http_access deny manager 2013/08/21 10:49:28| Processing: http_access deny !Safe_ports 2013/08/21 10:49:28| Processing: http_access deny CONNECT !SSL_ports 2013/08/21 10:49:28| Processing: http_access allow localhost 2013/08/21 10:49:28| Processing: http_access allow instructor_net 2013/08/21 10:49:28| Processing: http_access deny all 2013/08/21 10:49:28| Processing: http_port 192.168.0.10:3128 2013/08/21 10:49:28| Processing: cache_mem 256 MB 2013/08/21 10:49:28| Processing: maximum_object_size_in_memory 2048 KB 2013/08/21 10:49:28| Processing: cache_dir ufs /var/spool/squid3 5120 16 256 2013/08/21 10:49:28| Processing: logfile_rotate 10 2013/08/21 10:49:28| Processing: cache_log /var/log/squid3/cache.log 2013/08/21 10:49:28| Processing: coredump_dir /var/spool/squid3 2013/08/21 10:49:28| Processing: refresh_pattern ^ftp: 1440 20% 10080 2013/08/21 10:49:28| Processing: refresh_pattern ^gopher: 1440 0% 1440 2013/08/21 10:49:28| Processing: refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 2013/08/21 10:49:28| Processing: refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880 2013/08/21 10:49:28| Processing: refresh_pattern . 0 20% 4320 2013/08/21 10:49:28| Processing: max_filedescriptors 2048 root@dns-resolver:/# ### Create the cache directories. root@dns-resolver:/# /usr/sbin/squid3 -z 2013/08/21 11:24:57| Creating Swap Directories 2013/08/21 11:24:57| /var/spool/squid3 exists 2013/08/21 11:24:57| Making directories in /var/spool/squid3/00 2013/08/21 11:24:58| Making directories in /var/spool/squid3/01 2013/08/21 11:24:58| Making directories in /var/spool/squid3/02 2013/08/21 11:24:58| Making directories in /var/spool/squid3/03 2013/08/21 11:24:58| Making directories in /var/spool/squid3/04 2013/08/21 11:24:58| Making directories in /var/spool/squid3/05 2013/08/21 11:24:58| Making directories in /var/spool/squid3/06 2013/08/21 11:24:58| Making directories in /var/spool/squid3/07 2013/08/21 11:24:58| Making directories in /var/spool/squid3/08 2013/08/21 11:24:58| Making directories in /var/spool/squid3/09 2013/08/21 11:24:58| Making directories in /var/spool/squid3/0A 2013/08/21 11:24:58| Making directories in /var/spool/squid3/0B 2013/08/21 11:24:58| Making directories in /var/spool/squid3/0C 2013/08/21 11:24:58| Making directories in /var/spool/squid3/0D 2013/08/21 11:24:58| Making directories in /var/spool/squid3/0E 2013/08/21 11:24:58| Making directories in /var/spool/squid3/0F root@dns-resolver:/# ### Restart the squid service. root@dns-resolver:/# /etc/init.d/squid3 restart ### EOF!!!