Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to set up Squid on Debian and am getting a connection refused error:

squidclient > test
client: ERROR: Cannot connect to Connection refused

Here is my config:

visible_hostname none

cache_effective_user proxy
cache_effective_group proxy

cache_dir ufs /var/spool/squid 2048 16 256
cache_mem 512 MB

cache_access_log /var/log/squid/access.log

emulate_httpd_log on

strip_query_terms off
read_ahead_gap 128 Kb

collapsed_forwarding on
refresh_stale_hit 30 seconds

retry_on_error on

maximum_object_size_in_memory 1 MB

acl all src
acl purgehosts src

# Caching static objects in __data is important.
# Without that, apache processes sit around spooling static objects.
acl QUERY urlpath_regex /cgi-bin/ /_edit /_admin /_login /_nocache /_recache /__lib /__fudge
acl PURGE method PURGE
acl POST method POST

cache deny QUERY
cache deny POST

http_access allow PURGE purgehosts
http_access deny PURGE
http_access allow all

cache_peer parent 80 0 originserver no-query no-digest default

redirect_rewrites_host_header off

read_ahead_gap 128 Kb

shutdown_lifetime 5 seconds

Any ideas why this is happening? What have I missed?

share|improve this question

You don't have http_port in your configuration.

Edit: It looks like you want reverse proxy/http accelerator configuration. In that case do not test squid with squidclient -- try to access your web page with normal browser or use tool like wget.

See for some information.

I have no experience with this mode in squid but delete http_port other than http_port accel and try again.

share|improve this answer
I am new to Squid and was using a config file from a server at work, so I wasn't sure what options I needed. I just want the easiest Squid setup possible. – Zed Said Apr 11 '12 at 23:19
What mode of squid operation do you want: web cache, transparent web cache, or maybe reverse proxy in front of apache? – kupson Apr 11 '12 at 23:24
Ok, I changed the port to 3128 and now trying "squidclient > test" works. What other things have I done wrong? I feel like I don't know what all these options mean. – Zed Said Apr 11 '12 at 23:25
I am using apache, and I just want Squid to cache my pages for performance reasons. – Zed Said Apr 11 '12 at 23:25
Ok, that works. Looking at the HTTP headers and don't see anything about Squid... – Zed Said Apr 11 '12 at 23:49

Check this out for squid configuration:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.