diff -urNp varnish-1.0.4/bin/varnishd/cache_response.c varnish-1.0.4f/bin/varnishd/cache_response.c
--- varnish-1.0.4/bin/varnishd/cache_response.c	2007-05-20 19:38:16.000000000 +0200
+++ varnish-1.0.4f/bin/varnishd/cache_response.c	2007-05-31 15:20:43.000000000 +0200
@@ -128,30 +128,63 @@ RES_Error(struct sess *sp, int code, con
 	XXXAN(sb);
 
 	vsb_clear(sb);
-	vsb_printf(sb, "HTTP/1.1 %03d %s\r\n", code, msg);
+        vsb_printf(sb, "HTTP/1.1 %03d %s\r\n", code, msg);
 	TIM_format(sp->t_req.tv_sec, buf);
 	vsb_printf(sb, "Date: %s\r\n", buf);
 	vsb_cat(sb,
 		"Server: Varnish\r\n"
 		"Connection: close\r\n"
+		);
+	vsb_cat(sb,	
 		"Content-Type: text/html; charset=iso-8859-1\r\n"
 		"\r\n"
-		"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r\n"
-		"<HTML>\r\n"
-		"  <HEAD>\r\n");
-	vsb_printf(sb, "    <TITLE>%03d %s</TITLE>\r\n", code, msg);
-	vsb_cat(sb,
-		"  </HEAD>\r\n"
-		"  <BODY>\r\n");
-	vsb_printf(sb, "    <H1>Error %03d %s</H1>\r\n", code, msg);
-	vsb_printf(sb, "    <P>%s</P>\r\n", reason);
-	vsb_printf(sb, "    <H3>Guru Meditation:</H3>\r\n");
-	vsb_printf(sb, "    <P>XID: %u</P>\r\n", sp->xid);
-	vsb_cat(sb,
-		"    <I><A href=\"http://www.varnish-cache.org/\">Varnish</A></I>\r\n"
-		"  </BODY>\r\n"
-		"</HTML>\r\n");
+		);
+		
+	long  lFileLen;
+	FILE *input ;
+	char *cFile;
+	char fileName[100];
+	int i;
+	
+	i=sprintf(fileName,"%s/%d.html",errors_folder,code); 
+	if(input = fopen( fileName, "r"))
+	{
+		fseek(input, 0L, SEEK_END);  /* Position to end of file */
+  		lFileLen = ftell(input);     /* Get file length */
+	
+		rewind(input); /* Back to start of file */
+		cFile = calloc(lFileLen + 1, sizeof(char));
+       		fread(cFile, lFileLen, 1, input);
+        	fclose(input);
+		vsb_printf(sb, " %s\r\n",cFile);
+		vsb_printf(sb, "dsds %s\r\n",fileName);	
+		free(cFile);	
+	}
+	else
+	{
+		vsb_cat(sb,	
+			"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\r\n"
+			"<HTML>\r\n"
+			"  <HEAD>\r\n");
+ 
+		vsb_printf(sb, "    <TITLE>%03d %s</TITLE>\r\n", code, msg);
+	
+		vsb_cat(sb,
+			"  </HEAD>\r\n"
+			"  <BODY>\r\n");
+
+		vsb_printf(sb, "    <H1>Error %03d %s</H1>\r\n", code, msg);
+		vsb_printf(sb, "    <P>%s</P>\r\n", reason);
+		vsb_printf(sb, "    <H3>Guru Meditation:</H3>\r\n");
+		vsb_printf(sb, "    <P>XID: %u</P>\r\n", sp->xid);
+
+		vsb_cat(sb,
+			"    <I><A href=\"http://www.varnish-cache.org/\">Varnish</A></I>\r\n"
+			"  </BODY>\r\n"
+			"</HTML>\r\n");
+	}
 	vsb_finish(sb);
+	
 	WRK_Reset(sp->wrk, &sp->fd);
 	sp->wrk->acct.hdrbytes += WRK_Write(sp->wrk, vsb_data(sb), vsb_len(sb));
 	WRK_Flush(sp->wrk);
