1.5.14-alt1

- 1.5.14
- run demon as _haproxy user
- update default config
- update init script
- add systemd unit
- build with libssl support
- build with zlib support
This commit is contained in:
Алексей Шабалин 2015-08-21 21:50:33 +03:00
parent b238ade122
commit 90617731be
7 changed files with 189 additions and 114 deletions

View File

@ -1,2 +1,5 @@
tar: v@version@:. tar: v@version@:.
#diff: v@version@:. patches/alt-fix:. #diff: v@version@:. patches/alt-fix:.
copy: *.cfg
copy: *.init
copy: *.logrotate

View File

@ -0,0 +1,23 @@
object 16f863fbc9fbd6535971eb1f55d33f0efc2ac5e1
type commit
tag v1.5.14
tagger Willy Tarreau <w@1wt.eu> 1435937711 +0200
HAProxy 1.5.14
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iQIcBAABAgAGBQJVlquvAAoJEE44bZycYXAvq8YP/iLzZgxq02PRzFpqghHmWN2d
E3DYuFpyumEoKKO7sGipESC6BzEJnKcoTicQ0FhMYj0/X1Cx0ZlYIBs8N+6QJ5rv
aRJBAJeAPEHZlyYgA2KOwbMB7a7y94wK0bUdqCgvD2PT0nKMjb/DpgTclSaI/xIS
K4WeBZs/ryV1lHadTDP8EK2wxl7tAHanjq8KF4eIR8AK3MNvyhA4eFSU8a4RNwoQ
f8uy+hqT2UHUmhQqCTdmeS06SmJnLrhB+lFuVVQXd1HG1Gqdf/jIRJfjMvZ9guA+
xcqBDt5Yr87qcrT1iKLMKLWkoGHXSy6/X7m+D70rF0rGM8RLqL2nAU3w5OJ6bs+P
PZqw+9vpPSkEhRml+boWHxU/goX6BawoZ3HyD92bWBgmKOUnDeC7ewlT+teHDwXl
uu/5oN5QiOqoZlJxucgKkrhg5Xp4t9oX3OL13Fl0W6WvtF67AmkdyIZSCr4UqM5o
b52zdgLSpCBQFu8JZ3k11W9BQO/FGND9r8/4DEEUvl6ztdewznYRInPuBzHW+8VQ
Hx7dEJ0J/zYNJrpoAKYogZe9nP+aDPghXAPYjNCPBp5yJMeHkzUL9CTdZ48Y4M7A
tJgO/qgFnv2HBwe6KvR84l4F3U2OrfVGWN725834ntHkTzfi165Iti1yPGxSdb3C
40JlHWTZPdsq5oGJuSEj
=8rxa
-----END PGP SIGNATURE-----

1
.gear/tags/list Normal file
View File

@ -0,0 +1 @@
003268c0d13dd17f33eace631385ae584740bd75 v1.5.14

View File

@ -1,79 +1,86 @@
# this config needs haproxy-1.1.23 #---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global global
log 127.0.0.1 local0 # to have these messages end up in /var/log/haproxy.log you will
log 127.0.0.1 local1 notice # need to:
#log loghost local0 info #
maxconn 4096 # 1) configure syslog to accept network log events. This is done
chroot /usr/share/haproxy # by adding the '-r' option to the SYSLOGD_OPTIONS in
uid 99 # /etc/sysconfig/syslog
gid 99 #
daemon # 2) configure local2 events to go to the /var/log/haproxy.log
#debug # file. A line like the following can be added to
#quiet # /etc/sysconfig/syslog
#
# local2.* /var/log/haproxy.log
#
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user _haproxy
group _haproxy
daemon
# turn on stats unix socket
stats socket /var/lib/haproxy/stats
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults defaults
log global mode http
mode http log global
option httplog option httplog
option dontlognull option dontlognull
retries 3 option http-server-close
redispatch option forwardfor except 127.0.0.0/8
maxconn 2000 option redispatch
contimeout 5000 retries 3
clitimeout 50000 timeout http-request 10s
srvtimeout 50000 timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
listen appli1-rewrite 0.0.0.0:10001 #---------------------------------------------------------------------
cookie SERVERID rewrite # main frontend which proxys to the backends
balance roundrobin #---------------------------------------------------------------------
server app1_1 192.168.34.23:8080 cookie app1inst1 check inter 2000 rise 2 fall 5 frontend main *:5000
server app1_2 192.168.34.32:8080 cookie app1inst2 check inter 2000 rise 2 fall 5 acl url_static path_beg -i /static /images /javascript /stylesheets
server app1_3 192.168.34.27:8080 cookie app1inst3 check inter 2000 rise 2 fall 5 acl url_static path_end -i .jpg .gif .png .css .js
server app1_4 192.168.34.42:8080 cookie app1inst4 check inter 2000 rise 2 fall 5
listen appli2-insert 0.0.0.0:10002 use_backend static if url_static
option httpchk default_backend app
balance roundrobin
cookie SERVERID insert indirect nocache
server inst1 192.168.114.56:80 cookie server01 check inter 2000 fall 3
server inst2 192.168.114.56:81 cookie server02 check inter 2000 fall 3
capture cookie vgnvisitor= len 32
option httpclose # disable keep-alive #---------------------------------------------------------------------
rspidel ^Set-cookie:\ IP= # do not let this cookie tell our internal IP address # static backend for serving up images, stylesheets and such
#---------------------------------------------------------------------
listen appli3-relais 0.0.0.0:10003 backend static
dispatch 192.168.135.17:80 balance roundrobin
server static 127.0.0.1:4331 check
listen appli4-backup 0.0.0.0:10004 #---------------------------------------------------------------------
option httpchk /index.html # round robin balancing between the various backends
option persist #---------------------------------------------------------------------
balance roundrobin backend app
server inst1 192.168.114.56:80 check inter 2000 fall 3 balance roundrobin
server inst2 192.168.114.56:81 check inter 2000 fall 3 backup server app1 127.0.0.1:5001 check
server app2 127.0.0.1:5002 check
listen ssl-relay 0.0.0.0:8443 server app3 127.0.0.1:5003 check
option ssl-hello-chk server app4 127.0.0.1:5004 check
balance source
server inst1 192.168.110.56:443 check inter 2000 fall 3
server inst2 192.168.110.57:443 check inter 2000 fall 3
server back1 192.168.120.58:443 backup
listen appli5-backup 0.0.0.0:10005
option httpchk *
balance roundrobin
cookie SERVERID insert indirect nocache
server inst1 192.168.114.56:80 cookie server01 check inter 2000 fall 3
server inst2 192.168.114.56:81 cookie server02 check inter 2000 fall 3
server inst3 192.168.114.57:80 backup check inter 2000 fall 3
capture cookie ASPSESSION len 32
srvtimeout 20000
option httpclose # disable keep-alive
option checkcache # block response if set-cookie & cacheable
rspidel ^Set-cookie:\ IP= # do not let this cookie tell our internal IP address
errorloc 502 http://192.168.114.58/error502.html

