Main Website RSS FeedCurrent Article

Complete Guide on Installing and Configuring Squid Proxy Server for Windows

Here’s another guide again by me to configure / installing Squid Cache Proxy to be an Anonymous Proxy Server and filtering some ads / banners (on Windows not Linux since most Linux users already know about this) :)

  • First download Squid 2.6 Stable 1 for Windows from Acme-Consulting and don’t forget to extract it into a directory of your choice, and Download JAP from here. And as a note, i wrote this tutorial using Squid 2.6 Stable 1 so if you’re using Squid 2.5 series there’s some parameters you’ll need to change first in order for it to work

Note: in this tutorial i’ll use G:\Squid as the Squid Directory

  • After extracting it into G:\Squid, go into etc directory “G:\Squid\etc” and rename all the .default file into .conf file. For example squid.conf.default -> squid.conf, mime.conf.default -> mime.conf, etc
  • Open squid.conf file using your favorite text editor such as Notepad, Ultraedit, etc. and configure it like this (you can change it later) :) but im not going into more detail here since most squid configuration are self explanatory and that’s depending on your hardware too (for example the memory size, cache size, etc). But you can always use this squid.conf directly in your squid configuration without changing any of its parameter as long as you extract squid into G:\Squid directory otherwise you’ll need to change every parameter that include G:\squid into your squid path

# HTTP Port (in this tutorial squid will run on localhost at port 3128)
http_port 127.0.0.1:3128

# ICP Port and HTCP Port (we’ll disable this since we are not going to use it)
icp_port 0
htcp_port 0

# Cache Peer (we’ll forward all request into parent proxy)
cache_peer 127.0.0.1 parent 4001 7 no-query

# Cache directory (in this example i was using 3000 MB / 3 GB space to store squid cache)
cache_dir awin32 g:/squid/var/cache 3000 16 256

#  access_log
access_log g:/squid/var/logs/access.log squid

#  cache_log
cache_log g:/squid/var/logs/cache.log

#  cache_store_log
cache_store_log none

#  mime_table
mime_table g:/squid/etc/mime.conf

#  pid_filename
pid_filename g:/squid/var/logs/squid.pid

#  unlinkd_program
unlinkd_program g:/squid/libexec/unlinkd.exe

# refresh_pattern (you can configure this as you like it, to get more hits from a website)
# note: if you change this parameter “refresh_pattern . 1 100% 20160 reload-into-ims ignore-reload” into something else for
# example like “refresh_pattern . 10 100% 20160 reload-into-ims ignore-reload”
# there’ll be some error on some page (Gamefaqs.com for an example) because the page didnt reload correctly after login into Gamefaqs
refresh_pattern ^http://.*\.gif$ 1440 50% 20160 reload-into-ims
refresh_pattern ^http://.*\.asis$ 1440 50% 20160
refresh_pattern -i \.png$ 10080 150% 40320 reload-into-ims
refresh_pattern -i \.jpg$ 10080 150% 40320 reload-into-ims
refresh_pattern -i \.bmp$ 10080 150% 40320 reload-into-ims
refresh_pattern -i \.gif$ 10080 300% 40320 reload-into-ims
refresh_pattern -i \.ico$ 10080 300% 40320 reload-into-ims
refresh_pattern -i \.swf$ 10080 300% 40320 reload-into-ims
refresh_pattern -i \.flv$ 10080 300% 40320 reload-into-ims
refresh_pattern -i \.rar$ 10080 150% 40320
refresh_pattern -i \.ram$ 10080 150% 40320
refresh_pattern -i \.txt$ 1440 100% 20160 reload-into-ims override-lastmod
refresh_pattern -i \.css$ 1440 60% 20160
refresh_pattern ^http:// 1 100% 20160 reload-into-ims ignore-reload
refresh_pattern ^ftp:// 240 50% 20160
refresh_pattern ^gopher:// 240 40% 20160
refresh_pattern /cgi-bin/ 0 0% 30
refresh_pattern . 0 100% 20160 reload-into-ims

