Squid has been designed to run on Unix, but you can also get it to run on Microsoft Windows. Perhaps the easiest way is to use Red Hat’s Cygwin emulation layer. It gives a Windows box everything it needs to run a variety of Unix applications. Another option is to use SquidNT. This is a version of the source code that has been modified to compile under a native Windows C compiler.
Cygwin is a Unix emulation package for Microsoft Windows. It provides an environment that allows you to build and run software primarily designed for Unix. You can also download and install a number of precompiled binary packages, including Squid.
Cygwin runs on Windows 95, 98, ME, NT, 2000, and XP. The Cygwin FAQ, however, makes this disclaimer:
Keep in mind that Cygwin can only do as much as the underlying OS supports. Because of this, Cygwin will behave differently, and exhibit different limitations, on the various versions of Windows.
When writing this appendix, I installed Cygwin Version 1.3.21 on Windows 2000.
The first step is to install Cygwin on your Windows system. Visit the http://www.cygwin.com/ site and click on the Install Cygwin link. After running Cygwin Setup, you’ll have the base environment with a number of standard Unix tools. You might want to spend a little time playing with it to see how it works. Once you’re comfortable with the Cygwin environment, decide if you’d like to use the precompiled package or compile Squid from its source.
The Cygwin project provides a precompiled Squid binary. To download and install it, run the Cygwin Setup program again. When you see the Select Packages window, find the Web group and select squid for installation. Continue with the setup procedure as before.
When Setup completes, you should find the Squid binary at /usr/bin/squid and the configuration file at /etc/squid.conf.
You can also compile the Squid source code under Cygwin. This might be necessary if you want to run a more recent version than the precompiled binary available from the Cygwin site. To compile on Cygwin, you need to install at least the following packages:
Archive/sharutils
Devel/make
Devel/gcc
Interpreters/Perl
After installing those tools, you should be able to configure and compile Squid as described in Chapter 3.
Since Cygwin is essentially a Unix environment, you can run Squid as described throughout this book. Some special features may or may not work. For example, you won’t be able to build certain authentication helpers without additional libraries and header files. Here are a few things to watch out for:
The cache_effective_user directive is
set to nobody by default. When
you run Squid under Cygwin, you may get an error that the nobody doesn’t exist. You can either
create that user or set cache_effective_user
to a username that does exist.
Cygwin doesn’t have a /etc/resolv.conf by default, and Squid won’t pick up your DNS server settings from the Windows registry. You can either create a fake /etc/resolv.conf or list your name server addresses in squid.conf with a dns_nameserver directive.
Guido Serassio is maintaining a project called SquidNT. It is branch of Squid’s development tree that contains changes necessary for a native port of Squid to Windows NT, 2000, XP, and 2003. In other words, you can compile and run this version of Squid on Windows without any Unix emulation libraries. The code is known to compile with Microsoft’s Visual C++ 6.0 compiler and under the MSYS+MinGW environment. Guido also provides some precompiled SquidNT binaries. You can find his work and more information on SquidNT by visiting http://www.serassio.it/SquidNT.htm.