[ start | index | login ]
start > knowledgebase > linux > webserver > proxy servers: squid

proxy servers: squid

Created by retep. Last edited by retep, 3 years and one day ago. Viewed 6,819 times. #2
[diff] [history] [edit] [rdf]
labels
attachments

What is Squid

Squid is a 'proxy' (middle man) for web requests. You can setup your browser so it uses a proxy for its connection. Web requests (e.g. to >>http://slashdot.org) then go to the proxy (not directly to the website in the URL). The proxy handles the request (forwarding the request to slashdot in this case, then responding to the user with the reply).

Why use Squid

You may be behind a firewall (typically at an office) where only one designated server is permitted 'outside' access.

Proxies can be used to monitor what you request. So some places use it for monitoring web site access.

Some countries censor net access. You can bypass that using a proxy.

How To Get a Massive Bandwidth Bill: Open Proxies

If your proxy server is publically accessible and has no authentication restrictions then anyone can use it to access web pages. It is an open proxy server.

Typically the people that discover and use these proxies are up to no good (often relating to fraud or accessing material they shouldn't be).

For example, one of our customers setup a Proxy server and it was left open. 4 days later we discovered over 600 connected users and 195GB of data transfer usage.

How to Close an Open Proxy

One way to close an open proxy is to prevent it listening on a public IP. Then accessing the proxy via a secure SSH tunnel. This has the added benefit of securing any traffic between you and the proxy server.

To implement this option put the following line in /etc/squid/squid.conf:

http_port 127.0.0.1:3128

Restart squid:

/etc/init.d/squid restart

Then before you access your proxy server setup an SSH tunnel. e.g.:

ssh -L 3128:127.0.0.1:3128 servername

Be sure to use the localhost IP (127.0.0.1) in the tunnel part.

Then set you proxy server (e.g. in your browser) to localhost. And use the 3128 port.

Test you can no longer use your proxy servers public IP in the proxy setting of your browser.

no comments | post comment
Powered by snipsnap.org Found a mistake in a howto? Let us know via an email to p.blikibugs at rimuhosting com.