View File

@ -31,17 +31,18 @@ LOCKFILE=/var/lock/subsys/${NAME}
BINARY=/usr/sbin/${NAME} BINARY=/usr/sbin/${NAME}
RETVAL=0 RETVAL=0
# Source networking configuration. check()
. /etc/sysconfig/network {
action "Checking configuration sanity for $name: " \
# Check that networking is up. $BINARY -c -q -f ${CONFIG}
[ ${NETWORKING} = "no" ] && exit 0 RETVAL=$?
return $RETVAL
[ -f $CONFIG ] || exit 1 }
start() start()
{ {
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user nobody -- $BINARY \ check || exit
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user _haproxy -- $BINARY \
-D -f ${CONFIG} -p ${PIDFILE} -D -f ${CONFIG} -p ${PIDFILE}
RETVAL=$? RETVAL=$?
return $RETVAL return $RETVAL
@ -49,19 +50,21 @@ start()
stop() stop()
{ {
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user nobody -- $BINARY stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user _haproxy -- $BINARY
RETVAL=$? RETVAL=$?
return $RETVAL return $RETVAL
} }
restart() restart()
{ {
check || exit
stop stop
start start
} }
reload() reload()
{ {
check || exit
msg_reloading $NAME msg_reloading $NAME
$BINARY -p "$PIDFILE" -f $CONFIG -sf `cat $PIDFILE` $BINARY -p "$PIDFILE" -f $CONFIG -sf `cat $PIDFILE`
RETVAL=$? RETVAL=$?
@ -97,12 +100,15 @@ case "$1" in
reload reload
fi fi
;; ;;
check)
check
;;
status) status)
status --pidfile "$PIDFILE" --expect-user nobody -- haproxy status --pidfile "$PIDFILE" --expect-user _haproxy -- haproxy
RETVAL=$? RETVAL=$?
;; ;;
*) *)
msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}" msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status|check}"
RETVAL=1 RETVAL=1
esac esac

8
haproxy.logrotate Normal file
View File

@ -0,0 +1,8 @@
/var/log/haproxy.log {
daily
rotate 10
missingok
notifempty
compress
sharedscripts
}

View File

