How to install Squid 5 on Windows 10

Ertan Yıldız
7 min readApr 14, 2021

--

Squid is a caching and forwarding HTTP web proxy whose version 1.0.0 was released in July 1996[1]. It is old but still being used by many people. For more details see http://www.squid-cache.org/.

Squid was originally designed to run as a daemon on Unix-like systems. Squid 3.5 is also available for Windows[2].

New versions of Squid fix many security problems[3] and in this case Windows users need new versions of Squid which are built for Windows.

One of my friends asked for my help about using new versions of squid for Windows 10 to avoid CVE-2019–12525 and CVE-2019–12526. And I installed Squid 5 on Windows by using Cygwin. You may find the steps that I followed below.

Install Cygwin

You may find latest installer for Cygwin in https://cygwin.com/install.html. I have used version 3.1.6 which was the latest version on that time. Here below you may see the installed packages in my Cygwin. You may use “cygcheck –c” command on Cygwin terminal to list installed packages in yours. You should update your installation for missing packages. Comparing the list below with yours would help you. (For required packages, see [2])

╔══════════════════════════╦════════════════════════╦════════╗
║ Package ║ Version ║ Status ║
╠══════════════════════════╬════════════════════════╬════════╣
║ _autorebase ║ 001007–1 ║ OK ║
║ alternatives ║ 1.3.30c-10 ║ OK ║
║ autoconf ║ 13–1 ║ OK ║
║ autoconf2.1 ║ 2.13–12 ║ OK ║
║ autoconf2.5 ║ 2.69–4 ║ OK ║
║ automake ║ 11–1 ║ OK ║
║ automake1.10 ║ 1.10.3–3 ║ OK ║
║ automake1.11 ║ 1.11.6–3 ║ OK ║
║ automake1.12 ║ 1.12.6–3 ║ OK ║
║ automake1.13 ║ 1.13.4–2 ║ OK ║
║ automake1.14 ║ 1.14.1–3 ║ OK ║
║ automake1.15 ║ 1.15.1–2 ║ OK ║
║ automake1.16 ║ 1.16.1–1 ║ OK ║
║ automake1.9 ║ 1.9.6–11 ║ OK ║
║ base-cygwin ║ 3.8–1 ║ OK ║
║ base-files ║ 4.3–2 ║ OK ║
║ bash ║ 4.4.12–3 ║ OK ║
║ binutils ║ 2.34+1git.de9c1b7cfe-1 ║ OK ║
║ bzip2 ║ 1.0.8–1 ║ OK ║
║ ca-certificates ║ 2.40–1 ║ OK ║
║ cmake ║ 3.17.3–2 ║ OK ║
║ coreutils ║ 8.26–2 ║ OK ║
║ crypto-policies ║ 20190218–1 ║ OK ║
║ cygrunsrv ║ 1.62–1 ║ OK ║
║ cygutils ║ 1.4.16–2 ║ OK ║
║ cygwin ║ 3.1.7–1 ║ OK ║
║ cygwin-devel ║ 3.1.7–1 ║ OK ║
║ cygwin32-libtool ║ 2.4.6–3 ║ OK ║
║ dash ║ 0.5.9.1–1 ║ OK ║
║ diffutils ║ 3.5–2 ║ OK ║
║ ed ║ 1.16–1 ║ OK ║
║ editrights ║ 1.03–1 ║ OK ║
║ file ║ 5.32–1 ║ OK ║
║ findutils ║ 4.6.0–1 ║ OK ║
║ gawk ║ 5.1.0–1 ║ OK ║
║ gcc-core ║ 10.2.0–1 ║ OK ║
║ gcc-g++ ║ 10.2.0–1 ║ OK ║
║ getent ║ 2.18.90–4 ║ OK ║
║ grep ║ 3.0–2 ║ OK ║
║ groff ║ 1.22.4–1 ║ OK ║
║ gzip ║ 1.8–1 ║ OK ║
║ hostname ║ 3.13–1 ║ OK ║
║ info ║ 6.7–1 ║ OK ║
║ ipc-utils ║ 1.0–2 ║ OK ║
║ less ║ 551–1 ║ OK ║
║ libarchive13 ║ 3.4.3–1 ║ OK ║
║ libargp ║ 20110921–3 ║ OK ║
║ libatomic1 ║ 10.2.0–1 ║ OK ║
║ libattr1 ║ 2.4.48–2 ║ OK ║
║ libblkid1 ║ 2.33.1–2 ║ OK ║
║ libbrotlicommon1 ║ 1.0.7–1 ║ OK ║
║ libbrotlidec1 ║ 1.0.7–1 ║ OK ║
║ libbz2_1 ║ 1.0.8–1 ║ OK ║
║ libcharset1 ║ 1.16–2 ║ OK ║
║ libcom_err-devel ║ 1.44.5–1 ║ OK ║
║ libcom_err2 ║ 1.44.5–1 ║ OK ║
║ libcrypt-devel ║ 4.4.4–1 ║ OK ║
║ libcrypt2 ║ 4.4.4–1 ║ OK ║
║ libcurl4 ║ 7.72.0–1 ║ OK ║
║ libdb5.3 ║ 5.3.28–2 ║ OK ║
║ libdv-devel ║ 1.0.0–11 ║ OK ║
║ libdv4 ║ 1.0.0–11 ║ OK ║
║ libevent2.0_5 ║ 2.0.22–1 ║ OK ║
║ libexpat-devel ║ 2.2.6–1 ║ OK ║
║ libexpat1 ║ 2.2.6–1 ║ OK ║
║ libfdisk1 ║ 2.33.1–2 ║ OK ║
║ libffi6 ║ 3.2.1–2 ║ OK ║
║ libgc1 ║ 8.0.4–1 ║ OK ║
║ libgcc1 ║ 10.2.0–1 ║ OK ║
║ libgccpp1 ║ 8.0.4–1 ║ OK ║
║ libgcrypt-devel ║ 1.8.2–1 ║ OK ║
║ libgcrypt20 ║ 1.8.2–1 ║ OK ║
║ libgdbm4 ║ 1.13–1 ║ OK ║
║ libgdbm6 ║ 1.18.1–1 ║ OK ║
║ libgdbm_compat4 ║ 1.18.1–1 ║ OK ║
║ libgmp10 ║ 6.2.0–2 ║ OK ║
║ libgomp1 ║ 10.2.0–1 ║ OK ║
║ libgpg-error-devel ║ 1.37–1 ║ OK ║
║ libgpg-error0 ║ 1.37–1 ║ OK ║
║ libgssapi_krb5_2 ║ 1.15.2–2 ║ OK ║
║ libgssrpc4 ║ 1.15.2–2 ║ OK ║
║ libguile2.2_1 ║ 2.2.7–1 ║ OK ║
║ libiconv ║ 1.16–2 ║ OK ║
║ libiconv-devel ║ 1.16–2 ║ OK ║
║ libiconv2 ║ 1.16–2 ║ OK ║
║ libidn2_0 ║ 2.2.0–1 ║ OK ║
║ libintl8 ║ 0.19.8.1–2 ║ OK ║
║ libisl22 ║ 0.22.1–2 ║ OK ║
║ libjsoncpp24 ║ 1.9.3–1 ║ OK ║
║ libk5crypto3 ║ 1.15.2–2 ║ OK ║
║ libkadm5clnt_mit11 ║ 1.15.2–2 ║ OK ║
║ libkadm5srv_mit11 ║ 1.15.2–2 ║ OK ║
║ libkdb5_8 ║ 1.15.2–2 ║ OK ║
║ libkrad0 ║ 1.15.2–2 ║ OK ║
║ libkrb5-devel ║ 1.15.2–2 ║ OK ║
║ libkrb5_3 ║ 1.15.2–2 ║ OK ║
║ libkrb5support0 ║ 1.15.2–2 ║ OK ║
║ libltdl7 ║ 2.4.6–7 ║ OK ║
║ liblzma5 ║ 5.2.4–1 ║ OK ║
║ libmpc3 ║ 1.2.0–1 ║ OK ║
║ libmpfr6 ║ 4.1.0–1 ║ OK ║
║ libncursesw10 ║ 6.1–1.20190727 ║ OK ║
║ libnghttp2_14 ║ 1.37.0–1 ║ OK ║
║ libopenldap2_4_2 ║ 2.4.53–1 ║ OK ║
║ libp11-kit0 ║ 0.23.20–1 ║ OK ║
║ libpcre1 ║ 8.44–1 ║ OK ║
║ libpipeline1 ║ 1.5.1–1 ║ OK ║
║ libpkgconf3 ║ 1.6.3–1 ║ OK ║
║ libpopt-common ║ 1.16–2 ║ OK ║
║ libpopt0 ║ 1.16–2 ║ OK ║
║ libpsl5 ║ 0.21.0–1 ║ OK ║
║ libquadmath0 ║ 10.2.0–1 ║ OK ║
║ libreadline7 ║ 7.0.3–3 ║ OK ║
║ librhash0 ║ 1.4.0–1 ║ OK ║
║ libsasl2-devel ║ 2.1.27–1 ║ OK ║
║ libsasl2_3 ║ 2.1.27–1 ║ OK ║
║ libsigsegv2 ║ 2.10–2 ║ OK ║
║ libsmartcols1 ║ 2.33.1–2 ║ OK ║
║ libssh2_1 ║ 1.7.0–1 ║ OK ║
║ libssl-devel ║ 1.1.1f-1 ║ OK ║
║ libssl1.0 ║ 1.0.2t-1 ║ OK ║
║ libssl1.0-devel ║ 1.0.2t-1 ║ OK ║
║ libssl1.1 ║ 1.1.1f-1 ║ OK ║
║ libstdc++6 ║ 10.2.0–1 ║ OK ║
║ libtasn1_6 ║ 4.14–1 ║ OK ║
║ libtool ║ 2.4.6–7 ║ OK ║
║ libunistring2 ║ 0.9.10–1 ║ OK ║
║ libuuid1 ║ 2.33.1–2 ║ OK ║
║ libuv1 ║ 1.38.0–1 ║ OK ║
║ libverto1 ║ 0.2.6–1 ║ OK ║
║ libxml2 ║ 2.9.10–2 ║ OK ║
║ libxml2-devel ║ 2.9.10–2 ║ OK ║
║ libzstd1 ║ 1.4.5–1 ║ OK ║
║ login ║ 1.13–1 ║ OK ║
║ m4 ║ 1.4.18–1 ║ OK ║
║ make ║ 4.3–1 ║ OK ║
║ makedepend ║ 1.0.6–1 ║ OK ║
║ man-db ║ 2.7.6.1–1 ║ OK ║
║ mintty ║ 3.4.0–1 ║ OK ║
║ ncurses ║ 6.1–1.20190727 ║ OK ║
║ openssl ║ 1.1.1f-1 ║ OK ║
║ p11-kit ║ 0.23.20–1 ║ OK ║
║ p11-kit-trust ║ 0.23.20–1 ║ OK ║
║ perl ║ 5.30.3–1 ║ OK ║
║ perl-Test-Harness ║ 3.42–2 ║ OK ║
║ perl-Unicode-Normalize ║ 1.26–2 ║ OK ║
║ perl_autorebase ║ 5.30.3–1 ║ OK ║
║ perl_base ║ 5.30.3–1 ║ OK ║
║ pkg-config ║ 1.6.3–1 ║ OK ║
║ pkgconf ║ 1.6.3–1 ║ OK ║
║ publicsuffix-list-dafsa ║ 20200326–1 ║ OK ║
║ rebase ║ 4.4.4–1 ║ OK ║
║ run ║ 1.3.4–2 ║ OK ║
║ sed ║ 4.4–1 ║ OK ║
║ tar ║ 1.29–1 ║ OK ║
║ terminfo ║ 6.1–1.20190727 ║ OK ║
║ terminfo-extra ║ 6.1–1.20190727 ║ OK ║
║ texinfo ║ 6.7–1 ║ OK ║
║ tzcode ║ 2020a-1 ║ OK ║
║ tzdata ║ 2020a-1 ║ OK ║
║ util-linux ║ 2.33.1–2 ║ OK ║
║ vim-minimal ║ 8.2.0486–1 ║ OK ║
║ w32api-headers ║ 8.0.0–1 ║ OK ║
║ w32api-runtime ║ 8.0.0–1 ║ OK ║
║ which ║ 2.20–2 ║ OK ║
║ windows-default-manifest ║ 6.4–1 ║ OK ║
║ xz ║ 5.2.4–1 ║ OK ║
║ zlib0 ║ 1.2.11–1 ║ OK ║
╚══════════════════════════╩════════════════════════╩════════╝

