{"id":3069,"date":"2014-02-21T11:30:29","date_gmt":"2014-02-21T17:30:29","guid":{"rendered":"https:\/\/secure.rosehosting.com\/blog\/?p=3069"},"modified":"2022-12-08T06:32:31","modified_gmt":"2022-12-08T12:32:31","slug":"how-to-install-and-configure-squid-proxy-on-your-centos-vps","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-install-and-configure-squid-proxy-on-your-centos-vps\/","title":{"rendered":"How to install and configure Squid proxy on your CentOS VPS."},"content":{"rendered":"
There are a more reasons for using proxy, but we are going to focus on web content filtering and\/or anonymous surfing. A proxy – proxy server<\/a> actually represents another machine through which internet requests are processed, or simply an intermediary between my machine and the Internet. When using proxy server, my computer sends the requests to the proxy server, the requests are being processed and I am being delivered the content I was looking form.<\/p>\n So, let’s see few simple steps on how to install Squid, the most popular proxy server out there on your CentOS VPS<\/a>. As for the next part, we will see some configuring options.<\/p>\n <\/p>\n First, of course, make sure your system is up-to-date:<\/p>\n # yum update -y<\/span><\/p>\n Then we can get straight on to installing squid:<\/p>\n # yum -y install squid<\/span><\/p>\n And enabling it on system startup:<\/p>\n # chkconfig squid on<\/span><\/p>\n Now let’s create the default configuration:<\/p>\n # vim \/etc\/squid\/squid.conf<\/span><\/p>\n acl manager proto cache_object<\/span> # Example rule allowing access from your local networks.<\/span> acl SSL_ports port 443<\/span> # Recommended minimum Access Permission configuration:<\/span> # Deny requests to certain unsafe ports<\/span> # Deny CONNECT to other than secure SSL ports<\/span> # We strongly recommend the following be uncommented to protect innocent<\/span> #<\/span> # And finally deny all other access to this proxy<\/span> # Squid normally listens to port 3128<\/span> # We recommend you to use at least the following line.<\/span> # Uncomment and adjust the following to add a disk cache directory.<\/span> # Leave coredumps in the first cache dir<\/span> # Add any of your own refresh_pattern entries above these.<\/span> Add the following anonymous settings lines in your configuration files to use Squid undetected:<\/p>\n # vim \/etc\/squid\/squid.conf<\/span><\/p>\n via off<\/span> request_header_access Allow allow all <\/span> And that’s it as far as the installation and the initial configuration goes. In our next post we’ll take a look at more detailed (and also browser) configuration. Thanks for reading!<\/p>\n Of course you don\u2019t have to do any of this if you use one of our\u00a0Linux VPS Hosting<\/a> services, in which case you can simply ask our expert Linux admins to install Squid proxy for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n PS.<\/strong><\/span>\u00a0If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" There are a more reasons for using proxy, but we are going to focus on web content filtering and\/or anonymous … <\/p>\n
\nacl localhost src 127.0.0.1\/32 ::1<\/span>
\nacl to_localhost dst 127.0.0.0\/8 0.0.0.0\/32 ::1<\/span><\/p>\n
\n# Adapt to list your (internal) IP networks from where browsing<\/span>
\n# should be allowed<\/span>
\nacl localnet src 10.0.0.0\/8\u00a0\u00a0\u00a0\u00a0 # RFC1918 possible internal network<\/span>
\nacl localnet src 172.16.0.0\/12\u00a0 # RFC1918 possible internal network<\/span>
\nacl localnet src 192.168.0.0\/16 # RFC1918 possible internal network<\/span>
\nacl localnet src fc00::\/7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # RFC 4193 local private network range<\/span>
\nacl localnet src fe80::\/10\u00a0\u00a0\u00a0\u00a0\u00a0 # RFC 4291 link-local (directly plugged) machines<\/span><\/p>\n
\nacl Safe_ports port 80\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0<\/span>
\nacl Safe_ports port 21\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0<\/span>
\nacl Safe_ports port 443\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0<\/span>
\nacl Safe_ports port 70\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0<\/span>
\nacl Safe_ports port 210\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0<\/span>
\nacl Safe_ports port 1025-65535 \u00a0<\/span>
\nacl Safe_ports port 280\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0<\/span>
\nacl Safe_ports port 488\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0<\/span>
\nacl Safe_ports port 591\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0<\/span>
\nacl Safe_ports port 777\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0<\/span>
\nacl CONNECT method CONNECT<\/span><\/p>\n
\n# Only allow cachemgr access from localhost<\/span>
\nhttp_access allow manager localhost<\/span>
\nhttp_access deny manager<\/span><\/p>\n
\nhttp_access deny !Safe_ports<\/span><\/p>\n
\nhttp_access deny CONNECT !SSL_ports<\/span><\/p>\n
\n# web applications running on the proxy server who think the only<\/span>
\n# one who can access services on “localhost” is a local user<\/span>
\n#http_access deny to_localhost<\/span><\/p>\n
\n# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS<\/span>
\n#<\/span>
\n# Example rule allowing access from your local networks.<\/span>
\n# Adapt localnet in the ACL section to list your (internal) IP networks<\/span>
\n# from where browsing should be allowed<\/span>
\nhttp_access allow localnet<\/span>
\nhttp_access allow localhost<\/span><\/p>\n
\nhttp_access deny all<\/span><\/p>\n
\nhttp_port 3128<\/span><\/p>\n
\nhierarchy_stoplist cgi-bin ?<\/span><\/p>\n
\n#cache_dir ufs \/var\/spool\/squid 100 16 256<\/span><\/p>\n
\ncoredump_dir \/var\/spool\/squid<\/span><\/p>\n
\nrefresh_pattern ^ftp:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1440\u00a0\u00a0\u00a0 20%\u00a0\u00a0\u00a0\u00a0 10080<\/span>
\nrefresh_pattern ^gopher:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1440\u00a0\u00a0\u00a0 0%\u00a0\u00a0\u00a0\u00a0\u00a0 1440<\/span>
\nrefresh_pattern -i (\/cgi-bin\/|\\?) 0\u00a0\u00a0\u00a0\u00a0 0%\u00a0\u00a0\u00a0\u00a0\u00a0 0<\/span>
\nrefresh_pattern .\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 20%\u00a0\u00a0\u00a0\u00a0 4320<\/span><\/p>\n
\nforwarded_for off<\/span><\/p>\n
\nrequest_header_access Authorization allow all <\/span>
\nrequest_header_access WWW-Authenticate allow all <\/span>
\nrequest_header_access Proxy-Authorization allow all <\/span>
\nrequest_header_access Proxy-Authenticate allow all <\/span>
\nrequest_header_access Cache-Control allow all <\/span>
\nrequest_header_access Content-Encoding allow all <\/span>
\nrequest_header_access Content-Length allow all <\/span>
\nrequest_header_access Content-Type allow all <\/span>
\nrequest_header_access Date allow all <\/span>
\nrequest_header_access Expires allow all <\/span>
\nrequest_header_access Host allow all <\/span>
\nrequest_header_access If-Modified-Since allow all <\/span>
\nrequest_header_access Last-Modified allow all <\/span>
\nrequest_header_access Location allow all <\/span>
\nrequest_header_access Pragma allow all <\/span>
\nrequest_header_access Accept allow all <\/span>
\nrequest_header_access Accept-Charset allow all <\/span>
\nrequest_header_access Accept-Encoding allow all <\/span>
\nrequest_header_access Accept-Language allow all <\/span>
\nrequest_header_access Content-Language allow all <\/span>
\nrequest_header_access Mime-Version allow all <\/span>
\nrequest_header_access Retry-After allow all <\/span>
\nrequest_header_access Title allow all <\/span>
\nrequest_header_access Connection allow all <\/span>
\nrequest_header_access Proxy-Connection allow all <\/span>
\nrequest_header_access User-Agent allow all <\/span>
\nrequest_header_access Cookie allow all <\/span>
\nrequest_header_access All deny all<\/span><\/p>\n