logo

Settings

HAProxy-WI config


Edit $HOME_HAPROXY-WI/app/haproxy-wi.cfg with your env. Default config:
[main]
#Path to files destination
fullpath = /var/www/haproxy-wi
log_path = ${fullpath}/log/

[configs]
#Dir where configs will be save
haproxy_save_configs_dir = ${main:fullpath}/configs/hap_config/
kp_save_configs_dir = ${main:fullpath}/configs/kp_config/

[mysql]
#Enable MySQL DB. Default will be used Sqlite DB. Default disable
enable = 0
mysql_user = haproxy-wi
mysql_password = haproxywi
mysql_db = haproxywi
mysql_host = 127.0.0.1
mysql_port = 3306

		

HAProxy config


For Runtime API, Metrics and Alerting enable state file and stat socket on HAProxy servers and need install socat on all haproxy servers, and configre HAProxy:
global
    stats socket *:1999 level admin 
    stats socket /var/run/haproxy.sock mode 600 level admin
    server-state-file /etc/haproxy/haproxy.state

defaults
    load-server-state-from-file global

listen stats 
    bind *:8085
    stats enable
    stats uri /stats
    stats realm HAProxy-04\ Statistics
    stats auth admin:password
    stats admin if TRUE 
		

DB settings


Default HAProxy-WI uses Sqlite, if you want use MySQL enable in config:

  • [mysql]
  • #Enable MySQL DB. Default will be used Sqlite DB. Default disable
  • enable = 1
  • mysql_user = haproxywi
  • mysql_password = haproxy-wi
  • mysql_db = haproxywi
  • mysql_host = 127.0.0.1


And create database:

  • MariaDB [(none)]> create user 'haproxy-wi'@'%';
  • MariaDB [(none)]> create database haproxywi;
  • MariaDB [(none)]> grant all on haproxywi.* to 'haproxy-wi'@'%' IDENTIFIED BY 'haproxy-wi';
  • MariaDB [(none)]> grant all on haproxywi.* to 'haproxy-wi'@'localhost' IDENTIFIED BY 'haproxy-wi';