UPDATE: December 8th, 2014 – Squid 3 MSI installer package built for Microsoft Windows (including WHS) is now available at http://squid.diladele.com.
This post will try to guide you easily through the process of Installation and Setting Up of the latest Squid 2 stable build (2.7) on Windows Home Server 2011. This is a remake of my previous post devoted to doing the same in the first version of Windows Home Server and filled with unnecessary details that most people find far too technical to successfully keep themselves concentrated :). Hope this simple “view and do as I do” screenshot powered HOWTO will be more helpful to you.
So I assume you have your Windows Home Server 2011 up and running and you did the successful logon to the server desktop like it is shown on the following screenshot.
Step 1. Downloading and Unpacking
The binaries for Windows can be downloaded from Squid for Windows
page of Acme Consulting as shown on the following screenshots.
Select stable 2.7 version of Squid and save it into the Downloads folder.
Do the right mouse click on the downloaded file and “Extract all…” here.
Wait until the archive is extracted…
Now we are ready to proceed with the installation.
In order to install Squid we need to do some command prompt magic. Open up the Run window by pressing Windows+R, type
cmd in the input box and press Enter.
The command prompt appears. Now type
cd C:\Users\Administrator\Downloads\squid-2.7.STABLE-bin and press Enter again. The command prompt current folder will change into folder where we have unpacked squid earlier (see screenshot below).
Now we need to copy the unpacked squid folder to the root folder of C: drive. For now, the easiest solution is to keep squid installed in
C:\squid and do NOT try to put it into the usual
C:\Program Files folder. So type
xcopy /S squid c:\squid\ in the command prompt and wait until all files are copied.
Now change the current directory of the command prompt to the
C:\squid folder by typing
cd C:\squid (shown on the following screenshot).
C:\squid\etc folder contains for files with
.conf.default extension, we need to erase the extension from all of them leaving only
Now change the command prompt to the
sbin folder by typing cd
c:\squid\sbin. When it is done, install Squid as a Windows Service by typing
squid -i in the command prompt.
Press Windows+R and type
services.msc in the input box and then press Enter to start the Services MMC Snap-in.
Check the squid service is successfully installed. NOTE: if you try to start the service now it will give errors, the reason for this is that some of the folder and caching information is missing.
We will need to create a folder in the
C:\squid installation directory. Press right mouse button in the Explorer window and select New -> Folder. Name it
var as shown on the following screenshots.
Now create another folder named
logs inside of the
Switch to the command prompt and type
squid -z being in the
C:\squid\sbin folder to create a cache directory structure inside the
var folder. Check that is it created by looking at the contents of the
var\cache folder in the Windows Explorer.
Switch to the Services snap-in and start the Squid service (right click on the service name and choose Start). The service status should turn into “Started” and
squid.exe process will be shown in the Task Manager.
Open up the Internet Explorer (still being at your server desktop), choose Internet Options -> Connections -> LAN settings. Select the Use proxy server… checkbox and type localhost 3128 there as shown on the following screenshot.
Navigate to the http://squid-cache.org to see the browser now goes to the Internet thorough Squid.
Just to be sure everything works as expected, open
C:\squid\var\logs\access.log and notice a lot of entries there.
Post Install Firewall Configuration
In order to use the just installed proxy from another machines in the home network, we need to tweak the firewall setting of the Windows Home Server 2011. Open Server Manager and choose Windows Firewall, Inbound Rules node. Press the New Rule… button at the top right of the window.
Select Port checkbox.
Select TCP and Specific local port, type 3128 there. This is the port number the Squid usually listens to for incoming requests from the browsers.
Check all the boxes on the next step and press Next.
Name the newly created rule as you like. Press
Finish to complete the wizard steps.
Now open up another computer in your home network, specify the name or IP address of the WHS server as the proxy name and proxy port 3128. Type your favorite web site in the browser’s address bar and surf!
N.B. The same installation procedure can actually be applied to any version of Windows,… so this HOWTO will help you run Squid proxy on Windows XP, Windows 2003, Windows Vista, 7 and Windows Server 2008.
What is Next?
Having a common caching proxy in your home network is good, but having all explicit and ad stuff filtered out of your browsing is better, so the next step would be to follow the How to install QuintoLabs Content Security 1.4 on your Windows Home Server 2011 to harden your proxy installation.