Commit c986f9b3 authored by Lars Bahner's avatar Lars Bahner

Added init-scripts and configuration files for Debian.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1150 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 17323a3d
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>
Init-scripts and config files are missing.
dd the backing file, if wanted.
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
......
......@@ -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
......
etc/varnish
usr/bin
usr/lib
usr/sbin
var/log
var/spool/varnish
......@@ -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
......
# 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
#! /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
# 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;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment