Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install Varnish-3.0.2 on OSX with homebrew
require 'formula'
class Varnish3 <Formula
url 'http://repo.varnish-cache.org/source/varnish-3.0.2.tar.gz'
homepage 'http://www.varnish-cache.org/'
md5 'c8eae0aabbe66b6daabdf3a1f58cd47a'
depends_on 'pkg-config' => :build
depends_on 'pcre' => :build
# needs
skip_clean :all
def install
# http://www.varnish-cache.org/trac/wiki/Installation
# system "./autogen.sh"
system "./configure", "--enable-debugging-symbols",
"--enable-developer-warnings",
"--enable-dependency-tracking",
"--disable-dependency-tracking",
"--prefix=#{prefix}",
"--localstatedir=#{var}"
system "make"
system "make install"
(var+'varnish3').mkpath
(prefix+'org.varnish-cache.varnishd.plist').write startup_plist
(prefix+'org.varnish-cache.varnishd.plist').chmod 0644
end
def startup_plist; <<-EOPLIST.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.varnish-cache.varnishd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/sbin/varnishd</string>
<string>-f</string>
<string>/path/to/varnish.vcl</string>
<string>-s</string>
<string>malloc,1G</string>
<string>-T</string>
<string>127.0.0.1:2000</string>
<string>-a</string>
<string>0.0.0.0:80</string>
</array>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/usr/local/sbin</string>
<key>StandardErrorPath</key>
<string>/var/log/varnish.log</string>
<key>StandardOutPath</key>
<string>/var/log/varnish.log</string>
</dict>
</plist>
EOPLIST
end
end
@wearethefoos

This comment has been minimized.

Copy link
Owner Author

@wearethefoos wearethefoos commented Feb 23, 2012

Install Varnish 3.0.2 on OSX with the following Brew command:

brew install https://raw.github.com/gist/1892226/5a2b9618880738a1f49be92efd07c64efed849ef/varnish3.rb

You might have to run

sudo brew link varnish3

To symlink the install.

@freen

This comment has been minimized.

Copy link

@freen freen commented Jun 30, 2014

New URL!
brew install https://gist.githubusercontent.com/foxycoder/1892226/raw/446edacada4a280180f8a2a8bb0729f0b3c129bc/varnish3.rb

@klein0r

This comment has been minimized.

Copy link

@klein0r klein0r commented Jun 12, 2015

Thank you! Brew complained about an unsupported md5 checksum. So I've changed your script to sha256 (see fork):

https://gist.githubusercontent.com/klein0r/fbfb74f79c00e8092296/raw/479883f587344b8e2aa2a53336987c2d9f653703/varnish3.rb

@bkeroackdsc

This comment has been minimized.

Copy link

@bkeroackdsc bkeroackdsc commented Jul 6, 2017

md5 is now unsupported, so you need to comment it out or replace it with sha256.

Also brew link doesn't symlink varnishd for some reason.

@dhruvbalhara

This comment has been minimized.

Copy link

@dhruvbalhara dhruvbalhara commented Nov 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment