Skip to content

Instantly share code, notes, and snippets.

@thyn
Forked from ryzy/a.sh
Last active July 25, 2022 22:15
Show Gist options
  • Save thyn/1c3f5efb0fa5e75b7284c507e146db93 to your computer and use it in GitHub Desktop.
Save thyn/1c3f5efb0fa5e75b7284c507e146db93 to your computer and use it in GitHub Desktop.

Revisions

  1. thyn revised this gist Oct 7, 2021. 1 changed file with 28 additions and 0 deletions.
    28 changes: 28 additions & 0 deletions haproxy 2.2
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@

    rm -rf /tmp/haproxy-current
    git clone http://git.haproxy.org/git/haproxy-2.2.git /tmp/haproxy-current
    cd /tmp/haproxy-current
    make \
    TARGET=linux-glibc USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \
    USE_OPENSSL=1 SSL_INC=/usr/include SSL_LIB=/usr/lib ADDLIB=-lpthread USE_SYSTEMD=1
    make install
    # cp /tmp/haproxy-current/examples/haproxy.init /etc/init.d/haproxy
    # cp contrib/systemd/haproxy.service.in /etc/systemd/system/haproxy.service
    systemctl daemon-reload
    if [ $(getent passwd haproxy) ] ; then
    echo user haproxy exists
    else
    echo user haproxy doesn\'t exists, creating
    adduser haproxy
    gpasswd -a haproxy haproxy
    fi
    mkdir /etc/haproxy
    mkdir /var/lib/haproxy

    cp /usr/local/sbin/haproxy /usr/sbin/haproxy22

    rm -rf /usr/local/sbin/haproxy


    haproxy21 -vv

  2. thyn revised this gist Sep 28, 2021. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Haprox2.0 standalone
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,8 @@ git clone http://git.haproxy.org/git/haproxy-2.0.git /tmp/haproxy-current
    cd /tmp/haproxy-current
    make \
    TARGET=linux-glibc USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \
    USE_OPENSSL=1 SSL_INC=/usr/include SSL_LIB=/usr/lib ADDLIB=-lpthread USE_SYSTEMD=1 \
    CFLAGS="-O2 -g -fno-strict-aliasing -DTCP_USER_TIMEOUT=18"
    USE_OPENSSL=1 SSL_INC=/usr/include SSL_LIB=/usr/lib ADDLIB=-lpthread USE_SYSTEMD=1

    make install
    # cp /tmp/haproxy-current/examples/haproxy.init /etc/init.d/haproxy
    # cp contrib/systemd/haproxy.service.in /etc/systemd/system/haproxy.service
    @@ -20,7 +20,7 @@ if [ $(getent passwd haproxy) ] ; then
    mkdir /etc/haproxy
    mkdir /var/lib/haproxy

    cp /usr/local/sbin/haproxy /usr/sbin/haproxy20
    cp /usr/local/sbin/haproxy /usr/sbin/haproxy20_25

    rm -rf /usr/local/sbin/haproxy

  3. thyn renamed this gist Feb 4, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. thyn revised this gist Feb 4, 2020. 2 changed files with 55 additions and 0 deletions.
    26 changes: 26 additions & 0 deletions Haprox2.0 standalone
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    # Compile and install HAProxy
    rm -rf /tmp/haproxy-current
    git clone http://git.haproxy.org/git/haproxy-2.0.git /tmp/haproxy-current
    cd /tmp/haproxy-current
    make \
    TARGET=linux-glibc USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \
    USE_OPENSSL=1 SSL_INC=/usr/include SSL_LIB=/usr/lib ADDLIB=-lpthread USE_SYSTEMD=1 \
    CFLAGS="-O2 -g -fno-strict-aliasing -DTCP_USER_TIMEOUT=18"
    make install
    # cp /tmp/haproxy-current/examples/haproxy.init /etc/init.d/haproxy
    # cp contrib/systemd/haproxy.service.in /etc/systemd/system/haproxy.service
    systemctl daemon-reload
    if [ $(getent passwd haproxy) ] ; then
    echo user haproxy exists
    else
    echo user haproxy doesn\'t exists, creating
    adduser haproxy
    gpasswd -a haproxy haproxy
    fi
    mkdir /etc/haproxy
    mkdir /var/lib/haproxy

    cp /usr/local/sbin/haproxy /usr/sbin/haproxy20

    rm -rf /usr/local/sbin/haproxy

    29 changes: 29 additions & 0 deletions haproxy 2.1
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@

    rm -rf /tmp/haproxy-current
    git clone http://git.haproxy.org/git/haproxy-2.1.git /tmp/haproxy-current
    cd /tmp/haproxy-current
    make \
    TARGET=linux-glibc USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \
    USE_OPENSSL=1 SSL_INC=/usr/include SSL_LIB=/usr/lib ADDLIB=-lpthread USE_SYSTEMD=1 \
    CFLAGS="-O2 -g -fno-strict-aliasing -DTCP_USER_TIMEOUT=18"
    make install
    # cp /tmp/haproxy-current/examples/haproxy.init /etc/init.d/haproxy
    # cp contrib/systemd/haproxy.service.in /etc/systemd/system/haproxy.service
    systemctl daemon-reload
    if [ $(getent passwd haproxy) ] ; then
    echo user haproxy exists
    else
    echo user haproxy doesn\'t exists, creating
    adduser haproxy
    gpasswd -a haproxy haproxy
    fi
    mkdir /etc/haproxy
    mkdir /var/lib/haproxy

    cp /usr/local/sbin/haproxy /usr/sbin/haproxy21

    rm -rf /usr/local/sbin/haproxy


    haproxy21 -vv

  5. thyn revised this gist Jan 29, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Haproxy2.0
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Compile and install HAProxy
    rm -rf /tmp/haproxy-current
    git clone http://git.haproxy.org/git/haproxy-2.0.git /tmp/haproxy-current
    git clone http://git.haproxy.org/git/haproxy-2.1.git /tmp/haproxy-current
    cd /tmp/haproxy-current
    make \
    TARGET=linux-glibc USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \
  6. thyn revised this gist Nov 14, 2019. 3 changed files with 30 additions and 4 deletions.
    2 changes: 1 addition & 1 deletion Haproxy1.9.Install.sh
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ git clone http://git.haproxy.org/git/haproxy-1.9.git /tmp/haproxy-current
    cd /tmp/haproxy-current
    make \
    TARGET=linux2628 USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \
    USE_OPENSSL=1 SSL_INC=/usr/include SSL_LIB=/usr/lib ADDLIB=-ldl USE_SYSTEMD=1 \
    USE_OPENSSL=1 SSL_INC=/usr/include SSL_LIB=/usr/lib ADDLIB=-ldl USE_SYSTEMD=1 \
    CFLAGS="-O2 -g -fno-strict-aliasing -DTCP_USER_TIMEOUT=18"
    make install
    # cp /tmp/haproxy-current/examples/haproxy.init /etc/init.d/haproxy
    25 changes: 25 additions & 0 deletions Haproxy2.0
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    # Compile and install HAProxy
    rm -rf /tmp/haproxy-current
    git clone http://git.haproxy.org/git/haproxy-2.0.git /tmp/haproxy-current
    cd /tmp/haproxy-current
    make \
    TARGET=linux-glibc USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \
    USE_OPENSSL=1 SSL_INC=/usr/include SSL_LIB=/usr/lib ADDLIB=-lpthread USE_SYSTEMD=1 \
    CFLAGS="-O2 -g -fno-strict-aliasing -DTCP_USER_TIMEOUT=18"
    make install
    # cp /tmp/haproxy-current/examples/haproxy.init /etc/init.d/haproxy
    cp contrib/systemd/haproxy.service.in /etc/systemd/system/haproxy.service
    systemctl daemon-reload
    if [ $(getent passwd haproxy) ] ; then
    echo user haproxy exists
    else
    echo user haproxy doesn\'t exists, creating
    adduser haproxy
    gpasswd -a haproxy haproxy
    fi
    mkdir /etc/haproxy
    mkdir /var/lib/haproxy

    cp /usr/local/sbin/haproxy /usr/sbin/

    systemctl stop haproxy && cp /usr/local/sbin/haproxy /usr/sbin/ && systemctl start haproxy
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,8 @@
    # Compile and install OpenSSL - via https://github.com/haproxy/haproxy/blob/master/README
    wget -O /tmp/openssl.tgz https://www.openssl.org/source/openssl-1.1.0-latest.tar.gz
    wget -O /tmp/openssl.tgz https://www.openssl.org/source/openssl-1.1.1-latest.tar.gz
    tar -zxf /tmp/openssl.tgz -C /tmp
    cd /tmp/openssl-*
    ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic
    make
    make install_sw
    make ADDLIB=-lpthread
    make install_sw

  7. thyn revised this gist Mar 18, 2019. 3 changed files with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Haproxy1.8.Install.sh → Haproxy1.9.Install.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Compile and install HAProxy
    rm -rf /tmp/haproxy-current
    git clone http://git.haproxy.org/git/haproxy-1.8.git /tmp/haproxy-current
    git clone http://git.haproxy.org/git/haproxy-1.9.git /tmp/haproxy-current
    cd /tmp/haproxy-current
    make \
    TARGET=linux2628 USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \
    File renamed without changes.
  8. thyn revised this gist Aug 2, 2018. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Haproxy1.8.Install.sh
    Original file line number Diff line number Diff line change
    @@ -17,9 +17,9 @@ if [ $(getent passwd haproxy) ] ; then
    adduser haproxy
    gpasswd -a haproxy haproxy
    fi

    mkdir /etc/haproxy
    mkdir /var/lib/haproxy

    cp /usr/local/sbin/haproxy /usr/sbin/

    systemctl stop haproxy && cp /usr/local/sbin/haproxy /usr/sbin/ && systemctl start haproxy
    mkdir /etc/haproxy
    mkdir /var/lib/haproxy
  9. thyn revised this gist Jul 10, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Haproxy1.8.Install.sh
    Original file line number Diff line number Diff line change
    @@ -21,4 +21,5 @@ if [ $(getent passwd haproxy) ] ; then


    systemctl stop haproxy && cp /usr/local/sbin/haproxy /usr/sbin/ && systemctl start haproxy
    mkdir /etc/haproxy
    mkdir /etc/haproxy
    mkdir /var/lib/haproxy
  10. thyn revised this gist Jul 10, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Haproxy1.8.Install.sh
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ make \
    CFLAGS="-O2 -g -fno-strict-aliasing -DTCP_USER_TIMEOUT=18"
    make install
    # cp /tmp/haproxy-current/examples/haproxy.init /etc/init.d/haproxy
    cp contrib/systemd/haproxy.service.in /etc/systemd/system/haproxy.serivce
    cp contrib/systemd/haproxy.service.in /etc/systemd/system/haproxy.service
    systemctl daemon-reload
    if [ $(getent passwd haproxy) ] ; then
    echo user haproxy exists
    @@ -21,4 +21,4 @@ if [ $(getent passwd haproxy) ] ; then


    systemctl stop haproxy && cp /usr/local/sbin/haproxy /usr/sbin/ && systemctl start haproxy
    /usr/local/sbin/haproxy
    mkdir /etc/haproxy
  11. thyn renamed this gist Jun 18, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  12. thyn revised this gist Jun 18, 2018. 3 changed files with 0 additions and 0 deletions.
    File renamed without changes.
    File renamed without changes.
  13. thyn revised this gist Jun 18, 2018. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion a.sh
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,2 @@
    # make sure you have these installed
    yum install -y make gcc perl pcre-devel zlib-devel
    yum install -y make gcc perl pcre-devel zlib-devel systemd-devel
    2 changes: 1 addition & 1 deletion install-haproxy.sh
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ git clone http://git.haproxy.org/git/haproxy-1.8.git /tmp/haproxy-current
    cd /tmp/haproxy-current
    make \
    TARGET=linux2628 USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \
    USE_OPENSSL=1 SSL_INC=/usr/include SSL_LIB=/usr/lib ADDLIB=-ldl \
    USE_OPENSSL=1 SSL_INC=/usr/include SSL_LIB=/usr/lib ADDLIB=-ldl USE_SYSTEMD=1 \
    CFLAGS="-O2 -g -fno-strict-aliasing -DTCP_USER_TIMEOUT=18"
    make install
    # cp /tmp/haproxy-current/examples/haproxy.init /etc/init.d/haproxy
  14. thyn revised this gist Jun 18, 2018. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions install-haproxy.sh
    Original file line number Diff line number Diff line change
    @@ -10,5 +10,15 @@ make install
    # cp /tmp/haproxy-current/examples/haproxy.init /etc/init.d/haproxy
    cp contrib/systemd/haproxy.service.in /etc/systemd/system/haproxy.serivce
    systemctl daemon-reload
    if [ $(getent passwd haproxy) ] ; then
    echo user haproxy exists
    else
    echo user haproxy doesn\'t exists, creating
    adduser haproxy
    gpasswd -a haproxy haproxy
    fi



    systemctl stop haproxy && cp /usr/local/sbin/haproxy /usr/sbin/ && systemctl start haproxy
    /usr/local/sbin/haproxy
  15. thyn revised this gist Jun 18, 2018. 2 changed files with 2 additions and 3 deletions.
    2 changes: 1 addition & 1 deletion compile-openssl-102.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Compile and install OpenSSL - via https://github.com/haproxy/haproxy/blob/master/README
    wget -O /tmp/openssl.tgz https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz
    wget -O /tmp/openssl.tgz https://www.openssl.org/source/openssl-1.1.0-latest.tar.gz
    tar -zxf /tmp/openssl.tgz -C /tmp
    cd /tmp/openssl-*
    ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic
    3 changes: 1 addition & 2 deletions install-haproxy.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Compile and install HAProxy
    rm -rf /tmp/haproxy-current
    git clone http://git.haproxy.org/git/haproxy-1.7.git /tmp/haproxy-current
    git clone http://git.haproxy.org/git/haproxy-1.8.git /tmp/haproxy-current
    cd /tmp/haproxy-current
    make \
    TARGET=linux2628 USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \
    @@ -10,6 +10,5 @@ make install
    # cp /tmp/haproxy-current/examples/haproxy.init /etc/init.d/haproxy
    cp contrib/systemd/haproxy.service.in /etc/systemd/system/haproxy.serivce
    systemctl daemon-reload
    cp haproxy-systemd-wrapper /usr/sbin/
    systemctl stop haproxy && cp /usr/local/sbin/haproxy /usr/sbin/ && systemctl start haproxy
    /usr/local/sbin/haproxy
  16. thyn revised this gist Jan 9, 2018. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion install-haproxy.sh
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,9 @@ make \
    USE_OPENSSL=1 SSL_INC=/usr/include SSL_LIB=/usr/lib ADDLIB=-ldl \
    CFLAGS="-O2 -g -fno-strict-aliasing -DTCP_USER_TIMEOUT=18"
    make install
    cp /tmp/haproxy-current/examples/haproxy.init /etc/init.d/haproxy
    # cp /tmp/haproxy-current/examples/haproxy.init /etc/init.d/haproxy
    cp contrib/systemd/haproxy.service.in /etc/systemd/system/haproxy.serivce
    systemctl daemon-reload
    cp haproxy-systemd-wrapper /usr/sbin/
    systemctl stop haproxy && cp /usr/local/sbin/haproxy /usr/sbin/ && systemctl start haproxy
    /usr/local/sbin/haproxy
  17. thyn revised this gist Feb 27, 2017. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions install-haproxy.sh
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,4 @@ make \
    make install
    cp /tmp/haproxy-current/examples/haproxy.init /etc/init.d/haproxy
    systemctl daemon-reload
    systemctl stop haproxy
    cp /usr/local/sbin/haproxy /usr/sbin/
    systemctl start haproxy
    systemctl stop haproxy && cp /usr/local/sbin/haproxy /usr/sbin/ && systemctl start haproxy
  18. thyn revised this gist Feb 21, 2017. 1 changed file with 9 additions and 4 deletions.
    13 changes: 9 additions & 4 deletions install-haproxy.sh
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,14 @@
    # Compile and install HAProxy
    wget -O /tmp/haproxy.tgz http://www.haproxy.org/download/1.7/src/haproxy-1.7.1.tar.gz
    tar -zxvf /tmp/haproxy.tgz -C /tmp
    cd /tmp/haproxy-*
    rm -rf /tmp/haproxy-current
    git clone http://git.haproxy.org/git/haproxy-1.7.git /tmp/haproxy-current
    cd /tmp/haproxy-current
    make \
    TARGET=linux2628 USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \
    USE_OPENSSL=1 SSL_INC=/usr/include SSL_LIB=/usr/lib ADDLIB=-ldl \
    CFLAGS="-O2 -g -fno-strict-aliasing -DTCP_USER_TIMEOUT=18"
    make install
    make install
    cp /tmp/haproxy-current/examples/haproxy.init /etc/init.d/haproxy
    systemctl daemon-reload
    systemctl stop haproxy
    cp /usr/local/sbin/haproxy /usr/sbin/
    systemctl start haproxy
  19. thyn revised this gist Dec 21, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-haproxy.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Compile and install HAProxy
    wget -O /tmp/haproxy.tgz http://www.haproxy.org/download/1.6/src/haproxy-1.6.3.tar.gz
    wget -O /tmp/haproxy.tgz http://www.haproxy.org/download/1.7/src/haproxy-1.7.1.tar.gz
    tar -zxvf /tmp/haproxy.tgz -C /tmp
    cd /tmp/haproxy-*
    make \
  20. @ryzy ryzy revised this gist Mar 13, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion compile-openssl-102.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Compile and install OpenSSL
    # Compile and install OpenSSL - via https://github.com/haproxy/haproxy/blob/master/README
    wget -O /tmp/openssl.tgz https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz
    tar -zxf /tmp/openssl.tgz -C /tmp
    cd /tmp/openssl-*
  21. @ryzy ryzy revised this gist Mar 13, 2016. No changes.
  22. @ryzy ryzy revised this gist Mar 13, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions a.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    # make sure you have these installed
    yum install -y make gcc perl pcre-devel zlib-devel
  23. @ryzy ryzy created this gist Mar 13, 2016.
    7 changes: 7 additions & 0 deletions compile-openssl-102.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    # Compile and install OpenSSL
    wget -O /tmp/openssl.tgz https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz
    tar -zxf /tmp/openssl.tgz -C /tmp
    cd /tmp/openssl-*
    ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib no-shared zlib-dynamic
    make
    make install_sw
    9 changes: 9 additions & 0 deletions install-haproxy.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    # Compile and install HAProxy
    wget -O /tmp/haproxy.tgz http://www.haproxy.org/download/1.6/src/haproxy-1.6.3.tar.gz
    tar -zxvf /tmp/haproxy.tgz -C /tmp
    cd /tmp/haproxy-*
    make \
    TARGET=linux2628 USE_LINUX_TPROXY=1 USE_ZLIB=1 USE_REGPARM=1 USE_PCRE=1 USE_PCRE_JIT=1 \
    USE_OPENSSL=1 SSL_INC=/usr/include SSL_LIB=/usr/lib ADDLIB=-ldl \
    CFLAGS="-O2 -g -fno-strict-aliasing -DTCP_USER_TIMEOUT=18"
    make install