(1 - user rating)

User Rating: 1 / 5

Star ActiveStar InactiveStar InactiveStar InactiveStar Inactive
 

How to setup and Install Haproxy..

 Load balancer for servers 214bb

HaProxy is by far the fastest and best light wieght load balancer around in my book.  I have been using it for years and will always continue  to use it so i have decided to share my instalation proccess and example config files. Nowadays websites need a 99.999% up time which just isn't possible with 1 standalone server

CentOS 6 already has  HAProxy packages available under base repository

 

 

 

 

 

 

On CentOS/RHEL 5:

# rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

 

Install HAProxy package using yum package manager from command line interface using following comamnd.

# yum install haproxy

Configuiring Haproxy

 

The config file for setting up and getting your loadbalancer (Haproxy) working is located in /etc/haproxy/haproxy.cfg

nano /etc/haproxy/haproxy.cfg

#---------------------------------------------------------------------
# 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
    # to have these messages end up in /var/log/haproxy.log you will
    # need to:
    #
    # 1) configure syslog to accept network log events.  This is done
    #    by adding the '-r' option to the SYSLOGD_OPTIONS in
    #    /etc/sysconfig/syslog
    #
    # 2) configure local2 events to go to the /var/log/haproxy.log
    #   file. A line like the following can be added to
    #   /etc/sysconfig/syslog
    #
    #    local2.*                       /var/log/haproxy.log
    #
    log         127.0.0.1 local2

    chroot      /var/lib/haproxy
    pidfile     /var/run/haproxy.pid
    user        haproxy
    group       haproxy
    daemon
       nbproc  1

    # 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

#tune.chksize 36384
 log global
 mode http
 option httplog
 option dontlognull
 retries 3
 balance roundrobin
 option redispatch
 option forwardfor
 option forceclose        # Slows the connection
 maxconn 10000
 contimeout 30000
 clitimeout 40000
 srvtimeout 55000
 stats enable     # enables you to see the stats from a webpage 
 stats auth admin:98!n567ehny!&*

#---------------------------------------------------------------------
# main frontend which proxys to the backends
#---------------------------------------------------------------------


option httpchk GET /index.php HTTP/1.1\r\nHost:\ www.cyfordtechnologies.com

frontend all 0.0.0.0:80 # Listens on all ip address on  port 80

reqidel ^X-Forwarded-For:.*   #  It uses the client ip address instead of letting the webserver know the request came from haproxy..  good more analysing web traffic
option forwardfor
 acl acl_mail.cyfordtechnologies.com hdr_dom(host) -i mail.cyfordtechnologies.com
 acl acl_www.cyfordtechnologies.com hdr_dom(host) -i www.cyfordtechnologies.com

 acl acl_seo.cyfordtechnologies.com hdr_dom(host) -i seo.cyfordtechnologies.com
 acl acl_Extranet.cyfordtechnologies.com hdr_dom(host) -i Extranet.cyfordtechnologies.com
 acl acl_genconinc.net hdr_dom(host) -i genconinc.net
 acl acl_www.heavensgateguild.com hdr_dom(host) -i heavensgateguild.com
 acl acl_test.cyfordtechnologies.com hdr_dom(host) -i test.cyfordtechnologies.com
 acl acl_extendeucandvraptoday.com hdr_dom(host) -i      extendeucandvraptoday.com
 acl acl_lifesbasics.net hdr_dom(host) -i      lifesbasics.net
 acl acl_lifesbasics.org hdr_dom(host) -i      lifesbasics.org
 acl acl_todayssocialissues.com hdr_dom(host) -i      todayssocialissues.com
 acl acl_sample.cyfordtechnologies.com hdr_dom(host) -i  sample.cyfordtechnologies.com
 acl acl_sample.cyfordtechnologies.com hdr_dom(host) -i  onlinemerchantshop.com
 acl acl_sample.cyfordtechnologies.com hdr_dom(host) -i  gottires.com


 use_backend www.cyfordtechnologies.com if acl_www.cyfordtechnologies.com
 use_backend mail.cyfordtechnologies.com if acl_mail.cyfordtechnologies.com
 use_backend www.cyfordtechnologies.com if acl_seo.cyfordtechnologies.com
 use_backend www.cyfordtechnologies.com if acl_Extranet.cyfordtechnologies.com
 use_backend www.cyfordtechnologies.com if acl_genconinc.net
 use_backend Hosting   if acl_www.heavensgateguild.com
 use_backend www.cyfordtechnologies.com if acl_test.cyfordtechnologies.com
 use_backend Hosting if acl_extendeucandvraptoday.com
 use_backend Hosting if acl_lifesbasics.net
 use_backend Hosting if acl_lifesbasics.org
 use_backend Hosting if acl_todayssocialissues.com
 use_backend www.cyfordtechnologies.com if acl_sample.cyfordtechnologies.com