diff -urNp varnish-1.0.4/bin/varnishd/heritage.h varnish-1.0.4f/bin/varnishd/heritage.h
--- varnish-1.0.4/bin/varnishd/heritage.h	2007-05-20 19:38:16.000000000 +0200
+++ varnish-1.0.4f/bin/varnishd/heritage.h	2007-05-31 15:14:25.000000000 +0200
@@ -120,3 +120,5 @@ extern volatile struct params *params;
 extern struct heritage heritage;
 
 void child_main(void);
+
+char *errors_folder;
diff -urNp varnish-1.0.4/bin/varnishd/varnishd.c varnish-1.0.4f/bin/varnishd/varnishd.c
--- varnish-1.0.4/bin/varnishd/varnishd.c	2007-05-20 19:38:16.000000000 +0200
+++ varnish-1.0.4f/bin/varnishd/varnishd.c	2007-05-31 15:22:42.000000000 +0200
@@ -202,6 +202,8 @@ usage(void)
 	    "  -w min,max");
 	fprintf(stderr, "    %-28s # %s\n", "",
 	    "  -w min,max,timeout [default: -w1,1000,120]");
+	 fprintf(stderr, "    %-28s # %s\n",
+	    "-e path", "The folder where belong the error page (like 503.html)");   
 #if 0
 	-c clusterid@cluster_controller
 	-m memory_limit
@@ -441,7 +443,7 @@ main(int argc, char *argv[])
 	MCF_ParamInit(cli);
 	cli_check(cli);
 
-	while ((o = getopt(argc, argv, "a:b:Cdf:h:P:p:s:T:t:Vw:")) != -1)
+	while ((o = getopt(argc, argv, "a:b:Cdf:h:P:p:s:T:t:Vw:e:")) != -1)
 		switch (o) {
 		case 'a':
 			MCF_ParamSet(cli, "listen_address", optarg);
@@ -489,6 +491,9 @@ main(int argc, char *argv[])
 		case 'w':
 			tackle_warg(optarg);
 			break;
+		case 'e':
+			errors_folder = optarg;
+			break;
 		default:
 			usage();
 		}
diff -urNp varnish-1.0.4/config.h varnish-1.0.4f/config.h
--- varnish-1.0.4/config.h	2007-07-11 11:05:58.000000000 +0200
+++ varnish-1.0.4f/config.h	2007-05-31 15:37:30.000000000 +0200
@@ -141,13 +141,13 @@
 #define PACKAGE_NAME "Varnish"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "Varnish 1.0.4"
+#define PACKAGE_STRING "Varnish 1.0.4f"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "varnish"
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "1.0.4"
+#define PACKAGE_VERSION "1.0.4f"
 
 /* Define as the return type of signal handlers (`int' or `void'). */
 #define RETSIGTYPE void
@@ -162,7 +162,7 @@
 #define TIME_WITH_SYS_TIME 1
 
 /* Version number of package */
-#define VERSION "1.0.4"
+#define VERSION "1.0.4f"
 
 /* Enable GNU extensions on systems that have them.  */
 #ifndef _GNU_SOURCE
diff -urNp varnish-1.0.4/configure varnish-1.0.4f/configure
--- varnish-1.0.4/configure	2007-05-20 19:38:35.000000000 +0200
+++ varnish-1.0.4f/configure	2007-05-31 15:37:13.000000000 +0200
@@ -1,7 +1,7 @@
 #! /bin/sh
 # From configure.ac Id: configure.ac 1458 2007-05-20 17:38:15Z des .
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for Varnish 1.0.4.
+# Generated by GNU Autoconf 2.61 for Varnish 1.0.4f.
 #
 # Report bugs to <varnish-dev@projects.linpro.no>.
 #
@@ -731,8 +731,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='Varnish'
 PACKAGE_TARNAME='varnish'
-PACKAGE_VERSION='1.0.4'
-PACKAGE_STRING='Varnish 1.0.4'
+PACKAGE_VERSION='1.0.4f'
+PACKAGE_STRING='Varnish 1.0.4f'
 PACKAGE_BUGREPORT='varnish-dev@projects.linpro.no'
 
 ac_unique_file="include/varnishapi.h"
