Squid is used as a proxy cache server.It makes web responses faster,minimize bandwidth.
Couple of days ago,I had set up a local squid proxy server for our dev environment.The first step was to configure a standalone squid in my Mac OS X lion.
In this post I will write down the minimal steps and configuration for local Squid proxy service.
The steps are simple:
1.Update your network settings
2.Downlading Squid source
3.Compile and make it
4.Configure and start it!
Go to “System Preferences”=>”NetWork”=>”Advanced”(lower right corner)=>”Proxies”=> Select Web Proxy.
And set the “Web proxy Server” value as “localhost” and port is 3128(default port of squid)
Download the source form here http://www.squid-cache.org/Versions/
Extract it using
tar zxvf packagename.tar.gz
then cd package name” then configure it using
then intall it using
sudo make install
“for configuring the squid go to the
and open the squid.conf using
sudo mate squid.conf
I used Textmate as an editor,you can use your favorite text editor.
then you have to add the following configurations
# disk and memory cache settings cache_dir ufs /usr/local/squid/var/cache 500 16 256 maximum_object_size 4096 KB
#access log and cache log settings cache_access_log /usr/local/squid/var/logs/access.log cache_log /usr/local/squid/var/logs/cache.log pid_filename /usr/local/squid/var/run/squid.pid
#assign your machine IP acl allowed src 192.168.1.108 # Squid listening port http_port 8080
Then run the following commands
cd /usr/local/squid/sbin /.squid -z
This command will create your all the swap directories.
And you need to change the permissions of the cache directories too.
Now time to start Squid using
Now,browse couple of pages and turn off your internet,then try to browse the pages again.
You can see the web pages and they are coming from cache.
That’s it.You can download my configuration file and change it as your settings. From here
Hopefully in next post I will write down the steps how to configure Squid for a network and serving multiple computer as a Proxy server.
N.B:Please check the paths and change it accordingly for your installation directory.