#---------------------------------------------------------------------
# round robin balancing between the various backends
#---------------------------------------------------------------------

# I use mynmain websites in the first pool and usually seperate clients and others  incase they move around or mine move around.  i also load balanced a couple of reverse proxy servers. which uses port 3128

# Of course you would need to change the ip address  to the ip of your servers


backend www.cyfordtechnologies.com
balance roundrobin
 cookie SRVID insert indirect nocache
    server 01-CachServer_www.cyfordtechnologies.com-3128 192.168.22.8:3128  weight 10 maxconn 200 check inter 10500
    server 00-CachServer_www.cyfordtechnologies.com-3128 192.168.22.7:3128   weight 10 maxconn 200 check inter 10500
    server 01-CachServer_www.cyfordtechnologies.com-80 192.168.22.8:80   weight 17 maxconn 200 check inter 10500
    server 00-CachServer_www.cyfordtechnologies.com-80 192.168.22.7:80   weight 17 maxconn 200 check inter 10500
    server web00_www.cyfordtechnologies.com 192.168.22.150:80 cookie SRVID  weight 15 maxconn  100 check inter 15000
    server web01_www.cyfordtechnologies.com 192.168.22.151:80 cookie SRVID  weight 15 maxconn  100 check inter 15000
    server web02_www.cyfordtechnologies.com 192.168.22.152:80 cookie SRVID  weight 50 maxconn  100 check inter 15000  
    #server HostMonster_www.cyfordtechnologies.com 74.220.22.77:80 cookie SRVID  weight 5 maxconn 5 check backup inter 15000
option redispatch # send back to dispatch in case of connection failure
#option abortonclose
option forceclose

backend www.gottires.com
balance roundrobin
 cookie SRVID insert indirect nocache
    server www.gottires.com 192.168.111.32:80 cookie SRVID  weight 15 maxconn  100 check inter 15000  
    #server HostMonster_www.cyfordtechnologies.com 74.220.215.77:80 cookie SRVID  weight 5 maxconn 5 check backup inter 15000
option redispatch # send back to dispatch in case of connection failure
#option abortonclose
option forceclose


backend Hosting
balance roundrobin
 cookie SRVID insert indirect nocache
    server web00_www.cyfordtechnologies.com 192.168.44.150:80 cookie SRVID  weight 15 maxconn  100 check inter 15000
    server web01_www.cyfordtechnologies.com 192.168.44.151:80 cookie SRVID  weight 15 maxconn  100 check inter 15000
    server web02_www.cyfordtechnologies.com 192.168.44.152:80 cookie SRVID  weight 50 maxconn  100 check inter 15000
    #server HostMonster_www.cyfordtechnologies.com 74.220.215.77:80 cookie SRVID  weight 5 maxconn 5 check backup inter 15000
option redispatch # send back to dispatch in case of connection failure
#option abortonclose
option forceclose


backend mail.cyfordtechnologies.com
 server srv_mail.cyfordtechnologies.com 192.168.22.110:80 weight 10 maxconn  100  inter 20000
option abortonclose

backend www.heavensgateguild.com
 server 00-CachServer_www.cyfordtechnologies.com-3128 192.168.33.7:3128  weight 10 maxconn 200 check inter 10500
 server 01-CachServer_www.cyfordtechnologies.com-3128 192.168.33.8:3128  weight 10 maxconn 200 check inter 10500
 server web_www.cyfordtechnologies.com 192.168.33.150:80 cookie SRVID  weight 9 maxconn  100 check backup inter 15000
option abortonclose
option redispatch



Start Haproxy and make it start with system boot


# service haproxy start ; chkconfig haproxy on

Comments   