# Deny requests to unknown ports
http_access deny !Safe_ports

# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports

# Block access to Malware & ads farm site
# Insert your own rule here by using
# acl blablabla url_regex -i "path to file"
# or
# acl blablabla url_regex "path to file"

http_access allow localhost
http_access deny all
cache_mgr Reaper-X
httpd_suppress_version_string on
visible_hostname Reaper
via off
forwarded_for off
log_icp_queries off
client_db off
never_direct allow all

#Some anonymizing
header_access From deny all
#there's some website which use referer check
#so its better to disable this
#header_access Referer deny all
header_access WWW-Authenticate deny all
header_access Link deny all
header_access Warning deny all
header_access Via deny all
header_access User-Agent deny all
header_access Proxy-Connection deny all
header_access X-Forwarded-For deny all

Now the next step would be running JAP, configure browsers to use Squid Proxy and start squid and you’re finished …. ;)

RSS Feed for This Post7 Comment(s)

  1. 1
    Reaper-X | Aug 2, 2006 at 16:39 / 4:39 PM | Links to this comments | Reply

    since i never check this post, i didnt know that my post about this isnt properly posted (since i was using 3rd party software to blogs) ... but i just edited this post as necessary (unfortunately there's some missing words *not an important words* since i already forgot about it) ... sorry for any inconvenience caused by me :)

  2. 2
    ruddy | Mar 30, 2007 at 9:52 / 9:52 AM | Links to this comments | Reply

    please send more tutorial about squid include how squid client connect and works to server

  3. 3
    Reaper-X | Apr 1, 2007 at 12:15 / 12:15 PM | Links to this comments | Reply

    well .. actually you can say that squid client is the client browser itself (for example client computer or other computer in the same network) and for the server itself. where the squid process launched :)

  4. 4
    SleepyBuddyz | May 7, 2007 at 16:30 / 4:30 PM | Links to this comments | Reply

    Hi,
    I got the following error when i run "squid -z -f "c:/squid/etc/squid.conf",
    the configuration file I downloaded here.
    Pls show me how to do.
    thanks.

    FATAL: Bungled squid.conf line 12: cache_dir awin32 c:/squid/var/cache 1000 8 64

    Squid Cache (Version 2.6.STABLE12): Terminated abnormally.

  5. 5
    Reaper-X | May 7, 2007 at 19:58 / 7:58 PM | Links to this comments | Reply

    aah .. actually since squid 2.6 stable 4 awin32 is no longer used, you should replace it with aufs instead :)

  6. 6
    Maroon Ibrahim | Oct 8, 2007 at 19:47 / 7:47 PM | Links to this comments | Reply

    no tweaks for windows server ? like tcp optimization and kernel tweaking on linux?

  7. 7
    Kamal Kumar | Jun 11, 2008 at 19:00 / 7:00 PM | Links to this comments | Reply

    first of all, what i download squid is squid 2.7for NT and somone suggest to run as
    Simply unzip in the root of C: and run c:\squid\sbin\squid -i. Rename and edit the files in c:\squid\etc and run net start squid or start squid via services.msc. Also, make sure to create c:\squid\var\cache and run squid -z to create swap directories (or you might spend a long time trying to figure out the cryptic "abnormal program termination" message like I did! :) )

    but not able to run squid on winxp
    (also squid port 3168 also not workin)

    Plz send guide on Installing and Configuring Squid Proxy Server for WindowsXP in more simple way

    also how we connect JAP to squid

    plz respond on mail, i shell be thankful to your goodself

    regards
    kamal
    boss_kamal(at)indiatimes(dot)com

1 Trackback(s)

  1. From BrSeek » Configurando o winsquid o squid do windows. | Oct 26, 2008

RSS Feed for This PostPost a Comment

Line and paragraph breaks automatic, e-mail address never displayed, avoid using spammy words or phrases to prevent your comment from going into the oblivion, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>