]> err.no Git - varnish/commitdiff
Added init-scripts and configuration files for Debian.
authorbahner <bahner@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 12 Oct 2006 16:56:54 +0000 (16:56 +0000)
committerbahner <bahner@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 12 Oct 2006 16:56:54 +0000 (16:56 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1150 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/debian/README.Debian [new file with mode: 0644]
varnish-cache/debian/TODO
varnish-cache/debian/changelog
varnish-cache/debian/control
varnish-cache/debian/dirs
varnish-cache/debian/rules
varnish-cache/debian/varnish.default [new file with mode: 0644]
varnish-cache/debian/varnish.init [new file with mode: 0644]
varnish-cache/debian/vcl.conf [new file with mode: 0644]

diff --git a/varnish-cache/debian/README.Debian b/varnish-cache/debian/README.Debian
new file mode 100644 (file)
index 0000000..b2e8ab7
--- /dev/null
@@ -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@debian.org>
index ff0094c76dfc78cbfd3477d8e295a2f849900c1c..f3fd3265b5442374229567132dd3642e45160dd8 100644 (file)
@@ -1 +1 @@
-Init-scripts and config files are missing.
+dd the backing file, if wanted.
index 9cf7fe19fc4ac57917898e8474422aa5b5156950..b74f0f6523a0a36a272bb8083743ae7e9ad0ac61 100644 (file)
@@ -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@linpro.no>  Thu, 12 Oct 2006 15:42:04 +0200
+
 varnish (1.0.1-3) unstable; urgency=low
 
   * Bumped automake dependency to automake1.9
index 26235b1c48d2934aca2cd36030f0e7c3d2f59c18..2f9c20a96d64f89ee642e207facdec3fca2b9735 100644 (file)
@@ -3,7 +3,7 @@ Section: web
 Priority: optional
 Maintainer: Stig Sandbeck Mathiesen <ssm@debian.org>
 Uploaders: Lars Bahner <bahner@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
index ca882bbb78588982a650ff2685c36fe51ae99ae3..117bc70bcb513b5798fd685cbf9dfb6a88447284 100644 (file)
@@ -1,2 +1,6 @@
+etc/varnish
 usr/bin
+usr/lib
 usr/sbin
+var/log
+var/spool/varnish
index 15092a7f6bcd0a487f24fe65e9e006dee8b190af..ba19fe4c55403e7bb08de570df83b1b231d115d1 100755 (executable)
@@ -24,9 +24,14 @@ else
        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 @@ build-stamp:  config.status
        dh_testdir
 
        $(MAKE)
-       #docbook-to-man debian/varnish.sgml > varnish.1
 
        touch $@
 
@@ -45,7 +49,6 @@ clean:
        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 @@ install: build
        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 @@ binary-arch: build install
        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
diff --git a/varnish-cache/debian/varnish.default b/varnish-cache/debian/varnish.default
new file mode 100644 (file)
index 0000000..fddb49e
--- /dev/null
@@ -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
+
diff --git a/varnish-cache/debian/varnish.init b/varnish-cache/debian/varnish.init
new file mode 100644 (file)
index 0000000..ee7b8bc
--- /dev/null
@@ -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@cistron.nl>.
+#               Modified for Debian 
+#               by Ian Murdock <imurdock@gnu.ai.mit.edu>.
+#
+# Version:      @(#)skeleton  1.9  26-Feb-2001  miquels@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
diff --git a/varnish-cache/debian/vcl.conf b/varnish-cache/debian/vcl.conf
new file mode 100644 (file)
index 0000000..495f176
--- /dev/null
@@ -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;
+        }
+}
+