Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

squidclient http://www.apple.com/ > test
client: ERROR: Cannot connect to 127.0.0.1:3128: 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 0.0.0.0/0.0.0.0
acl purgehosts src 127.0.0.1/255.255.255.255

# 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

http_port 127.0.0.1:80
http_port 50.56.206.139:80
cache_peer 127.0.0.1 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

2 Answers 2

You don't have http_port 127.0.0.1:3128 in your configuration.

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

See http://wiki.squid-cache.org/SquidFaq/ReverseProxy for some information.

I have no experience with this mode in squid but delete http_port other than http_port 50.56.206.139:80 accel defaultsite=your.main.website 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 apple.com > 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

Your Answer

 
discard

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.