Installing Squid NT on Windows 7

Squid is a caching proxy server that can help reduce internet bandwidth usage and improving response time of loading a website by caching and re-using frequently opened web page. Squid reduce the bandwidth usage and accelerate the website loading by caching static website objects such as images, flash objects and text files, with some modification Squid can cache larger files such as PDF, MP3, executables, flash videos, etc.

In this tutorial we will install Squid NT which is a fork from Linux version of Squid to Windows 7 (seven). To begin with the installation, first download the package from here: Squid NT and then extract it to C:\ drive. After extracting the content of package you should see a folder named ‘squid’ on C:\ drive, the full path should be C:\squid. Another way is first extract the zip package on where you save it and then move the ‘squid’ directory to C:\

Modifying configuration file

Now we need to modify some files before we configuring Squid. Go to ‘etc’ folder on C:\squid\etc\ you’ll see these files:

  • cachemgr.conf.default
  • mime.conf.default
  • squid.conf.default
  • squid_radius_auth.conf.default

You need to copy and rename these files:

  • cachemgr.conf.default -> cachemgr.conf
  • mime.conf.default -> mime.conf
  • squid.conf.default -> squid.conf

From the three configuration files we only need to configure squid.conf file. The configuration file cachemgr.conf and mime.conf by default will be sufficient for our basic setup.

The default setting on squid.conf generally is ready to use, but you need to make note on these parts:

1. Search for ‘acl localnet src’ you’ll see:

You can comment out the settings that are not applicable for your network configuration, in my case I use 10.0.0.0/8 network configuration so I’ll comment out the other two lines as I don’t need it. You can comment by adding hash key ‘#’. The end result would be like this:

2. Search for ‘dns_nameservers’

Under the explanation, you should add your ISP dns nameservers. The format should look like this:

Now save the changes and close the file. Until these steps, it should be enough to start Squid, you can modify the configuration later on.

Installing Squid service

These steps will install the Squid service so we can restart Squid from Windows’ Control Panel.

1. First we have to disable User Account Control (UAC) settings to be able to install Squid service. Go to: “Control Panel > System and Security > Change User Account Control settings” and move the bar to “Never Notify”, you need to restart Windows 7 to make the settings effective.

Change UAC settings to be able to setup Squid as service
Change UAC settings to be able to setup Squid as service

2. After reboot, open command prompt by clicking on Windows Logo (start), then type ‘Command Prompt’ on the search box and press enter.

Search for "Command Prompt" and press enter
Search for "Command Prompt" and press enter

3. Go to Squid’s sbin directory by typing:

4. Install Squid service with this command (please re-types this and not copy paste to make sure you have the correct character code):

You should get this information:

Squid service installation
Squid service installation

5. Setup Squid’s cache (please re-types this and not copy paste to make sure you have the correct character code):

You should get this information:

6. After Squid service is installed and the cache is created, now let’s start the service by going to Control Panel > System and Security > Administrative Tools > Services. Look for ‘Squid’, select it and press the start button.

Open the service manager
Open the service manager
Start Squid service

Now if you see on the Task Manager > Services, you can see Squid service have a Running status.

Squid process on task manager
Squid process on task manager

7. As Squid service is up and running, we need to configure the browser to access the internet via proxy server. On Internet Explorer go to Tools > Internet Options > Connections > LAN Settings, give check on “Use a proxy server for your LAN …” and fill the Address field with your Squid server IP Address (in this case your PC IP address) with the Port 3128 (standard Squid port, you can modify this on squid.conf), click OK twice to save the settings.

Internet Explorer options
Internet Explorer options
Click on LAN Settings
Click on LAN Settings
Add your PC IP address and Port 3128
Add your PC IP address and Port 3128

8. Next step is to test whether our configuration is correct. Go to this site: www.whatismyipaddress.com and you should see “Proxy Server Detected!” message, something similar like this:

Check whether Squid working correctly
Check whether Squid working correctly

9. As everything is working, now we need to re-enable User Account Control (UAC). Go to: “Control Panel > System and Security > Change User Account Control settings” and move the bar to “Default” it’s the 3rd bar, you need to restart Windows 7 to make the settings effective.

I hope this tutorial is clear enough, but in case you still have question please sign-up and post a comment.