0 #9 Para-Axe Plus 2019-05-15 21:28
Whoah this blog is magnificent i love reading your articles.
Keep up the good paintings! You understand, lots of people are
hunting round for this information, you can help them greatly.
Quote | Report to administrator
0 #8 Infinite Keto 2019-05-12 20:44
Hello, you used to write wonderful, but the last few posts have been kinda boring?
I miss your tremendous writings. Past several posts are
just a little out of track! come on!
Quote | Report to administrator
0 #7 visit 2019-04-10 10:02
Hi, I do think this is an excellent website. I stumbledupon it ;) I'm going to
return yet again since I bookmarked it. Money and freedom is the greatest
way to change, may you be rich and continue to guide other people.
Quote | Report to administrator
0 #6 see this 2019-04-10 10:01
I think everything posted was very reasonable. But, what
about this? what if you composed a catchier title? I ain't suggesting your content is
not solid., but suppose you added a title that grabbed people's attention? I mean Cyford Technologies LLC is
kinda plain. You should peek at Yahoo's front page and watch how they create post titles to get people to
open the links. You might add a video or a related pic or
two to grab people excited about what you've got to say.

In my opinion, it might make your posts a little livelier.
Quote | Report to administrator
0 #5 seo proxy 2019-02-13 22:18
It is appropriate time to make some plans for the longer term and it's time to be happy.
I've learn this put up and if I may I wish to counsel you few
attention-grabb ing things or tips. Maybe you can write next articles regarding this
article. I wish to read even more things approximately it!
Quote | Report to administrator
0 #4 proxy 2019-02-13 18:15
Awesome! Its truly awesome paragraph, I have got much clear idea concerning from this paragraph.
Quote | Report to administrator
0 #3 BetteJuicy 2018-08-10 11:02
Hello. I see that you don't update your site too often. I know that writing content is boring
and time consuming. But did you know that there is a tool that allows you to create new
posts using existing content (from article directories or other pages from your niche)?
And it does it very well. The new articles are high quality and pass the copyscape
test. You should try miftolo's tools
Quote | Report to administrator
0 #2 GregoryJuicy 2018-08-10 10:59
Hi. I see that you don't update your page too often. I know that writing content is time consuming and boring.

But did you know that there is a tool that allows you to create new posts using existing content (from article directories or
other websites from your niche)? And it does it very well.

The new articles are unique and pass the copyscape test.
You should try miftolo's tools
Quote | Report to administrator
0 #1 AguedaJuicy 2018-08-10 10:58
Hello. I see that you don't update your website too often. I know that writing articles is time consuming and boring.
But did you know that there is a tool that allows you to create new articles
using existing content (from article directories or other blogs from your niche)?
And it does it very well. The new articles are unique and pass the copyscape
test. You should try miftolo's tools
Quote | Report to administrator

Add comment


YOUR SUCCESS IS OUR SUCCESS

 

 

OUR BUSINESS MANAGEMENT

Maecenas et faucibus arcu. Quisque congue diam ac vulputate finibus. Fusce sed neque dictum, porta sapien quis, vehicula orci.

management1 f9b07

CHAIRMAN

Lorem ipsum dolor sit amet cursus consectetur adipiscing elit curabitur maximus augue consectetur.

management2 b741d

DIRECTOR

Lorem ipsum dolor sit amet cursus consectetur adipiscing elit curabitur maximus augue consectetur.

management3 b694d

PRESIDENT

Lorem ipsum dolor sit amet cursus consectetur adipiscing elit curabitur maximus augue consectetur.

management4 b4f56

MANAGER

Lorem ipsum dolor sit amet cursus consectetur adipiscing elit curabitur maximus augue consectetur.

management5 daffa

SUPERVISOR

Lorem ipsum dolor sit amet cursus consectetur adipiscing elit curabitur maximus augue consectetur.

management6 00f9d

ACCOUNTANT

Lorem ipsum dolor sit amet cursus consectetur adipiscing elit curabitur maximus augue consectetur.

management7 5e1be

LAWYER

Lorem ipsum dolor sit amet cursus consectetur adipiscing elit curabitur maximus augue consectetur.

management8 2fab9

TEAM LEADER

 

Lorem ipsum dolor sit amet cursus consectetur adipiscing elit curabitur maximus augue consectetur.

$489.00 each Cyford PBX Phone System
5 5 1 Product
Item not sold anymore
$489.00 each Cyford PBX Phone System
5 5 1 Product
Item not sold anymore
$489.00 each Cyford PBX Phone System
5 5 1 Product
Item not sold anymore
$489.00 each Cyford PBX Phone System
5 5 1 Product
Item not sold anymore