aboutsummaryrefslogtreecommitdiff
path: root/www/varnish
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2009-10-13 18:51:10 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2009-10-13 18:51:10 +0000
commit7032b99a2848b30923f836fac79a5ae30ad26f46 (patch)
tree68b2a2d6e962af43c22c96f6a40f38309577eafc /www/varnish
parent5a73fe80ae576f3faef46f9f9c8a71de419a2d3f (diff)
downloadports-7032b99a2848b30923f836fac79a5ae30ad26f46.tar.gz
ports-7032b99a2848b30923f836fac79a5ae30ad26f46.zip
Notes
Diffstat (limited to 'www/varnish')
-rw-r--r--www/varnish/Makefile6
-rw-r--r--www/varnish/files/pkg-message.in18
-rw-r--r--www/varnish/files/varnishd.in68
-rw-r--r--www/varnish/files/varnishlog.in34
-rw-r--r--www/varnish/files/varnishncsa.in34
5 files changed, 116 insertions, 44 deletions
diff --git a/www/varnish/Makefile b/www/varnish/Makefile
index 861a622d8bca..da0dfc153ba3 100644
--- a/www/varnish/Makefile
+++ b/www/varnish/Makefile
@@ -7,6 +7,7 @@
PORTNAME= varnish
PORTVERSION= 2.0.4
+PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= SF
@@ -14,6 +15,7 @@ MAINTAINER= des@FreeBSD.org
COMMENT= The Varnish high-performance HTTP accelerator
GNU_CONFIGURE= yes
+USE_GMAKE= yes
CONFIGURE_ARGS= --localstatedir=${PREFIX}
USE_LDCONFIG= yes
@@ -22,6 +24,7 @@ MAN1= varnishadm.1 varnishd.1 varnishhist.1 varnishlog.1 \
varnishtop.1
MAN7= vcl.7
USE_RC_SUBR= varnishd varnishlog varnishncsa
+SUB_FILES= pkg-message
.include <bsd.port.pre.mk>
@@ -33,4 +36,7 @@ post-patch:
@${REINPLACE_CMD} -e 's|\$$(libdir)/pkgconfig|\$$(prefix)/libdata/pkgconfig|' \
${WRKSRC}/Makefile.in
+post-install:
+ @${CAT} ${PKGMESSAGE}
+
.include <bsd.port.post.mk>
diff --git a/www/varnish/files/pkg-message.in b/www/varnish/files/pkg-message.in
new file mode 100644
index 000000000000..efba6a71ae4a
--- /dev/null
+++ b/www/varnish/files/pkg-message.in
@@ -0,0 +1,18 @@
+QUICK-START GUIDE
+
+It's two in the morning and someone posted a link to your website on
+slashdot. Don't panic, it takes only a minute to set up Varnish in
+front of your web server:
+
+1) Install Varnish
+2) Reconfigure your web server to listen on localhost:8080
+3) echo 'varnishd_enable="YES"' >>/etc/rc.conf
+4) %%PREFIX%%/etc/rc.d/varnishd
+
+Refer to the documentation for more advanced configuration.
+
+NOTE TO USERS UPGRADING FROM AN OLDER VERSION OF VARNISH:
+
+Several rc variables have been renamed and / or have new default
+values. Refer to the comments in the rc.d scripts for a detailed
+description of these variables.
diff --git a/www/varnish/files/varnishd.in b/www/varnish/files/varnishd.in
index 90195b126d5e..dab68e6c6217 100644
--- a/www/varnish/files/varnishd.in
+++ b/www/varnish/files/varnishd.in
@@ -8,45 +8,73 @@
# KEYWORD: shutdown
#
-# Add the following lines to /etc/rc.conf to enable varnishd:
+# Add the following line to /etc/rc.conf to enable varnishd:
#
-#varnishd_enable="YES"
+# varnishd_enable="YES"
#
# Configuration variables and their default values:
#
-#varnishd_listen=":6081"
-#varnishd_config="%%PREFIX%%/etc/varnish/default.vcl"
-#varnishd_telnet="localhost:6082"
-#varnishd_storage="file,/tmp,50%"
-#varnishd_user="www"
-#varnishd_group="www"
-#varnishd_flags="-P ${pidfile} -a ${varnishd_listen} -f ${varnishd_config} -T ${varnishd_telnet} -s ${varnishd_storage} -u ${varnishd_user} -g ${varnishd_group}"
+# varnishd_pidfile - full path to the PID file.
+# default: "/var/run/varnishd.pid"
+#
+# varnishd_listen - address and port at which varnishd will listen for
+# client requests.
+# default: ":80"
+#
+# varnishd_admin - address and port at which varnishd will listen for
+# administrative commands.
+# default: "localhost:81"
+#
+# varnishd_backend - address of the backend server.
+# default: "localhost:8080"
+#
+# varnishd_config - name of the varnishd config file.
+# default: unset.
+#
+# varnishd_storage - storage method and parameters.
+# default: "file,/tmp,50%"
+#
+# varnishd_user - unprivileged user for the child process.
+# default: "www"
+#
+# varnishd_group - unprivileged group for the child process.
+# default: "www"
+#
+# varnishd_flags - complete command line arguments.
+# default if varnishd_config is unset: "-P ${varnishd_pidfile} -a ${varnishd_listen} -T ${varnishd_admin} -b ${varnishd_backend} -s ${varnishd_storage} -u ${varnishd_user} -g ${varnishd_group}"
+# default if varnishd_config is set: "-P ${varnishd_pidfile} -a ${varnishd_listen} -T ${varnishd_admin} -f ${varnishd_config} -s ${varnishd_storage} -u ${varnishd_user} -g ${varnishd_group}"
#
# See varnishd(1) for a detailed overview of command-line options.
#
. %%RC_SUBR%%
-name=varnishd
+name="varnishd"
rcvar=`set_rcvar`
-command="%%PREFIX%%/sbin/varnishd"
-pidfile="/var/run/${name}.pid"
+command="%%PREFIX%%/sbin/${name}"
# read configuration and set defaults
load_rc_config ${name}
-: ${varnishd_enable="NO"}
-: ${varnishd_listen=":6081"}
-: ${varnishd_config="%%PREFIX%%/etc/varnish/default.vcl"}
-: ${varnishd_telnet="localhost:6082"}
-: ${varnishd_storage="file,/tmp,50%"}
-: ${varnishd_user="www"}
-: ${varnishd_group="www"}
-: ${varnishd_flags="-P ${pidfile} -a ${varnishd_listen} -f ${varnishd_config} -T ${varnishd_telnet} -s ${varnishd_storage} -u ${varnishd_user} -g ${varnishd_group}"}
+: ${varnishd_enable:="NO"}
+: ${varnishd_pidfile:="/var/run/${name}.pid"}
+: ${varnishd_listen:=":80"}
+: ${varnishd_admin:="localhost:81"}
+: ${varnishd_backend:="localhost:8080"}
+: ${varnishd_config:=""}
+: ${varnishd_storage:="file,/tmp,50%"}
+: ${varnishd_user:="www"}
+: ${varnishd_group:="www"}
+if [ -n "${varnishd_config}" ] ; then
+ : ${varnishd_flags:="-P ${varnishd_pidfile} -a ${varnishd_listen} -T ${varnishd_admin} -f ${varnishd_config} -s ${varnishd_storage} -u ${varnishd_user} -g ${varnishd_group}"}
+else
+ : ${varnishd_flags:="-P ${varnishd_pidfile} -a ${varnishd_listen} -T ${varnishd_admin} -b ${varnishd_backend} -s ${varnishd_storage} -u ${varnishd_user} -g ${varnishd_group}"}
+fi
# If we leave these set, rc.subr will su to them before starting
# varnishd, which is not what we want.
unset varnishd_user
unset varnishd_group
+pidfile="${varnishd_pidfile}"
run_rc_command "$1"
diff --git a/www/varnish/files/varnishlog.in b/www/varnish/files/varnishlog.in
index 7d07528e7b52..dbd6a229c1b3 100644
--- a/www/varnish/files/varnishlog.in
+++ b/www/varnish/files/varnishlog.in
@@ -8,32 +8,42 @@
# KEYWORD: shutdown
#
-# Add the following lines to /etc/rc.conf to enable varnishlog:
+# Add the following line to /etc/rc.conf to enable varnishlog:
#
-#varnishlog_enable="YES"
+# varnishlog_enable="YES"
#
# Configuration variables and their default values:
#
-#varnishlog_file=${varnishlog_file:-"/var/log/varnish.log"}
-#varnishlog_flags=${varnishlog_flags:-"-D -P ${pidfile} -a -w ${varnishlog_file}"}
+# varnishlog_pidfile - full path to the PID file.
+# default: "/var/run/varnishlog.pid"
+#
+# varnishlog_file - full path to the log file.
+# default: "/var/log/varnish.log"
+#
+# varnishlog_flags - command line arguments.
+# default: "-D -P ${varnishlog_pidfile} -a -w ${varnishlog_file}"
+#
+# Add the following line to /etc/newsyslog.conf to rotate the log file
+# once a day:
+#
+# /var/log/varnish.log 640 7 * @T00 JB /var/run/varnishlog.pid
#
# See varnishlog(1) for a detailed overview of command-line options.
#
. %%RC_SUBR%%
-name=varnishlog
+name="varnishlog"
rcvar=`set_rcvar`
-command="%%PREFIX%%/bin/varnishlog"
-pidfile="/var/run/${name}.pid"
+command="%%PREFIX%%/bin/${name}"
# read configuration and set defaults
load_rc_config ${name}
-: ${varnishlog_enable="NO"}
-: ${varnishlog_file="/var/log/varnish.log"}
-: ${varnishlog_flags="-P ${pidfile} -D -a -w ${varnishlog_file}"}
-
-load_rc_config ${name}
+: ${varnishlog_enable:="NO"}
+: ${varnishlog_pidfile:="/var/run/${name}.pid"}
+: ${varnishlog_file:="/var/log/varnish.log"}
+: ${varnishlog_flags:="-P ${varnishlog_pidfile} -D -a -w ${varnishlog_file}"}
+pidfile=${varnishlog_pidfile}
run_rc_command "$1"
diff --git a/www/varnish/files/varnishncsa.in b/www/varnish/files/varnishncsa.in
index 46b113f50e4c..75a6d2449a88 100644
--- a/www/varnish/files/varnishncsa.in
+++ b/www/varnish/files/varnishncsa.in
@@ -8,32 +8,42 @@
# KEYWORD: shutdown
#
-# Add the following lines to /etc/rc.conf to enable varnishncsa:
+# Add the following line to /etc/rc.conf to enable varnishncsa:
#
-#varnishncsa_enable="YES"
+# varnishncsa_enable="YES"
#
# Configuration variables and their default values:
#
-#varnishncsa_file=${varnishncsa_file:-"/var/log/varnish-ncsa.log"}
-#varnishncsa_flags=${varnishncsa_flags:-"-D -P ${pidfile} -a -w ${varnishncsa_file}"}
+# varnishncsa_pidfile - full path to the PID file.
+# default: "/var/run/varnishncsa.pid"
+#
+# varnishncsa_file - full path to the log file.
+# default: "/var/log/varnishncsa.log"
+#
+# varnishncsa_flags - command line arguments.
+# default: "-D -P ${varnishncsa_pidfile} -a -c -w ${varnishncsa_file}"
+#
+# Add the following line to /etc/newsyslog.conf to rotate the log file
+# once a day:
+#
+# /var/log/varnishncsa.log 640 7 * @T00 JB /var/run/varnishncsa.pid
#
# See varnishncsa(1) for a detailed overview of command-line options.
#
. %%RC_SUBR%%
-name=varnishncsa
+name="varnishncsa"
rcvar=`set_rcvar`
-command="%%PREFIX%%/bin/varnishncsa"
-pidfile="/var/run/${name}.pid"
+command="%%PREFIX%%/bin/${name}"
# read configuration and set defaults
load_rc_config ${name}
-: ${varnishncsa_enable="NO"}
-: ${varnishncsa_file="/var/log/varnish-ncsa.log"}
-: ${varnishncsa_flags="-P ${pidfile} -D -a -w ${varnishncsa_file}"}
-
-load_rc_config ${name}
+: ${varnishncsa_enable:="NO"}
+: ${varnishncsa_pidfile:="/var/run/${name}.pid"}
+: ${varnishncsa_file:="/var/log/${name}.log"}
+: ${varnishncsa_flags:="-P ${varnishncsa_pidfile} -D -a -c -w ${varnishncsa_file}"}
+pidfile=${varnishncsa_pidfile}
run_rc_command "$1"