7

We are planning on using Varnish Cache 3.0.2 (latest version) for our production environment, however, for development we would like to run Varnish on our local computers, some of us have Win7.

The only easy option I could only find to install it was an older version of Varnish (2.1) bundled for Windows.

https://www.varnish-cache.org/trac/wiki/VarnishOnCygwinWindows

Are there options for building it (how?) or getting the compiled version?

2
  • 1
    Why the downvotes? This is a valid question even if it is a Bad Idea(TM). – user62491 Dec 9 '11 at 23:09
  • What about starting varnish in docker on windows? – Matthias M Jan 31 '18 at 14:50
8

You're probably much better off installing a Linux distribution on a virtual machine and use the package-managed version of Varnish from that distro. It will be more similar to your production environment and easier to configure.

5

Varnish Cache 3.0.2 is now available for Windows Cygwin, see:

It was updated on December 2011

3
  1. Install varnish and cygrunsrv with cygwin
  2. Use cygrunsrv to install service by cygwin
  3. Specify command line arguments for varnishd.exe Uncommon, but important for use with cygrunsrv: -F do not fork: otherwise cygrunsrv could not control the forked daemon process.
  4. Check that all directories and files exist:
    • /cygdrive/c/cygwin64/etc/varnish/default.vcl
    • /cygdrive/c/cygwin64/var/varnish

Full statement (use as single line) to install service:

cygrunsrv --install varnish
--path /cygdrive/c/cygwin64/usr/sbin/varnishd.exe
-a "-P /cygdrive/c/cygwin64/var/varnish/varnish.pid
   -f /cygdrive/c/cygwin64/etc/varnish/default.vcl
   -a :81 -T 127.0.0.1:6082 -t 120
   -S /cygdrive/c/cygwin64/etc/varnish/secret
   -s file,/cygdrive/c/cygwin64/var/varnish/varnish_storage.bin,2G
   -F"
2
  • Nevertheless think about using an alternative cache, if windows is used as os: e.g. apache mod_cache, squid – Matthias M Jan 16 '17 at 8:45
  • Awesome example, really helped me getting started thanks! – Don Omondi Apr 21 '17 at 4:28
2

Varnish heavyly uses linux kernel modern abilities...using Cygwin could work but it will be a hell to compile and maintain.

Install Varnish on a Fedora VM and focus on your devs instead of dirty hacks ;o)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.