Mailing List Archive

r1150 - trunk/varnish-cache/debian
Author: bahner
Date: 2006-10-12 18:56:54 +0200 (Thu, 12 Oct 2006)
New Revision: 1150

Added:
trunk/varnish-cache/debian/README.Debian
trunk/varnish-cache/debian/varnish.default
trunk/varnish-cache/debian/varnish.init
trunk/varnish-cache/debian/vcl.conf
Modified:
trunk/varnish-cache/debian/TODO
trunk/varnish-cache/debian/changelog
trunk/varnish-cache/debian/control
trunk/varnish-cache/debian/dirs
trunk/varnish-cache/debian/rules
Log:
Added init-scripts and configuration files for Debian.


Added: trunk/varnish-cache/debian/README.Debian
===================================================================
--- trunk/varnish-cache/debian/README.Debian 2006-10-10 13:36:11 UTC (rev 1149)
+++ trunk/varnish-cache/debian/README.Debian 2006-10-12 16:56:54 UTC (rev 1150)
@@ -0,0 +1,25 @@
+GCC
+===
+Varnish requires a GCC-compiler compatible with the compiler used to
+build varnish with. This means GCC 4.1 on a standard Debian 4.0 system.
+
+Io. to be able to backport varnish however, I will remove the
+dependency on version 4.1 of the compiler and just require gcc, as
+varnish should work fine with GCC 3.3 and above.
+
+
+Standard ports
+==============
+
+I have configured varnish to simply put up an accelerator on port 6081
+pointing request at the local webserver. Varnish can then be
+administered via port 6082. You probably want to change these ;)
+
+Of course to gain actual value from installing varnish, you want to move
+varnishes listening port to port 80, and your webserver to 8080 or
+something.
+
+By setting varnish on port 6081 by default you will be able to take it
+for a spin right-out-of-the-box(tm).
+
+2006-10-12 Lars Bahner <bahner at debian.org>

Modified: trunk/varnish-cache/debian/TODO
===================================================================
--- trunk/varnish-cache/debian/TODO 2006-10-10 13:36:11 UTC (rev 1149)
+++ trunk/varnish-cache/debian/TODO 2006-10-12 16:56:54 UTC (rev 1150)
@@ -1 +1 @@
-Init-scripts and config files are missing.
+dd the backing file, if wanted.

Modified: trunk/varnish-cache/debian/changelog
===================================================================
--- trunk/varnish-cache/debian/changelog 2006-10-10 13:36:11 UTC (rev 1149)
+++ trunk/varnish-cache/debian/changelog 2006-10-12 16:56:54 UTC (rev 1150)
@@ -1,3 +1,11 @@
+varnish (1.0.2-1~svn20061012) unstable; urgency=low
+
+ * Added README for Debian
+ * svn-based source
+ * Added target to create configure to build from pristine source
+
+ -- Lars Bahner <bahner at linpro.no> Thu, 12 Oct 2006 15:42:04 +0200
+
varnish (1.0.1-3) unstable; urgency=low

* Bumped automake dependency to automake1.9

Modified: trunk/varnish-cache/debian/control
===================================================================
--- trunk/varnish-cache/debian/control 2006-10-10 13:36:11 UTC (rev 1149)
+++ trunk/varnish-cache/debian/control 2006-10-12 16:56:54 UTC (rev 1150)
@@ -3,7 +3,7 @@
Priority: optional
Maintainer: Stig Sandbeck Mathiesen <ssm at debian.org>
Uploaders: Lars Bahner <bahner at debian.org>
-Build-Depends: debhelper (>= 5), autotools-dev, automake1.9, libtool, autoconf, gcc (>= 4.1)
+Build-Depends: debhelper (>= 5), autotools-dev, automake1.9, libtool, autoconf, gcc
Standards-Version: 3.7.2

Package: varnish

Modified: trunk/varnish-cache/debian/dirs
===================================================================
--- trunk/varnish-cache/debian/dirs 2006-10-10 13:36:11 UTC (rev 1149)
+++ trunk/varnish-cache/debian/dirs 2006-10-12 16:56:54 UTC (rev 1150)
@@ -1,2 +1,6 @@
+etc/varnish
usr/bin
+usr/lib
usr/sbin
+var/log
+var/spool/varnish

Modified: trunk/varnish-cache/debian/rules
===================================================================
--- trunk/varnish-cache/debian/rules 2006-10-10 13:36:11 UTC (rev 1149)
+++ trunk/varnish-cache/debian/rules 2006-10-12 16:56:54 UTC (rev 1150)
@@ -24,9 +24,14 @@
CFLAGS += -O2
endif

+configure:
+ ./autogen.sh
+
config.status: configure
dh_testdir
# The boilerplate linker flags won't allow varnish to compile :(
+ # There are circular dependencies in the varnish libraries, but
+ # the core developers have OK'ed that we don't check.
./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)"


@@ -36,7 +41,6 @@
dh_testdir

$(MAKE)
- #docbook-to-man debian/varnish.sgml > varnish.1

touch $@

@@ -45,7 +49,6 @@
dh_testroot
rm -f build-stamp

- # Add here commands to clean up after the build process.
-$(MAKE) distclean
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
cp -f /usr/share/misc/config.sub config.sub
@@ -63,8 +66,8 @@
dh_clean -k
dh_installdirs