32 thoughts on “Installing Squid NT on Windows 7”

    1. the installation for windows vista should be similar with windows 7, so i think you can still follow this tutorial for squid installation on windows vista

      1. Hi Markus
        Thank you for the great tutorial.
        On windows vista (don’t know about windows 7) there’s one more line in squid.conf you need to change:
        search for: access_log
        and replace:
        access_log c:/squid/var/logs/access.log squid
        with:
        access_log c:\squid\var\logs\access.log squid
        If you don’t, squid service can’t be started, you’ll get error 1067

  1. Hi shubham,

    If you want your ISP’s proxy, add cache_peer directive likes-

    # hostname type port port options
    cache_peer your.isp.proxy1 parent 3128 3130 proxy-only default
    cache_peer your.isp.proxy2 parent 3128 3130 proxy-only

    enjoy!

  2. i am using mozilla firefox browser, how to configure the proxy in this browser?
    i don’t have internet explorer, coz i uninstalled it.
    and i still confuse about this:
    “fill the Address field with your Squid server IP Address (in this case your PC IP address) with the Port 3128”
    what does it mean? where could i find this IP?
    thanx

  3. Thanks for your guide. :)

    However, I bumped into “Access denied” error in browser when I tried to browse via proxy.
    After googling a while, I added “http_access allow localhost” right after “http_access allow localnet” in squid.conf

    And no more “Access denied”.

  4. Hello Markus,

    I installed the Squid 2.7.STABLE8 Squid Web Proxy under Windows 7 Pro according your steps. When I tried to test the proxy i see the IP address of my ISP and a map of my localization instead of the red message “Proxy Server Detected”.

    I am using in the web browser setting the ip in my case 192.168.0.130 and the port 3128. Can I use in the future the localhost (127.0.0.1).

    I really appreciate it your help and support in order to fix this issue in my installation of squid.

    Regards,

    Carlos

    1. you have to use the network IP of the server where you install squid on. if you use 127.0.0.1 then it will only work if you access the proxy server on the server where you install it and not from the network/LAN.

      check the proxy access log, if you set all the settings correctly you should see some log there.

      1. Markus,

        I installed the squid in my laptop in order to have a faster surfing

        The access.log show the following:

        – 127.0.0.1 – Ip in the browser proxy configuration
        1274468450.576 0 127.0.0.1 TCP_DENIED/403 1411 GET http://www.google.com/ – NONE/- text/html
        In the screen
        Error
        The requested URL could not be retrieved

        – 192.168.0.130 – Ip in the browser proxy configuration
        Try to access – http://whatismyipaddress.com/
        1274468730.300 780 192.168.0.130 TCP_MISS/200 3455 GET http://whatismyipaddress.com/ – DIRECT/140.239.191.10 text/html
        1274468730.909 562 192.168.0.130 TCP_MISS/304 323 GET http://www.google-analytics.com/ga.js – DIRECT/74.125.65.101 –
        1274468731.033 93 192.168.0.130 TCP_MISS/200 517 GET http://www.google-analytics.com/__utm.gif? – DIRECT/74.125.65.101 image/gif
        1274468731.439 218 192.168.0.130 TCP_MISS/200 467 GET http://maps.google.com/maps/api/js/AuthenticationService.Authenticate? – DIRECT/72.14.253.104 text/javascript
        1274468731.470 359 192.168.0.130 TCP_MISS/200 676 GET http://maps.google.com/maps/api/js/ViewportInfoService.GetViewportInfo? – DIRECT/72.14.253.104 text/javascript
        1274468731.876 343 192.168.0.130 TCP_MISS/204 404 GET http://gg.google.com/csi? – DIRECT/74.125.53.113 text/html

        In the screen
        I see the ip of my isp instead of “Proxy detected” message

        I really appreciate it your help

        Best Regards,

        Carlos

  5. I want to use different block list for different users.. i am using windows…
    so i thought of using with the path %userprofile% but it doesnt work ..

    acl permit url_regex -i “%userprofile%/whitelist.txt”

    it gives an error ..file not found

    how to do this ???

      1. Hi Markus,
        Thanks for the reply…
        My problem is this … i want that every user should have its own whitelist and blacklist …
        so i used
        acl permit url_regex -i “%userprofile%/whitelist.txt”
        %userprofile% will give the path for the logged in user.
        if i write the full path name then that will always be static.

        Imagine a system with three accounts:
        1)Administrator
        2)Markus
        3)Sushi
        I want that in the config file the path should be such that …
        when markus logsin he has a different block list and when sushi logs in a different black list is loaded

        This has to be done with single installation of squid ….
        any ideas ..???

      2. I don’t think this will work as Squid don’t have access to the user’s directory (unless you as administrator give it permission), even though you do that I don’t think Squid can understand “%userprofile%”

  6. Hi,

    How to confingure for DHCP (my ISP used DHCP).

    Can this configuration use for window xp ?

    Thanks for your post.

  7. Thank you for the guide, i visit a lot of forums with annoying heave size gif signatures. Now i can read the forums faster.

  8. Hi,
    When I’m trying to install the squid “squid -i” I cant access it.
    ‘Squid’ is not recognized as an internal ***
    any ideas …??
    Thanks

    1. did you run the command from “c:\squid\sbin” directory? if not, you should go to that directory first by running command: “cd c:\squid\sbin

  9. for some reasons, dns_nameservers is important for my windows7 to run flawlessly, web surfing is terribly slow without forcing my own DNS in squid.conf (dns_nameservers 192.168.10.1), thank you man

Leave a Reply

Your email address will not be published. Required fields are marked *