Squid Web Cache wiki

Squid Web Cache documentation

🔗 Squid on Windows

🔗 Does Squid run on Windows ?

Squid can compile and run on Windows as a system service using the Cygwin emulation environment, or can be compiled in Windows native mode using the MinGW + MSYS development environment. All modern Windows versions are supported

:information_source: The original development code name of the 2.5 project port was SquidNT, but after the 2.6.STABLE4 release, this project was complete. So when speaking about Squid on Windows, people should always refer to Squid, instead to the old SquidNT name.

🔗 Known Limitations

🔗 Unavailable features

🔗 Pre-Built Binary Packages

Packages available for Squid on multiple environments.

🔗 Squid-4

Maintainer: Rafael Akchurin, Diladele B.V.

Bug Reporting: (about the installer only) https://github.com/diladele/squid-windows/issues

MSI installer packages for Windows are at:

🔗 Squid-3.3

Bug Reporting: see https://cygwin.com/problems.html

Binary packages for the Cygwin environment on Windows are at:

🔗 Installing Squid

🔗 Installing with Cygwin

The usage of the Cygwin environment is very similar to other Unix/Linux environments, and -devel version of libraries must be installed.

:information_source: Squid will by default, install into /usr/local/squid. If you wish to install somewhere else, see the –prefix option for configure when building

Now, add a new Cygwin user (see the Cygwin user guide) and map it to SYSTEM, or create a new NT user, and a matching Cygwin user and they become the squid runas users.

Read the squid FAQ on permissions if you are using CYGWIN=ntsec.

Now, configure cygrunsrv to run Squid as a service as the chosen username. You may need to check permissions here.

🔗 Service

Command line options for the Windows service support:

🔗 Command Line

To use the Squid original command line, the new -O switch must be used ONCE, the syntax is:

squid -O cmdline [-n service-name]

If multiple service command line options must be specified, use quote. The -n switch is needed only when a non default service name is in use.

:x: Do not use the “Start parameters” in the Windows 2000/XP/2003 Service applet. They are specific to Windows services functionality and Squid is not able to interpret and use them.

In the following example the command line of the “squidsvc” Squid service is set to “-D -u 3130”:

squid -O "-u 3130" -n squidsvc

🔗 Cache Manager CGI on Windows

On Windows, cache manager can be used with Microsoft IIS or Apache. Some specific configuration could be needed:

🔗 Configuration Guides

🔗 Registry DNS lookup

On Windows platforms, if no value is specified in the dns_nameservers option in squid.conf or in the /etc/resolv.conf file, the list of DNS name servers are taken from the Windows registry, both static and dynamic DHCP configurations are supported.

🔗 Compatibility Notes

🔗 Compiling

configure options

Unsupported configure options:

🔗 Compiling with Cygwin

In order to compile Squid, you need to have Cygwin fully installed.

The usage of the Cygwin environment is very similar to other Unix/Linux environments, and -devel version of libraries must be installed.

🔗 Compiling with MinGW

Requires the latest packages from https://osdn.net/projects/mingw/ with GCC 8 or later compiler.

:warning: This section needs re-writing. This environment has not successfuly built since Squid-3.4.

In order to compile squid using the MinGW environment, the packages MSYS, MinGW and msysDTK must be installed. Some additional libraries and tools must be downloaded separately:

Before building Squid with SSL support, some operations are needed (in the following example OpenSSL is installed in C:\OpenSSL and MinGW in C:\MinGW):

Unpack the source archive as usual and run:

    ./configure \
        --enable-build-info="Windows (MinGW32)" \
        --prefix=c:/squid \
        --enable-default-hostsfile=none

    make check && make install

Squid will install into c:\squid. If you wish to install somewhere else, change the –prefix option for configure.

Now, to run Squid as a Windows system service, run squid -n, this will create a service named “Squid” with automatic startup. To start it run net start squid from command line prompt or use the Services Administrative Applet.

Always check the provided release notes for any version specific detail.

🔗 Compiling with msys2

:x: to be completed

🔗 Porting efforts

Squid series 3+ have major build issues on all Windows compiler systems. Below is a summary of the known status for producing a useful Squid for Windows. In a rough order of completeness as of the last page update.

The TODO list for Windows has additional wishlist items that also need to be sorted out:

Issues:

🔗 Cygwin

Cygwin has working Squid-4 builds and available packages sponsored by Diladele.

🔗 MinGW-w64

Currently the spare-time focus of porting efforts by the Squid developer team. Latest cross-compilation results at https://build.squid-cache.org/job/trunk-mingw-cross/. As this is spare-time work progress is slow.

cross-compiling:

    # Debian Packages Required:
    #
    # g++
    #       provides GCC base compiler. GCC 8 or later required.
    #
    # mingw-w64
    #       provides GCC cross-compiler. GCC 8 or later required.
    #
    # mingw-w64-tools
    #       provides pkg-config and other build-time tools used by autoconf
    #

    ./configure \
            --host=x86_64-w64-mingw32 \
            BUILDCXX="g++" \
            BUILDCXXFLAGS="-DFOO" \
            --enable-build-info="Windows (MinGW-w64 cross-build)"

Native build:

:x: No work on this environment has been done since Squid-3.3:

Requires the latest packages from http://sourceforge.net/projects/mingw-w64/ with GCC 8 or later compiler.

    sh ./configure \
        --enable-build-info="Windows (MinGW-w64)"

🔗 MinGW32

:x: Almost no work on this environment has been done since Squid-3.5:

There also appears to be some work done by Joe Pelaez Jorge (https://code.launchpad.net/~joelpelaez/squid/win32).

🔗 Visual Studio

:x: Almost no work on this environment has been done since Squid-2.7.

Entirely new .sln, .sdf and .vcxproj build files need to be generated. Ideally these would mirror the on-Windows style of convenience libraries assembled to produce a number of different binaries. Experiments along those lines have some nice results.

Categories: KnowledgeBase

Navigation: Site Search, Site Pages, Categories, 🔼 go up