@ -1,18 +1,24 @@
%define haproxy_user _haproxy
%define haproxy_group %haproxy_user
%define haproxy_home %_localstatedir/haproxy
%define haproxy_confdir %_sysconfdir/haproxy
%define haproxy_datadir %_datadir/haproxy
Name: haproxy Name: haproxy
Version: 1.4.20 Version: 1.5.14
Release: alt1 Release: alt1
Summary: HA-Proxy is a TCP/HTTP reverse proxy for high availability environments Summary: HA-Proxy is a TCP/HTTP reverse proxy for high availability environments
License: GPLv2+ License: GPLv2+
Group: System/Servers Group: System/Servers
URL: http://haproxy.1wt.eu/ URL: http://www.haproxy.org/
Source0: http://haproxy.1wt.eu/download/1.4/src/%name-%version.tar.gz Source: %name-%version.tar
Source1: haproxy.cfg Source1: %name.cfg
Source2: haproxy.init Source2: %name.init
Source3: %name.logrotate
# Automatically added by buildreq on Wed Mar 23 2011 BuildRequires: libpcre-devel zlib-devel libssl-devel
BuildRequires: libpcre-devel
%description %description
HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high
@ -40,33 +46,41 @@ regparm_opts=
regparm_opts="USE_REGPARM=1" regparm_opts="USE_REGPARM=1"
%endif %endif
%make TARGET=linux26 USE_PCRE=1 USE_LINUX_TPROXY=1 USE_LINUX_SPLICE=1 \ %make_build CPU="generic" TARGET="linux2628" USE_OPENSSL=1 USE_PCRE=1 USE_ZLIB=1 \
${regparm_opts} "ADDINC=$(pcre-config --cflags)" "CFLAGS=%optflags" "${regparm_opts}" PREFIX="%_prefix" ADDINC="$(pcre-config --cflags)" CFLAGS="%optflags"
# Build the contrib halog program. Build correct version (halog or halog64)
# and make sure it always installed as halog.
halog="halog"
%if "%_lib" == "lib64"
halog="halog64"
%endif
pushd contrib/halog pushd contrib/halog
%make $halog %make halog OPTIMIZE="%optflags"
%if "%_lib" == "lib64" popd
mv $halog halog
%endif pushd contrib/iprange
%make iprange OPTIMIZE="%optflags"
popd
pushd contrib/systemd
%make haproxy.service PREFIX="%_prefix"
popd popd
%install %install
%make_install install DESTDIR=%buildroot PREFIX=/usr %make_install install-bin DESTDIR=%buildroot PREFIX="%_prefix"
%make_install install-man DESTDIR=%buildroot PREFIX="%_prefix"
install -d -m0755 %buildroot%_datadir/haproxy/ install -p -D -m 0644 %SOURCE1 %buildroot%haproxy_confdir/%name.cfg
cp -p examples/errorfiles/* %buildroot%_datadir/haproxy/ install -D -m 0755 %SOURCE2 %buildroot%_initrddir/haproxy
install -p -D -m 0644 contrib/systemd/haproxy.service %buildroot%_unitdir/%name.service
install -p -D -m 0644 %SOURCE3 %buildroot%_logrotatedir/%name
install -d -m 0755 %buildroot%haproxy_home
install -d -m 0755 %buildroot%haproxy_datadir
install -d -m 0755 %buildroot%_bindir
install -p -m 0755 contrib/halog/halog %buildroot%_bindir/halog
install -p -m 0755 contrib/iprange/iprange %buildroot%_bindir/iprange
cp -p examples/errorfiles/* %buildroot%haproxy_datadir/
install -D -m0644 %SOURCE1 %buildroot%_sysconfdir/haproxy/haproxy.cfg
install -D -m0755 %SOURCE2 %buildroot%_initrddir/haproxy
install -D -m0755 contrib/halog/halog %buildroot%_bindir/halog %pre
%_sbindir/groupadd -r -f %haproxy_group >/dev/null 2>&1 ||:
%_sbindir/useradd -g %haproxy_group -c 'HA Proxy' \
-d %haproxy_home -s /dev/null -r -l -M %haproxy_user >/dev/null 2>&1 ||:
%post %post
%post_service haproxy %post_service haproxy
@ -75,16 +89,29 @@ install -D -m0755 contrib/halog/halog %buildroot%_bindir/halog
%preun_service haproxy %preun_service haproxy
%files %files
%doc CHANGELOG LICENSE doc/architecture.txt doc/configuration.txt %doc CHANGELOG LICENSE README ROADMAP doc/architecture.txt doc/configuration.txt doc/proxy-protocol.txt examples/*.cfg
%config(noreplace) %_sysconfdir/haproxy/ %dir %haproxy_confdir
%config %_initrddir/haproxy %config(noreplace) %haproxy_confdir/%name.cfg
%_sbindir/haproxy %dir %haproxy_datadir
%_datadir/haproxy %haproxy_datadir/*
%_bindir/halog %_logrotatedir/%name
%_initrddir/%name
%_unitdir/%name.service
%_sbindir/*
%_bindir/*
%_man1dir/* %_man1dir/*
%exclude /usr/doc %attr(-,%haproxy_user,%haproxy_group) %dir %haproxy_home
%changelog %changelog
* Fri Aug 21 2015 Alexey Shabalin <shaba@altlinux.ru> 1.5.14-alt1
- 1.5.14
- run demon as _haproxy user
- update default config
- update init script
- add systemd unit
- build with libssl support
- build with zlib support
* Fri Mar 16 2012 Victor Forsiuk <force@altlinux.org> 1.4.20-alt1 * Fri Mar 16 2012 Victor Forsiuk <force@altlinux.org> 1.4.20-alt1
- 1.4.20 - 1.4.20