@@ -1402,7 +1402,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures Varnish 1.0.4 to adapt to many kinds of systems.
+\`configure' configures Varnish 1.0.4f to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1473,7 +1473,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of Varnish 1.0.4:";;
+     short | recursive ) echo "Configuration of Varnish 1.0.4f:";;
    esac
   cat <<\_ACEOF
 
@@ -1580,7 +1580,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-Varnish configure 1.0.4
+Varnish configure 1.0.4f
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1596,7 +1596,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by Varnish $as_me 1.0.4, which was
+It was created by Varnish $as_me 1.0.4f, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2423,7 +2423,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='varnish'
- VERSION='1.0.4'
+ VERSION='1.0.4f'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -23828,7 +23828,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by Varnish $as_me 1.0.4, which was
+This file was extended by Varnish $as_me 1.0.4f, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -23881,7 +23881,7 @@ Report bugs to <bug-autoconf@gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-Varnish config.status 1.0.4
+Varnish config.status 1.0.4f
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
diff -urNp varnish-1.0.4/configure.ac varnish-1.0.4f/configure.ac
--- varnish-1.0.4/configure.ac	2007-05-20 19:38:16.000000000 +0200
+++ varnish-1.0.4f/configure.ac	2007-05-31 15:36:41.000000000 +0200
@@ -3,7 +3,7 @@
 AC_PREREQ(2.59)
 AC_COPYRIGHT([Copyright (c) 2006 Linpro AS / Verdens Gang AS])
 AC_REVISION([$Id: configure.ac 1458 2007-05-20 17:38:15Z des $])
-AC_INIT([Varnish], [1.0.4], [varnish-dev@projects.linpro.no])
+AC_INIT([Varnish], [1.0.4f], [varnish-dev@projects.linpro.no])
 AC_CONFIG_SRCDIR(include/varnishapi.h)
 AM_CONFIG_HEADER(config.h)
 
diff -urNp varnish-1.0.4/etc/default/varnish varnish-1.0.4f/etc/default/varnish
--- varnish-1.0.4/etc/default/varnish	1970-01-01 01:00:00.000000000 +0100
+++ varnish-1.0.4f/etc/default/varnish	2007-05-31 15:41:30.000000000 +0200
@@ -0,0 +1,46 @@
+# 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=172.31.255.44
+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=2048
+
+
+# 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/lib/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=20
+
+# Set the default folder where belong the error html page
+VARNISH_ERRORS_FOLDER="/var/www/errors"
diff -urNp varnish-1.0.4/etc/init.d/varnish varnish-1.0.4f/etc/init.d/varnish
--- varnish-1.0.4/etc/init.d/varnish	1970-01-01 01:00:00.000000000 +0100
+++ varnish-1.0.4f/etc/init.d/varnish	2007-05-31 15:41:49.000000000 +0200
@@ -0,0 +1,83 @@
+#! /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
+#
+
+### BEGIN INIT INFO
+# Provides:          varnish
+# Required-Start:    $local_fs $network
+# Required-Stop:     $local_fs $network
+# Should-Start:      $remote_fs
+# Should-Stop:       $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start HTTPd accelerator
+# Description:       This script provides a server-side cache
+#                    to be run in front of a httpd and should
+#		     listen on port 80 on a properly configured
+#                    system
+### END INIT INFO
+
+NAME=varnish
+DESC="HTTPd accelerator"
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/local/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}	\
+		-e ${VARNISH_ERRORS_FOLDER}"
+
+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 -urNp varnish-1.0.4/include/varnishapi.h varnish-1.0.4f/include/varnishapi.h
--- varnish-1.0.4/include/varnishapi.h	2007-05-20 19:38:16.000000000 +0200
+++ varnish-1.0.4f/include/varnishapi.h	2007-05-31 15:11:39.000000000 +0200
@@ -76,3 +76,4 @@ int		 vlo_close(vlo_buffer_t *);
 int		 vut_open_lock(const char *, int, int, int);
 
 #endif
+
diff -urNp varnish-1.0.4/libtool varnish-1.0.4f/libtool
--- varnish-1.0.4/libtool	2007-07-11 11:05:50.000000000 +0200
+++ varnish-1.0.4f/libtool	2007-07-11 11:02:12.000000000 +0200
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # libtoolT - Provide generalized library-building support services.
-# Generated automatically by  (GNU varnish 1.0.4)
+# Generated automatically by  (GNU varnish 1.0.4f)
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
 #
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
