Sunday, December 18, 2011

squid in Ubuntu 11.04

1, It should be easy
I installed squid from "Ubuntu software center".

then modified the "squid.conf" under /etc/squid/conf
follow steps from Ubuntu help:
https://help.ubuntu.com/8.04/serverguide/C/squid.html

then I tried to start squid by "/etc/init.d/squid restart"
it always response as "Rather than invoking init scripts through /etc/init.d, use the service(8) utility, e.g. service squid restart ..."

OK. I run command
service squid restart

OMG, "Unknown instance", faint....
what the hell.


2, calm down
Google this issue. It seems as a common problem.


3, Okay, let's fix it....
Go to squid official website , download the latest stable code, current is 3.1.18
http://www.squid-cache.org/Versions/v3/3.1/

follow instructions in INSTALL.
config it, build it , and install it by root.

edit the "squid.conf" , add "http_access allow all" at the beginning of the http_access control block (before other http_access). It makes the proxy can access by others.

next , initialize the cache, and start the proxy with root.
sudo /usr/local/squid/sbin/squid


4,everything should be fine. 
you can find the proxy listen on the port (default is 3128) by run command "netstat |grep 3128"
Also, don't forget to verify it by another computer.



No comments:

Post a Comment