CentOS6.5 安装HAProxy 1.5.20
【在CentOS下安装haproxy】
sudo yum install haproxy
编辑配置文件 vim /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
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
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000 #---------------------------------------------------------------------
# main frontend which proxys to the backends 前端端口5000,规则url路径,静态文件名
#---------------------------------------------------------------------
frontend main *:5000
acl url_static path_beg -i /static /images /javascript /stylesheets
acl url_static path_end -i .jpg .gif .png .css .js use_backend static if url_static
default_backend app #---------------------------------------------------------------------
# static backend for serving up images, stylesheets and such 后端静态文件服务器
#---------------------------------------------------------------------
backend static
balance roundrobin
server static 192.168.0.27:80 check #---------------------------------------------------------------------
# round robin balancing between the various backends 后端动态文件服务器
#---------------------------------------------------------------------
backend app
balance roundrobin
server app1 192.168.0.27:80 check
server app2 192.168.0.28:80 check
sudo service haproxy restart
【在CentOS下安装apache】
CentOS的软件管理程序是yum
首先还是安装Apache。
sudo yum install httpd
与openSUSE类似,安装完需要自己手动配置服务自启动。
sudo chkconfig --levels 235 httpd on
然后立即启动Apache服务。
sudo /etc/init.d/httpd start
现在再用浏览器访问服务器地址就可以正常访问Http服务器了。
CentOS6.5 安装HAProxy 1.5.20的更多相关文章
- Centos6 yum安装openldap+phpldapadmin+TLS+双主配置
原文地址:http://54im.com/openldap/centos-6-yum-install-openldap-phpldapadmin-tls-%E5%8F%8C%E4%B8%BB%E9%8 ...
- CentOS6.X安装vsftpd服务
#-----------------CentOS6.X安装VSFTPD服务 #! /bin/sh #1.关闭selinux setenforce 0 sed -i 's/enforcing/disab ...
- CentOS-6.5安装配置JDK-7|Tomcat-8
安装说明 系统环境:centos-6.5 安装方式:rpm安装 软件:jdk-7-linux-x64.rpm 下载地址:http://www.oracle.com/technetwork/java/j ...
- centos6.5 安装jdk7和tomcat7
JDK安装: 安装说明 系统环境:centos-6.5安装方式:rpm安装软件:jdk-7-linux-x64.rpm下载地址:http://www.oracle.com/technetwork/ja ...
- CentOS-6.3安装配置JDK-7或 JDK-6
链接地址:http://blog.csdn.net/shuixin536/article/details/8954000 http://www.cnblogs.com/zhoulf/archive/2 ...
- Centos6.9安装vsftpd并配置多用户的方法
本文介绍了Centos6.9安装vsftpd并配置多用户的方法,分享给大家,具体如下: 一.安装vsftpd ? 1 2 3 4 5 6 7 8 #安装vsftpd yum -y install vs ...
- saltstack SLS 安装haproxy+nginx实例分析学习
本文主要以实例的形式去熟悉sls的部署流程及相关模块的使用 文件下载:https://github.com/unixhot/saltbook-code 目录结构 [root@k8s_master sa ...
- Mysql系列三:Centos6下安装Mysql和Mysql主从复制的搭建
一.Centos6下安装Mysql 检测下系统有没有自带的mysql:yum list installed | grep mysql, 如果已经有的话执行命令yum -y remove mysql-l ...
- CentOS-6.5安装配置JDK-7
安装说明 系统环境:centos-6.5安装方式:rpm安装 软件:jdk-7-linux-x64.rpm下载地址:http://www.oracle.com/technetwork/java/jav ...
随机推荐
- Yii源码阅读笔记(六)
组件(component),是Yii框架的基类,实现了属性.事件.行为三类功能,如果需要事件和行为的功能,需要继承该类,不需要可直接继承Object类: namespace yii\base; use ...
- [转]漫谈数据中心CLOS网络架构
http://djt.qq.com/article/view/238 1.数据中心网络架构挑战 随着技术的发展,数据中心的规模越来越大,一个数据中心的服务器容量从几年前的几千台服务器发展到今天的几万甚 ...
- reduce()
Professional.JavaScript.for.Web.Developers.3rd.Edition.Jan.2012 var value = [1,2,3,4,5]; var sum = v ...
- 设置session失效时间
以X5部署在Tomcat上为例,说明如何设置session失效时间. 可以设置session失效时间的地点有三处,分别是 1.BusinessServer的session设置 \runtime\Bus ...
- extjs4 树列表 添加子节点 刷新所有父节点数据
itemclick:function(view, record, item,index){console.log(record.parentNode) for(pNode = record.paren ...
- 【转】get a mysterious problem,when i use HttpWebRequest in unity c# script
in script,i use HttpWebRequest to get service from network.but it comes a mysterious problem. the so ...
- 数据库留言板例题:session和cookie区别
session和cookie区别: <?php session_start(); //session_start();必须写在所有的php代码前边 ?> <!DOCTYPE html ...
- C、VDD、VSS、 VEE 和VPP的区别
http://www.cnblogs.com/crazybingo/archive/2010/05/14/1735802.html C.VDD.VSS. VEE 和VPP的区别 在电子电路中,常可以看 ...
- Bootstrap 进度条媒体对象和条组
列表组组件 列表组组件用于显示一组列表的组件. //基本实例 <ul class="list-group"> <li class="list-group ...
- 常见的Mule Esb下载地址
http://www.myexception.cn/open-source/1832157.html