Markus Blog What’s going on Internet?

10Jun/0769

Installing Squid Cache for Windows

Linux users mostly already know Squid proxy server as the best and most used proxy server. As on my previous post “Bandwidth Shaping Using Squid Cache and WIPFW” I need a free proxy server for my windows server. I found SquidNT which is ported from its Linux version by Guido Serassio.

You can download SquidNT from Acme Consulting’s website or here. If you want to do bandwidth shaping then you must download SquidNT with Delay Pool version. On this installation guide, I use the Delay Pool version as I want to do bandwidth shaping.

Step 1: download SquidNT Delay Pool version here

Step 2: extract the zip file and put it on C: drive

Step 3: configure the squid.conf file on /etc folder. There is squid.conf.default you can rename it to squid.conf and edit it.

Step 4: configure the DNS nameserver. On squid.conf find:

# TAG: dns_nameservers
# Use this if you want to specify
# a list of DNS name servers (IP addresses)
# to use instead of those given in your
# /etc/resolv.conf file.
#
# Example: dns_nameservers 10.0.0.1 192.172.0.4
#
#Default:
# none
dns_nameservers 192.168.0.1

To find what is your nameserver is type: ipconfig on command prompt and find the IP number on Default Gateway field. Copy it to your squid.conf file like above.

Step 5: setup ACL

# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from
# where browsing should be allowed
#acl our_networks src 192.168.1.0/24 192.168.2.0/24
#http_access allow our_networks
acl our_networks src 192.168.0.0/16
http_access allow our_networks

Here you can setup which network that allowed to use your proxy server. From ipconfig command you can find out what is your IP address, usually it have 192.168.0.x format so you can apply the configuration above.

Step 6: Setup the hostname

# TAG: visible_hostname
# If you want to present a special hostname ...
# then define this. Otherwise, the return ...
# will be used. If you have multiple caches ...
# get errors about IP-forwarding you must ...
# names with this setting.
#
#Default:
# none
visible_hostname localhost

Here you can define the name for your hostname, for example you can use “localhost” or “server.youdomain.com”

Step 7: Setup cache directory

Run this command from command prompt: c:\squid\sbin\squid -D -z

Step 8: On Windows XP/2000/2003 you can setup SquidNT as a service

Run this command from command prompt: c:\squid\sbin\squid -i

You can start/stop/restart the service called Squid from: Control Panel > Administrative Tools > Services

Step 9: Setup your browser to use proxy server

For Internet Explorer users, go to: Tools > Internet Options. Select Connection tab and click on LAN Settings

On the pop up window you’ll find proxy box, give a check on “Use a proxy server for your LAN…” and fill your server’s IP (where you install SquidNT) on the address field and fill “3128” on port field. 3128 is the default port for SquidNT.

Click Ok to save the configuration. Now try to open a web page and see if you can open it. If you can then the configuration is set correctly.

Step 10: Setup the Delay Pool.

As I want to do bandwidth shaping then I needs to setup the Delay Pool. Here is the configuration:

#
#Default:
# delay_pools 0
delay_pools 1
delay_class 1 1

Then create delay_access:

# delay_access 2 allow lotsa_little_clients
# delay_access 2 deny all
#
#Default:
# none
delay_access 1 allow our_networks
delay_access 1 deny all

Now we setup how much bandwidth we want to allocate. For example, you have 384 Kbps ADSL connection which means you can download at around 40KB/s. Now you want to shape the maximum to around 30KB/s download rate, here is the configuration:

#
#delay_parameters 2 32000/32000 8000/8000 600/8000
#
# There must be one delay_parameters line for each delay pool.
#
#Default:
# none
delay_parameters 1 30000/30000

Step 11: Restart the Squid service from: Control Panel > Administrative Tools > Services

Done! Now you have 30KB/s for browsing and another 10KB/s reserved for other internet connection like chatting or streaming radio :)

Bookmark and Share

Related Article

Comments (69) Trackbacks (6)
  1. @Thang
    check your squid.conf and look for “dns_nameservers” variable and make sure you have the correct DNS ip address from your ISP

  2. Hello
    Yes i checked and i can also ping this address from server
    195.238.2.21 this is our ISP DNS
    Thanks

  3. @Thang
    do you have firewall installed? make sure squid are allowed to access internet

  4. Yes , maybe due to our firewall.
    thanks

  5. i have 2 lan connection
    cable 192.168.9.0
    wirelsess 192.168.218.0
    n wireless
    i want squid to use only wireless connection,
    how i do that

  6. Hi Markus,

    I have tried already using your suggestion, but still not effected if user download any file such as mp3. the speed still higher then i specified in squid.conf.

    FYI: I install squid in win server 2000.

    Thank you

  7. still confused in settingup squid totally can any one send me a link about the full description will be really great.


Leave a comment


*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word


Sideblog feed

  • Mozilla Released Thunderbird 3 9 December 2009
    The long waited open source email client Thunderbird 3 is now released! Upgrading from Thunderbird 2 to Thunderbird 3 is very easy and almost automatically. Once you finished installing version 3, you. […]
  • Microsoft Wireless Comfort Desktop 5000 Keyboard and Mouse 22 October 2009
    The Microsoft Wireless Comfort Desktop 5000 has been designed to enhance your Windows 7 experience. You can easily access programs in the task bar with convenient hot keys. Applications in the taskbar. […]
  • WooFunction: 178 Amazing Web Design Icons 28 September 2009
    The WooFunction Icon Set includes 178 amazing web-related icons in a sophisticated and glossy design style. All 178 icons are available as 32×32 pixel PNG files and we can assure you that they are in. […]
  • Moblin the Next Generation OS for Netbook 27 September 2009
    Moblin is an open source project that supports Linux-based software platform and is optimized for the next generation of mobile devices including netbooks, mobile Internet devices (MIDs), in-vehicle i. […]
  • Twitterify Your Wordpress Blog Using P2 Theme 21 September 2009
    Twitter is becoming more and more popular due to its requirement as micro blogging is not much, only 140 characters that even less than a text message limit which is 160 characters. Blogger that is no. […]