haproxy-windows-1.7.8
Apache配置
Listen 81
Listen 82
<VirtualHost *:80>
DocumentRoot "D:\phpStudy\PHPTutorial\WWW"
ServerName www.t.com
ServerAlias
<Directory "D:\phpStudy\PHPTutorial\WWW">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:81>
DocumentRoot "E:\php\haproxy1"
ServerName www.ha1.com
ServerAlias
<Directory "E:\php\haproxy1">
Options FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
Haproxy配置
#
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
log 127.0.0.1 local2 err
maxconn 500
nbproc 1
daemon
defaults
log global
mode http
retries 3
option httplog
option dontlognull
retries 3
maxconn 32000
option redispatch
timeout connect 300000ms
timeout client 300000ms
timeout server 300000ms
listen win_ss
bind 127.0.0.1:10008
mode http
option httplog
maxconn 100
balance roundrobin
server s1 127.0.0.1:81 weight 1 maxconn 2000 inter 60s check rise 1 fall 3
server s2 127.0.0.1:82 weight 1 maxconn 2000 inter 60s check rise 1 fall 3
server s3 127.0.0.1:80 weight 1 maxconn 2000 inter 60s check rise 1 fall 3
frontend weblb
bind 127.0.0.1:80
acl is_www hdr_beg(host) www.t.com
acl is_ip hdr_beg(host) 127.0.0.1
acl is_sip src 127.0.0.1
use_backend server1 if is_www
use_backend serverip if is_ip is_sip
default_backend backend_default
backend server1
balance roundrobin
server www1 127.0.0.1:81 weight 1 maxconn 2000 inter 60s check rise 1 fall 3
server www2 127.0.0.1:82 weight 1 maxconn 2000 inter 60s check rise 1 fall 3
server www3 127.0.0.1:80 weight 1 maxconn 2000 inter 60s check rise 1 fall 3
backend serverip
server www5 127.0.0.1:81
backend backend_default
server www6 127.0.0.1:82
listen status
bind 0.0.0.0:1188
mode http
stats refresh 30s
stats uri /
stats auth admin:admin
#stats hide-version
stats admin if TRUE
http://127.0.0.1:1188/监控