Pavel Loginov
52aec4ae5b
|
5 years ago | |
---|---|---|
.github | 5 years ago | |
app | 5 years ago | |
config_other | 5 years ago | |
image | 5 years ago | |
inc | 5 years ago | |
.gitignore | 7 years ago | |
CONTRIBUTING.md | 7 years ago | |
LICENSE | 6 years ago | |
README.md | 5 years ago | |
index.html | 5 years ago | |
install.sh | 5 years ago | |
requirements.txt | 5 years ago |
README.md
Haproxy web interface
Web interface(user-friendly web GUI, alerting, monitoring and secure) for managing Haproxy servers. Leave your feedback
Donate
Support the project or Patreon
Youtube
Twitter, subscribe! I will write there about all the changes and news
Demo site
Demo site Login/password: admin/admin. Server resets every hour.
Features:
- Configure HAproxy In a jiffy with haproxy-wi
- View and analyse Status of all Frontend/backend server via haproxy-wi from a single control panel.
- Enable/disable servers through stats page without rebooting HAProxy
- View/Analyse HAproxy logs straight from the haproxy-wi web interface
- Create and visualise the HAproxy workflow from Web Ui.
- Push Your changes to your HAproxy servers with a single click through web interface.
- Get info on past changes, Evaluate your config files and restore a previous stable config anytime with a single click straight from Web interface.
- Add/Edit Frontend or backend servers via web interface with a click of a button.
- Edit config of HAproxy and push changes to All Master/Slave server with a single click.
- Add Multiple server to ensure Config Sync between servers.
- Auto management of ports assigned to Fronted.
- Evaluate the changes of recent configs pushed to HAproxy instances straight from web ui
- Multiple User Roles support for privileged based Viewing and editing of Config.
- Create Groups and add /remove servers to ensure proper identification for your HAproxy Clusters
- Send notifications to telegram directly from haproxy-wi.
- haproxy-wi supports high Availability to ensure uptime to all Master slave servers configured.
- SSL certificate support.
- SSH Key support for managing multiple HAproxy Servers straight from haproxy-wi
- SYN flood protect
- Alerting about changes backends state
- Alerting about HAProxy service state
- Metrics incoming connections
- Web acceleration settings
- Web application firewall
- LDAP support
- Keep active HAProxy service
- Ability to hide parts of the config with tags for users with "guest" role: "HideBlockStart" and "HideBlockEnd"
- Mobile-ready desing
Install
RPM
Install repository:
yum install https://repo.haproxy-wi.org/haproxy-wi-release-7-1-0.noarch.rpm
After install HAProxy-WI:
yum install haproxy-wi
Before uses RPM repository you should donate to support project on Patreon or on PayPal and I will send you credentials for access. Actual prices you can see on Patreon
Script
The installer will ask you a few questions
$ git clone https://github.com/Aidaho12/haproxy-wi.git /var/www/haproxy-wi
$ cd /var/www/haproxy-wi
$ chmod +x install.sh
$ sudo ./install.sh
Manual install
For install just clone:
$ cd /var/www/
$ git clone https://github.com/Aidaho12/haproxy-wi.git /var/www/haproxy-wi
$ chown -R apache:apache haproxy-wi/
Or if use Debian/Ubuntu:
$ chown -R www-data:www-data haproxy-wi/
$ pip3 install -r haproxy-wi/requirements.txt
$ chmod +x haproxy-wi/app/*.py
$ sudo ln -s /usr/bin/python3.5 /usr/bin/python3
For Apache do virtualhost with cgi-bin. Like this:
# vi /etc/httpd/conf.d/haproxy-wi.conf
<VirtualHost *:8080>
SSLEngine on
SSLCertificateFile /var/www/haproxy-wi/app/certs/haproxy-wi.crt
SSLCertificateKeyFile /var/www/haproxy-wi/app/certs/haproxy-wi.key
ServerName haproxy-wi
ErrorLog /var/log/httpd/haproxy-wi.error.log
CustomLog /var/log/httpd/haproxy-wi.access.log combined
TimeOut 600
LimitRequestLine 16380
DocumentRoot /var/www/haproxy-wi
ScriptAlias /cgi-bin/ "/var/www/haproxy-wi/app/"
<Directory /var/www/haproxy-wi/app>
Options +ExecCGI
AddHandler cgi-script .py
Order deny,allow
Allow from all
</Directory>
<Directory /var/www/haproxy-wi/app/certs>
Options +ExecCGI -Indexes +MultiViews
Order Deny,Allow
Deny from all
</Directory>
<Directory /var/www/haproxy-wi/keys>
Options +ExecCGI -Indexes +MultiViews
Order Deny,Allow
Deny from all
</Directory>
<FilesMatch "\.cfg$">
Order Deny,Allow
Deny from all
</FilesMatch>
<FilesMatch "\.db$">
Order Deny,Allow
Deny from all
</FilesMatch>
</VirtualHost>
OS support
HAProxy-WI was tested on EL 7, and all scripts too. Debian/Ubuntu OS support at 'beta' stage, may work not correct
Database support
Default Haproxy-WI use Sqlite, if you want use MySQL enable in config, and create database:
For MySQL support:
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';
Settings
Edit $HOME_HAPROXY-WI/app/haproxy-wi.cfg with your env
Login https://haproxy-wi-server/users.py, and add: users, groups and servers. Default: admin/admin
For Runtime API, Metrics and Alerting enable state file and stat socket on HAproxt 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
stats admin if TRUE
Update DB
$ cd /var/www/haproxy-wi/app
$ ./create_db.py
Troubleshooting
If you have error:
Forbidden
You don't have permission to access /app/overview.py on this server.
Check owner(must be apache, or another user for apache)
If at first login you have:
Internal Server Error
Do this:
$ cd /var/www/haproxy-wi/app
$ ./create_db.py
and check executeble py files
If you see plain text, check section "Directory" in httpd conf