diff --git a/CHANGELOG b/CHANGELOG index 47512a73c..59731cc1a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,16 @@ ChangeLog : =========== +2003/05/06 : 1.1.21 + - changed the debug output format so that it now includes the session unique + ID followed by the instance name at the beginning of each line. + - in debug mode, accept now shows the client's IP and port. + - added one 3 small debugging scripts to search and pretty print debug output + - changed the default health check request to "OPTIONS /" instead of + "OPTIONS *" since not all servers implement the later one. + - "option httpchk" now accepts an optional parameter allowing the user to + specify and URI other than '/' during health-checks. + 2003/04/21 : 1.1.20 - fixed two problems with time-outs, one where a server would be logged as timed out during transfer that take longer to complete than the fixed diff --git a/Makefile b/Makefile index 361642061..c3cb104d8 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ REGEX=libc #REGEX=pcre # This is the directory hosting include/pcre.h and lib/libpcre.* when REGEX=pcre -PCREDIR := $(shell pcre-config --prefix 2>/dev/null) +PCREDIR := $(shell pcre-config --prefix 2>/dev/null || :) #PCREDIR=/usr/local # This is for Linux 2.4 with netfilter diff --git a/doc/haproxy.txt b/doc/haproxy.txt index aea6d0cb7..c20c2447f 100644 --- a/doc/haproxy.txt +++ b/doc/haproxy.txt @@ -1,9 +1,9 @@ H A - P r o x y --------------- - version 1.1.18 + version 1.1.21 willy tarreau - 2003/04/06 + 2003/05/06 ================ | Introduction | @@ -588,14 +588,18 @@ Le mode par d certains cas de pannes, des serveurs peuvent continuer à accepter les connexions sans les traiter. Depuis la version 1.1.16, haproxy est en mesure d'envoyer des requêtes HTTP courtes et très peu coûteuses. Les versions 1.1.16 et 1.1.17 -utilisent "OPTIONS / HTTP/1.0". Depuis la version 1.1.18, les requêtes ont été -changées en "OPTIONS * HTTP/1.0" pour des raisons de contrôle d'accès aux -ressources. Elles présentent l'avantage d'être facilement extractibles des logs, -et de ne pas induire d'accès aux fichiers côté serveur. Seules les réponses 2xx -et 3xx sont considérées valides, les autres (y compris non-réponses) aboutissent -à un échec. Le temps maximal imparti pour une réponse est égal à l'intervalle -entre deux tests (paramètre "inter"). Pour activer ce mode, spécifier l'option -"httpchk". +utilisent "OPTIONS / HTTP/1.0". Dans les versions 1.1.18 à 1.1.20, les requêtes +ont été changées en "OPTIONS * HTTP/1.0" pour des raisons de contrôle d'accès aux +ressources. Cependant, cette requête documentée dans la RFC2068 n'est pas +comprise par tous les serveurs. Donc à partir de la version 1.1.21, la requête +par défaut est revenue à "OPTIONS / HTTP/1.0", mais il est possible de +paramétrer la partie URI. Les requêtes OPTIONS présentent l'avantage d'être +facilement extractibles des logs, et de ne pas induire d'accès aux fichiers côté +serveur. Seules les réponses 2xx et 3xx sont considérées valides, les autres (y +compris non-réponses) aboutissent à un échec. Le temps maximal imparti pour une +réponse est égal à l'intervalle entre deux tests (paramètre "inter"). Pour +activer ce mode, spécifier l'option "httpchk", éventuellement suivie d'une +URI. Voir les exemples ci-après. Depuis la version 1.1.17, il est possible de définir des serveurs de secours, utilisés uniquement lorsqu'aucun des autres serveurs ne fonctionne. Pour cela, @@ -626,7 +630,7 @@ Exemples : server web1 192.168.1.1:80 cookie server01 check server web2 192.168.1.2:80 cookie server02 check inter 500 rise 1 fall 2 -# même que précédemment avec surveillance HTTP +# même que précédemment avec surveillance HTTP par 'OPTIONS / HTTP/1.0' listen http_proxy 0.0.0.0:80 mode http cookie SERVERID @@ -635,6 +639,15 @@ Exemples : server web1 192.168.1.1:80 cookie server01 check server web2 192.168.1.2:80 cookie server02 check inter 500 rise 1 fall 2 +# même que précédemment avec surveillance HTTP par 'OPTIONS /index.html HTTP/1.0' + listen http_proxy 0.0.0.0:80 + mode http + cookie SERVERID + balance roundrobin + option httpchk /index.html + server web1 192.168.1.1:80 cookie server01 check + server web2 192.168.1.2:80 cookie server02 check inter 500 rise 1 fall 2 + # Insertion automatique de cookie dans la réponse du serveur, et suppression # automatique dans la requête, tout en indiquant aux caches de ne pas garder # ce cookie. diff --git a/examples/debug2ansi b/examples/debug2ansi new file mode 100644 index 000000000..6ba345d54 --- /dev/null +++ b/examples/debug2ansi @@ -0,0 +1,2 @@ +#!/bin/sh +tr -d '\015' | sed -e 's,\(: Cookie:.*$\),'$'\e''\[35m\1'$'\e''\[0m,gi' -e 's,\(: Set-Cookie:.*$\),'$'\e''\[31m\1'$'\e''\[0m,gi' -e 's,\(^[^:]*:[^:]*srvhdr.*\)$,'$'\e''\[32m\1'$'\e''\[0m,i' -e 's,\(^[^:]*:[^:]*clihdr.*\)$,'$'\e''\[34m\1'$'\e''\[0m,i' diff --git a/examples/debug2html b/examples/debug2html new file mode 100644 index 000000000..866b76184 --- /dev/null +++ b/examples/debug2html @@ -0,0 +1,2 @@ +#!/bin/sh +(echo '
'; tr -d '\015' | sed -e 's,\(: Cookie:.*$\),\1,gi' -e 's,\(: Set-Cookie:.*$\),\1,gi' -e 's,\(^[^:]*:[^:]*srvhdr.*\)$,\1,i' -e 's,\(^[^:]*:[^:]*clihdr.*\)$,\1,i' -e 's,\(^.*\)$,\1,' ; echo '') diff --git a/examples/debugfind b/examples/debugfind new file mode 100644 index 000000000..88e97609a --- /dev/null +++ b/examples/debugfind @@ -0,0 +1,8 @@ +#!/bin/bash +if [ $# -lt 2 ]; then + echo "Usage: $0 regex debug_file > extracted_file" + exit 1 +fi +word=$1 +file=$2 +exec grep $(for i in $(grep $word $file |cut -f1 -d: | sort -u ) ; do echo -n '\('$i':\)\|'; done; echo '^$') $file diff --git a/examples/haproxy-1.1.12-flx.1.pkg b/examples/haproxy-1.1.12-flx.1.pkg deleted file mode 100644 index 49ea3f695..000000000 --- a/examples/haproxy-1.1.12-flx.1.pkg +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -function do_compile { - $FLXMAKE COPTS="-march=$arch -mcpu=$cpu -O2 -mpreferred-stack-boundary=2 -malign-loops=0 -malign-jumps=0 -DNETFILTER -DTRANSPARENT" -} - -function do_prepack { - mkdir -p $ROOTDIR/sbin/init.d ; cp init.d/haproxy $ROOTDIR/sbin/init.d - mkdir -p $ROOTDIR/usr/sbin ; cp haproxy $ROOTDIR/usr/sbin - mkdir -p $ROOTDIR/usr/share/examples/$PKGRADIX-$PKGVER/etc - cp examples/haproxy.cfg $ROOTDIR/usr/share/examples/$PKGRADIX-$PKGVER/etc/haproxy.cfg - cp examples/rc.highsock $ROOTDIR/usr/share/examples/$PKGRADIX-$PKGVER/etc/rc.highsock - cp examples/config.rc.haproxy $ROOTDIR/usr/share/examples/$PKGRADIX-$PKGVER/etc/config.rc.haproxy - mkdir -p $ROOTDIR/usr/share/$PKGRADIX-$PKGVER ; cp doc/haproxy.txt $ROOTDIR/usr/share/$PKGRADIX-$PKGVER - ln -s ../examples/$PKGRADIX-$PKGVER $ROOTDIR/usr/share/$PKGRADIX-$PKGVER/examples - make clean -} - diff --git a/examples/haproxy-1.1.21-flx.1.pkg b/examples/haproxy-1.1.21-flx.1.pkg new file mode 100644 index 000000000..8054ffdd8 --- /dev/null +++ b/examples/haproxy-1.1.21-flx.1.pkg @@ -0,0 +1,21 @@ +#!/bin/sh + +function do_compile { + $FLXMAKE COPTS="-march=$arch -mcpu=$cpu -Os -mpreferred-stack-boundary=2 -momit-leaf-frame-pointer -malign-jumps=0 -DNETFILTER -DTRANSPARENT" +} + +function do_prepack { + mkdir -p $ROOTDIR/sbin/init.d ; cp init.d/haproxy $ROOTDIR/sbin/init.d + mkdir -p $ROOTDIR/usr/sbin ; cp haproxy $ROOTDIR/usr/sbin + mkdir -p $ROOTDIR/usr/share/examples/$PKGRADIX/$PKGRADIX-$PKGVER/etc + cp examples/haproxy.cfg $ROOTDIR/usr/share/examples/$PKGRADIX/$PKGRADIX-$PKGVER/etc/haproxy.cfg + cp examples/rc.highsock $ROOTDIR/usr/share/examples/$PKGRADIX/$PKGRADIX-$PKGVER/etc/rc.highsock + cp examples/config.rc.haproxy $ROOTDIR/usr/share/examples/$PKGRADIX/$PKGRADIX-$PKGVER/etc/config.rc.haproxy + mkdir -p $ROOTDIR/usr/share/$PKGRADIX/$PKGRADIX-$PKGVER + cp doc/haproxy.txt $ROOTDIR/usr/share/$PKGRADIX/$PKGRADIX-$PKGVER + ln -s ../../examples/$PKGRADIX/$PKGRADIX-$PKGVER $ROOTDIR/usr/share/$PKGRADIX/$PKGRADIX-$PKGVER/examples + cp examples/debug2ansi examples/debug2html examples/debugfind $ROOTDIR/usr/share/$PKGRADIX/$PKGRADIX-$PKGVER/ + + make clean +} + diff --git a/examples/haproxy.cfg b/examples/haproxy.cfg index 3b6f8259d..b6d877f5a 100644 --- a/examples/haproxy.cfg +++ b/examples/haproxy.cfg @@ -70,7 +70,7 @@ listen appli4-backup 0.0.0.0:10004 mode http option httplog option dontlognull - option httpchk + option httpchk /index.html option persist balance roundrobin server inst1 192.168.114.56:80 check inter 2000 fall 3 @@ -87,7 +87,7 @@ listen appli5-backup 0.0.0.0:10005 mode http option httplog option dontlognull - option httpchk + option httpchk * balance roundrobin cookie SERVERID insert indirect nocache server inst1 192.168.114.56:80 cookie server01 check inter 2000 fall 3 diff --git a/examples/haproxy2html.sh b/examples/haproxy2html.sh deleted file mode 100644 index e3753c72a..000000000 --- a/examples/haproxy2html.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -#(echo ''; sed -e 's,\(ASPSESSIONID[^; ]*\),\1,g' -e 's,\(^srvhdr.*\)$,\1,' -e 's,\(^clihdr.*\)$,\1,' -e 's,\(^.*\)$,\1,' -e 's/$/