Getting Squid (Internet Proxy) Working

Problem

After configuring Safari and Firefox to use my local network's squid proxy, I got the following error whenever I tried to browse to a page:

ERROR

The requested URL could not be retrieved
While trying to retrieve the URL:  http://www.google.com/

The following error was encountered:
 * Access Denied. 
   Access control configuration prevents your request from 
   being allowed at this time. Please contact your service 
   provider if you feel this is incorrect.

Solution

The squid.conf file on my server wasn't configured correctly. Actually, I had simply neglected to ever bother configuring it! By default, Squid rejects all requests.

I edited the Squid configuration file:

sudo vi /etc/squid/squid.conf

Changing from this:

# Example rule allowing access from your local networks. Adapt
# to list your (internal) IP networks from where browsing should
# be allowed
#acl our_networks src 192.168.1.0/24 192.168.2.0/24
#http_access allow our_networks

To this:

# Example rule allowing access from your local networks. Adapt
# to list your (internal) IP networks from where browsing should
# be allowed
acl our_networks src 192.168.1.0/24
http_access allow our_networks

Then restarted Squid:

sudo /etc/init.d/squid restart

About Jeff Fitzsimons

Jeff Fitzsimons is a software engineer in the California Bay Area. Technical specialties include C++, Win32, and multithreading. Personal interests include rock climbing, cycling, motorcycles, and photography.
This entry was posted in Technology and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *