error page not delivered

Ramon A Hermon rhermon at chicagosuntimes.com
Mon Feb 18 08:18:51 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dag-Erling Smørgrav wrote:
| Ramon A Hermon <rhermon at chicagosuntimes.com> writes:
|>> I am unable to get varnish to deliver the customized error page when
|>> requesting a non-existent url.
|> I should correct the above statement to "I get a blank page when
|> requesting a non-existent directory or html file in the url".
|
| Apparently, you have two caches: one that works correctly and one that
| doesn't.
|
| Do they both run the same version and configuration?
Only one version is installed with 2 init scripts.

I am not sure how you can tell that I have 2 caches running, if by cache
you mean varnish instances then yes. However I get the same result if I
shut one down.


I run 2 instances in the same physical server one located in
/var/varnish1 and the other in /var/varnish2. I also have 2 other
servers in "hot spare mode" hiding behind the hardware loadbalancer
using the same configuration, but no request should hit those unless my
primary goes down.

$ ps -ef |grep varn
root     29695     1  0 Feb17 ?        00:00:00 /usr/local/sbin/varnishd
- -a :6083 -T localhost:6084 -f /etc/varnish2/default.vcl -n /var/varnish2
- -s file,/var/varnish2/varnish_storage.bin,1G -P /var/run/varnish2.pid
nobody   29696 29695  0 Feb17 ?        00:00:00 /usr/local/sbin/varnishd
- -a :6083 -T localhost:6084 -f /etc/varnish2/default.vcl -n /var/varnish2
- -s file,/var/varnish2/varnish_storage.bin,1G -P /var/run/varnish2.pid
root     32246     1  0 00:20 ?        00:00:00 /usr/local/sbin/varnishd
- -a :6081 -T localhost:6082 -f /etc/varnish1/default.vcl -n /var/varnish1
- -s file,/var/varnish1/varnish_storage.bin,3G -P /var/run/varnish1.pid
nobody   32247 32246  0 00:20 ?        00:00:02 /usr/local/sbin/varnishd
- -a :6081 -T localhost:6082 -f /etc/varnish1/default.vcl -n /var/varnish1
- -s file,/var/varnish1/varnish_storage.bin,3G -P /var/run/varnish1.pid


$ diff /etc/init.d/varnish1 /etc/init.d/varnish2
15,17c15,17
< PROCNAME=varnish1
< PIDFILE=/var/run/varnish1.pid
< LOCKFILE=/var/lock/subsys/varnish1
- ---
| PROCNAME=varnish2
| PIDFILE=/var/run/varnish2.pid
| LOCKFILE=/var/lock/subsys/varnish2
20c20
< . /etc/sysconfig/varnish1
- ---
| . /etc/sysconfig/varnish2
25c25
< mkdir -p /var/run/varnish1 2>/dev/null
- ---
| mkdir -p /var/run/varnish2 2>/dev/null
33c33
<       echo -n "Starting varnish1 HTTP accelerator: "
- ---
|       echo -n "Starting varnish2 HTTP accelerator: "
39c39
<           echo -n "Please put configuration options in
/etc/sysconfig/varnish1"
- ---
|           echo -n "Please put configuration options in
/etc/sysconfig/varnish2"
57c57
<       echo -n "Stopping varnish1 HTTP accelerator: "
- ---
|       echo -n "Stopping varnish2 HTTP accelerator: "

$ diff /etc/sysconfig/varnish1 /etc/sysconfig/varnish2
36,40c36,40
< DAEMON_OPTS="-a :6081 \
<              -T localhost:6082 \
<              -f /etc/varnish1/default.vcl \
<              -n /var/varnish1 \
<              -s file,/var/varnish1/varnish_storage.bin,3G"
- ---
| DAEMON_OPTS="-a :6083 \
|              -T localhost:6084 \
|              -f /etc/varnish2/default.vcl \
|              -n /var/varnish2 \
|              -s file,/var/varnish2/varnish_storage.bin,1G"

$ diff /etc/varnish1/default.vcl /etc/varnish2/default.vcl
9c9
<         set backend.host = "192.168.30.61";
- ---
|         set backend.host = "192.168.30.56";

$ grep -v ^\# /etc/varnish1/default.vcl|grep .
backend default {
~        set backend.host = "192.168.30.61";
~        set backend.port = "80";
}
sub vcl_recv {
~             if (req.request == "GET" && req.http.cookie) {
~                 lookup;
~             }
~         }
~         sub vcl_fetch {
~             if (obj.http.Set-Cookie) {
~                remove obj.http.Set-Cookie;
~             }
~         }


Regards,
Ramon A Hermon
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHuTFb2nBs00uoHhwRAgHXAJ4gGNr1iTnB/h2scz+3JpSp+TVhRACgm+bQ
sV/y9yAK1QG0MmWhpIby+ko=
=Mb+R
-----END PGP SIGNATURE-----




More information about the varnish-misc mailing list