Install Squid into Cygwin

After installing Cygwin, download Squid 5 from https://github.com/squid-cache/squid/tree/v5 and extract it under one of Cygwin folders (you may create a folder under /home and extract squid files into it.)

Open Cygwin terminal and navigate to the folder you extracted squid files into and run the command below.

./configure — bindir=/bin/squid — sbindir=/usr/sbin/squid — sysconfdir=/etc/squid — datadir=/usr/share/squid — libexecdir=/usr/lib/squid — disable-strict-error-checking — with-logdir=/var/log/squid — with-swapdir=/var/cache/squid — with-pidfile=/var/run/squid.pid — enable-ssl — enable-delay-pools — enable-ssl-crtd — enable-icap-client — enable-esi — disable-eui — localstatedir=/var/run/squid — sharedstatedir=/var/run/squid — datarootdir=/usr/share/squid — enable-disk-io=”AIO,Blocking,DiskThreads,IpcIo,Mmapped” — enable-auth-basic=”DB,NCSA,POP3,RADIUS,SASL,SMB,fake,getpwnam” — enable-auth-ntlm=’fake’ — enable-auth-negotiate=’kerberos,wrapper’ — enable-external-acl-helpers=’SQL_session,file_userip’ — disable-arch-native — with-openssl — with-filedescriptors=65536 — enable-removal-policies=”lru,heap”

Then execute the commands listed below.

make
make install

Those commands will install Squid 5 into your Cygwin.

Create Windows Service for Squid

You can create a windows service for your squid, which will run under Cygwin, by running the below command.

“bin\cygrunsrv.exe” --install squid --path /usr/sbin/squid/squid --args “-N -n squid -f /cygdrive/c/squid_5.0/config/squid.conf” -y tcpip --type auto

“/cygdrive/c/squid_5.0/config/squid.conf” is the path of squid.conf file for my installation. You should update it with the location of your squid.conf file.

--

--