Showing posts with label haproxy. Show all posts
Showing posts with label haproxy. Show all posts

Sunday, June 6, 2021

Program open port 80 with normal user

sudo apt-get install libcap2-bin
sudo setcap 'cap_net_bind_service=+ep' /path/to/program

Monday, February 12, 2018

Enable socket admin Haproxy

The stats socket is not enabled by default. In order to enable it, it is
necessary to add one line in the global section of the haproxy configuration.
A second line is recommended to set a larger timeout, always appreciated when
issuing commands by hand :

    global
        stats socket /var/run/haproxy.sock mode 600 level admin
        stats timeout 2m

It is also possible to add multiple instances of the stats socket by repeating
the line, and make them listen to a TCP port instead of a UNIX socket. This is
never done by default because this is dangerous, but can be handy in some
situations :

    global
        stats socket /var/run/haproxy.sock mode 600 level admin
        stats socket ipv4@192.168.0.1:9999 level admin
        stats timeout 2m

Sunday, June 26, 2016

Install Haproxy from source on Debian 7

apt-get install build-essential make g++ libssl-dev

tar xvf haproxy-1.6.5.tar.gz

cd haproxy-1.6.5

make TARGET=linux2628  USE_OPENSSL=yes USE_ZLIB=yes

make install

cp /usr/local/sbin/haproxy /usr/sbin/
cp examples/haproxy.init /etc/init.d/haproxy
chmod 755 /etc/init.d/haproxy
mkdir -p /etc/haproxy
mkdir -p /run/haproxy
mkdir -p /var/lib/haproxy
touch /var/lib/haproxy/stats
useradd -r haproxy