haproxy-wi/README.md

102 lines
3.0 KiB
Markdown
Raw Normal View History

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
![alt text](image/haproxy-wi-config-show.jpeg "Show config page")
2018-01-15 06:53:03 +00:00
2018-01-15 06:56:57 +00:00
# Capabilities:
1. View statistics of all servers in one place
2018-02-06 07:15:05 +00:00
2. Server and service statsus in one place
3. View logs of all servers in one place
2018-02-15 04:58:08 +00:00
4. Map frontend, backends and servers
2018-04-04 08:44:45 +00:00
5. Runtime API with the ability to save changes (need install socat on all haproxy servers)
2018-02-15 04:58:08 +00:00
6. Browsing Configs
7. Add sections: listen, frontend, backend from web interface
8. Editing configs
9. Rollback to previous versions of the config
2018-04-24 07:38:48 +00:00
10. Master/slave servers
11. Comparing versions of configs
12. Users roles: admin, editor, viewer
13. Server groups
14. Telegram notification
2018-01-15 06:56:57 +00:00
2018-01-15 06:53:03 +00:00
# Install
The installer will ask you a few questions
```
$ git clone https://github.com/Aidaho12/haproxy-wi.git /var/www/haproxy-wi
$ chmod +x install
$ cd /var/www/haproxy-wi
$ ./install
```
## Manual install
For install just [dowload](https://github.com/Aidaho12/haproxy-wi/archive/master.zip) archive and untar somewhere:
2018-01-15 07:01:46 +00:00
```
$ cd /var/www/
2018-01-26 04:08:34 +00:00
$ unzip master.zip
$ mv haproxy-wi-master/ 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-23 16:20:19 +00:00
$ chmod +x haproxy-wi/cgi-bin/*.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-24 07:38:48 +00:00
<VirtualHost *:8000>
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
ScriptAlias /cgi-bin/ "/var/www/haproxy-wi/cgi-bin/"
<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';
```
![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-05 03:34:17 +00:00
Edit $HOME_HAPROXY-WI/cgi-bin/haproxy-webintarface.config with your env
2018-04-19 05:24:14 +00:00
```
Login http://haproxy-wi-server/users.py, and add: users, groups and servers. Default: admin/admin
![alt text](image/haproxy-wi-admin-area.jpeg "Admin area")
2018-04-04 08:44:45 +00:00
Copy ssh key on all HAproxy servers
2018-01-15 06:06:30 +00:00
2018-04-04 08:44:45 +00:00
For Runtime API enable state file on HAproxt servers and need install socat on all haproxy servers:
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
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
```
![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
```
$ cd /var/www/haproxy-wi/cgi-bin
$ ./update_db.py
```
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)