- # Add here commands to install the package into debian/varnish.
$(MAKE) install DESTDIR=$(CURDIR)/debian/varnish
+ install -m 644 $(CURDIR)/debian/vcl.conf $(CURDIR)/debian/varnish/etc/varnish/


# Build architecture-independent files here.
@@ -77,7 +80,8 @@
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
-#FIXME dh_installinit
+ # Since varnish looses its cache on restart - we don't.
+ dh_installinit -r
dh_installman
dh_link
dh_strip

Added: trunk/varnish-cache/debian/varnish.default
===================================================================
--- trunk/varnish-cache/debian/varnish.default 2006-10-10 13:36:11 UTC (rev 1149)
+++ trunk/varnish-cache/debian/varnish.default 2006-10-12 16:56:54 UTC (rev 1150)
@@ -0,0 +1,44 @@
+# Configuration file for varnish
+
+
+# Main configuration file. You probably want to change it :)
+VARNISH_VCL_CONF=/etc/varnish/vcl.conf
+
+# Default address and port to bind to
+VARNISH_LISTEN_ADDRESS=0.0.0.0
+VARNISH_LISTEN_PORT=6081
+
+
+# Telnet admin interface listen address and port
+VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1
+VARNISH_ADMIN_LISTEN_PORT=6082
+
+
+# The minimum number of threads to start
+VARNISH_MIN_WORKER_THREADS=1
+
+
+# Maximum number of worker threads or INF for unlimited
+VARNISH_MAX_WORKER_THREADS=INF
+
+
+# Timeout value in seconds for threads to return
+VARNISH_WORKER_THREAD_TIMEOUT=10
+
+
+# Hash algorithm to be used
+VARNISH_HASHOPTION=classic
+
+
+# Maximum size of the backend storagefile in bytes
+VARNISH_BACKEND_STORAGE_SIZE=10240000
+VARNISH_BACKEND_STORAGE_FILE=/var/spool/varnish/varnish_storage.bin
+
+
+# Backend storage specification
+VARNISH_BACKEND_STORAGE="file,${VARNISH_BACKEND_STORAGE_FILE},${VARNISH_BACKEND_STORAGE_SIZE}"
+
+
+# Set default ttl in secounds
+VARNISH_TTL=120
+

Added: trunk/varnish-cache/debian/varnish.init
===================================================================
--- trunk/varnish-cache/debian/varnish.init 2006-10-10 13:36:11 UTC (rev 1149)
+++ trunk/varnish-cache/debian/varnish.init 2006-10-12 16:56:54 UTC (rev 1150)
@@ -0,0 +1,67 @@
+#! /bin/sh
+#
+# skeleton example file to build /etc/init.d/ scripts.
+# This file should be used to construct scripts for /etc/init.d.
+#
+# Written by Miquel van Smoorenburg <miquels at cistron.nl>.
+# Modified for Debian
+# by Ian Murdock <imurdock at gnu.ai.mit.edu>.
+#
+# Version: @(#)skeleton 1.9 26-Feb-2001 miquels at cistron.nl
+#
+
+NAME=varnish
+DESC="HTTPd accelerator"
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/varnishd
+
+test -x $DAEMON || exit 0
+
+# Include varnish defaults if available
+if [ -f /etc/default/varnish ] ; then
+ . /etc/default/varnish
+fi
+
+DAEMON_OPTS="-a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \
+ -h ${VARNISH_HASHOPTION} \
+ -f ${VARNISH_VCL_CONF} \
+ -T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \
+ -t ${VARNISH_TTL} \
+ -w ${VARNISH_MIN_WORKER_THREADS},${VARNISH_MAX_WORKER_THREADS},${VARNISH_WORKER_THREAD_TIMEOUT} \
+ -s ${VARNISH_BACKEND_STORAGE}"
+
+set -e
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC: "
+ start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
+ --exec $DAEMON -- $DAEMON_OPTS 2>&1 > /dev/null
+ echo "$NAME."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: "
+ pkill varnishd
+ echo "$NAME."
+ ;;
+ restart|force-reload)
+ #
+ # If the "reload" option is implemented, move the "force-reload"
+ # option to the "reload" entry above. If not, "force-reload" is
+ # just the same as "restart".
+ #
+ echo -n "Restarting $DESC: "
+ pkill varnishd
+ sleep 1
+ start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
+ --exec $DAEMON -- $DAEMON_OPTS 2>&1 > /dev/null
+ echo "$NAME."
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0

Added: trunk/varnish-cache/debian/vcl.conf
===================================================================
--- trunk/varnish-cache/debian/vcl.conf 2006-10-10 13:36:11 UTC (rev 1149)
+++ trunk/varnish-cache/debian/vcl.conf 2006-10-12 16:56:54 UTC (rev 1150)
@@ -0,0 +1,27 @@
+# This is a basic vcl.conf file for varnish.
+# Modifying this file should be where you store your modifications to
+# varnish. Settnigs here will override defaults.
+
+backend default {
+ set backend.host = "127.0.0.1";
+ set backend.port = "80";
+}
+
+sub vcl_recv {
+ if (req.request == "POST") {
+ pipe;
+ }
+
+ # force lookup even when cookies are present
+ if (req.request == "GET" && req.http.cookie) {
+ lookup;
+ }
+}
+
+sub vcl_fetch {
+ # force minimum ttl of 180 seconds
+ if (obj.ttl < 180s) {
+ set obj.ttl = 180s;
+ }
+}
+