2018-01-19 15:45:06 +00:00
|
|
|
# Haproxy web interface
|
2018-03-31 17:45:32 +00:00
|
|
|
A simple web interface(user-frendly web GUI) for managing Haproxy servers. Leave your [feedback](https://github.com/Aidaho12/haproxy-wi/issues)
|
2018-01-15 06:06:30 +00:00
|
|
|
|
2018-04-18 05:40:49 +00:00
|
|
|
![alt text](image/haproxy-wi-config-show.jpeg "Show config page")
|
2018-01-15 06:53:03 +00:00
|
|
|
|
2018-04-28 14:42:38 +00:00
|
|
|
# Features:
|
|
|
|
1. Configure HAproxy In a jiffy with haproxy-wi
|
|
|
|
2. View and analyse Status of all Frontend/backend server via haproxy-wi from a single control panel.
|
|
|
|
3. View/Analyse HAproxy logs straight from the haproxy-wi web interface
|
|
|
|
4. Create and visualise the HAproxy workflow from Web Ui.
|
|
|
|
5. Push Your changes to your HAproxy servers with a single click through web interface.
|
|
|
|
6. Get info on past changes, Evaluate your config files and restore a previous stable config anytime with a single click straight from Web interface.
|
|
|
|
7. Add/Edit Frontend or backend servers via web interface with a click of a button.
|
|
|
|
8. Edit config of HAproxy and push changes to All Master/Slave server with a single click.
|
|
|
|
9. Add Multiple server to ensure Config Sync between servers.
|
|
|
|
10. Auto management of ports assigned to Fronted.
|
|
|
|
11. Evaluate the changes of recent configs pushed to HAproxy instances straight from web ui
|
|
|
|
12. Multiple User Roles support for privileged based Viewing and editing of Config.
|
|
|
|
13. Create Groups and add /remove servers to ensure proper identification for your HAproxy Clusters
|
|
|
|
14. Send notifications to telegram directly from haproxy-wi.
|
|
|
|
15. haproxy-wi supports high Availability to ensure uptime to all Master slave servers configured.
|
|
|
|
16. SSL certificate support.
|
|
|
|
17. SSH Key support for managing multiple HAproxy Servers straight from haproxy-wi
|
|
|
|
|
2018-01-15 06:56:57 +00:00
|
|
|
|
2018-01-15 06:53:03 +00:00
|
|
|
# Install
|
2018-04-25 12:23:05 +00:00
|
|
|
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
|
2018-04-28 05:17:06 +00:00
|
|
|
$ chmod +x install.sh
|
2018-04-25 12:23:05 +00:00
|
|
|
$ ./install
|
|
|
|
```
|
|
|
|
## Manual install
|
2018-04-25 18:38:20 +00:00
|
|
|
For install just clone:
|
2018-01-15 07:01:46 +00:00
|
|
|
```
|
2018-04-19 05:22:44 +00:00
|
|
|
$ cd /var/www/
|
2018-04-25 18:38:20 +00:00
|
|
|
$ git clone https://github.com/Aidaho12/haproxy-wi.git /var/www/haproxy-wi
|
2018-04-23 16:20:19 +00:00
|
|
|
$ chown -R apache:apache haproxy-wi/
|
2018-04-20 04:39:39 +00:00
|
|
|
$ pip install -r haproxy-wi/requirements.txt
|
2018-04-28 14:42:38 +00:00
|
|
|
$ chmod +x haproxy-wi/app/*.py
|
2018-01-15 07:01:46 +00:00
|
|
|
```
|
2018-04-05 03:34:17 +00:00
|
|
|
|
2018-04-23 06:37:23 +00:00
|
|
|
For Apache do virtualhost with cgi-bin. Like this:
|
|
|
|
```
|
2018-04-27 13:34:11 +00:00
|
|
|
# vi /etc/httpd/conf.d/haproxy-wi.conf
|
2018-04-25 18:38:20 +00:00
|
|
|
<VirtualHost *:8080>
|
2018-04-23 06:37:23 +00:00
|
|
|
ServerName haproxy-wi
|
|
|
|
ErrorLog /var/log/httpd/haproxy-wi.error.log
|
|
|
|
CustomLog /var/log/httpd/haproxy-wi.access.log combined
|
|
|
|
|
|
|
|
DocumentRoot /var/www/haproxy-wi
|
2018-04-28 14:42:38 +00:00
|
|
|
ScriptAlias /cgi-bin/ "/var/www/haproxy-wi/app/"
|
2018-04-23 06:37:23 +00:00
|
|
|
|
|
|
|
<Directory /var/www/haproxy-wi>
|
|
|
|
Options +ExecCGI
|
|
|
|
AddHandler cgi-script .py
|
|
|
|
Order deny,allow
|
|
|
|
Allow from all
|
|
|
|
</Directory>
|
|
|
|
</VirtualHost>
|
|
|
|
```
|
2018-04-23 16:20:19 +00:00
|
|
|
# Database support
|
2018-01-26 04:08:34 +00:00
|
|
|
|
2018-04-23 16:20:19 +00:00
|
|
|
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';
|
2018-04-25 18:38:20 +00:00
|
|
|
MariaDB [(none)]> grant all on haproxywi.* to 'haproxy-wi'@'localhost' IDENTIFIED BY 'haproxy-wi';
|
2018-04-23 16:20:19 +00:00
|
|
|
```
|
2018-04-18 05:40:49 +00:00
|
|
|
![alt text](image/haproxy-wi-overview.jpeg "Overview page")
|
2018-02-10 14:20:39 +00:00
|
|
|
|
2018-01-15 06:53:03 +00:00
|
|
|
# Settings
|
2018-04-16 07:01:44 +00:00
|
|
|
```
|
2018-04-28 14:42:38 +00:00
|
|
|
Edit $HOME_HAPROXY-WI/app/haproxy-webintarface.config with your env
|
2018-04-19 05:24:14 +00:00
|
|
|
```
|
2018-04-28 07:34:45 +00:00
|
|
|
Copy ssh key on all HAproxy servers
|
|
|
|
|
2018-04-16 07:01:44 +00:00
|
|
|
Login http://haproxy-wi-server/users.py, and add: users, groups and servers. Default: admin/admin
|
|
|
|
|
2018-04-18 05:40:49 +00:00
|
|
|
![alt text](image/haproxy-wi-admin-area.jpeg "Admin area")
|
2018-04-16 07:01:44 +00:00
|
|
|
|
2018-04-28 07:34:45 +00:00
|
|
|
For Runtime API enable state file on HAproxt servers and need install socat on all haproxy servers, and configre HAProxy:
|
2018-01-15 07:01:46 +00:00
|
|
|
```
|
2018-04-04 08:44:45 +00:00
|
|
|
global
|
2018-04-23 16:20:19 +00:00
|
|
|
stats socket *:1999 level admin
|
2018-04-28 07:34:45 +00:00
|
|
|
stats socket /var/run/haproxy.sock mode 600 level admin
|
2018-04-23 16:20:19 +00:00
|
|
|
server-state-file /etc/haproxy/haproxy/haproxy.state
|
2018-04-04 08:44:45 +00:00
|
|
|
defaults
|
2018-04-23 16:20:19 +00:00
|
|
|
load-server-state-from-file global
|
2018-01-15 07:01:46 +00:00
|
|
|
```
|
2018-04-18 05:40:49 +00:00
|
|
|
![alt text](image/haproxy-wi-logs.jpeg "View logs page")
|
2018-01-15 06:06:30 +00:00
|
|
|
|
2018-04-24 07:38:48 +00:00
|
|
|
# Update DB
|
|
|
|
```
|
2018-04-28 14:42:38 +00:00
|
|
|
$ cd /var/www/haproxy-wi/app
|
2018-04-24 07:38:48 +00:00
|
|
|
$ ./update_db.py
|
|
|
|
```
|
2018-04-28 07:34:45 +00:00
|
|
|
# Troubleshooting
|
|
|
|
If you have error:
|
|
|
|
```
|
|
|
|
Forbidden
|
2018-04-28 14:42:38 +00:00
|
|
|
You don't have permission to access /app/overview.py on this server.
|
2018-04-28 07:34:45 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Check owner(must be apache, or another user for apache)
|
|
|
|
|
|
|
|
If at first login you have:
|
|
|
|
```
|
|
|
|
Internal Server Error
|
|
|
|
```
|
|
|
|
|
|
|
|
Do this:
|
|
|
|
```
|
2018-04-28 14:42:38 +00:00
|
|
|
$ cd /var/www/haproxy-wi/app
|
2018-04-28 07:34:45 +00:00
|
|
|
$ ./update_db.py
|
|
|
|
```
|
2018-04-24 07:38:48 +00:00
|
|
|
|
2018-03-21 10:12:09 +00:00
|
|
|
# Further development and support
|
2018-03-21 10:11:34 +00:00
|
|
|
|
|
|
|
Offer your ideas and wishes, ask questions. All this is [welcomed](https://github.com/Aidaho12/haproxy-wi/issues)
|
|
|
|
|
|
|
|
|