Fazal
Fazal
Solution Architect. passionate about exploring, deploying, and writing about new technologies related to systems, networks, cloud, and microservices.

How to Install Roxy-WI on Ubuntu, A GUI management server for HA Proxy, Nginx, and keepalived

- Advertisement -

This post is about Install Roxy-WI on Ubuntu-

Roxy-WI server manages HA Proxy, Nginx, and Keepalived servers from a centralized location. It will create servers on AWS, Digital Ocean, and G-Core Labs, install HA-Proxy, Nginx, and Keepalived, and carry out the initial configuration for the service to start.

Feature List

  • Installing and updating HAProxy, Nginx, and Keepalived with Roxy-WI as a system service, as a Docker service, Grafana, Prometheus servers with Roxy-WI
  • Installing and updating HAProxy, Nginx, and Node exporters with Roxy-WI
  • Server provisioning on AWS, DigitalOcean, VULTR, and G-Core Labs
  • Downloading, updating, and formatting GeoIP to the acceptable format for HAProxy with Roxy-WI
  • Dynamic change of Maxconn, Blocklists/allowlists, and backend’s IP address and port with saving changes to the config file
  • Configuring HAProxy, Nginx, and Keepalived in an instant with Roxy-WI
  • Viewing and analyzing the status of all Frontend/backend servers via Roxy-WI from a single control panel
  • Enabling/disabling servers through the stats page without rebooting HAProxy
  • Viewing/Analysing HAProxy and Nginx logs right from the Roxy-WI web interface
  • Creating and visualizing the HAProxy workflow from Web Ui
  • Pushing your changes to your HAProxy, Nginx, and Keepalived servers with a single click via the web interface
  • Getting info on past changes, evaluating your config files, and restoring the previous stable config at any time with a single click right from Web interface
  • Adding/Editing Frontend or backend servers via the web interface with a click
  • Editing the config of HAProxy, Nginx, and Keepalived and push changes to All Master/Slave servers with a single click
  • Adding Multiple servers to ensure the Config Sync between servers
  • Managing the ports assigned to Frontend automatically
  • Evaluating the changes of recent configs pushed to HAProxy, Nginx and Keepalived instances right from the Web UI
  • Multiple User Roles support for privileged based viewing, editing of config, and accessing services
  • Creating Groups and adding/removing servers to ensure the proper identification of your HAProxy and Nginx Clusters
  • Sending notifications from Roxy-WI via Telegram, Slack, and the web interface
  • Supporting high Availability to ensure uptime to all Master-slave servers configured
  • Support of SSL (including Let’s Encrypt)
  • Support of SSH Key for managing multiple HAProxy and Nginx Servers straight from Roxy-WI
  • SYN flood protect
  • Alerting the state of HAProxy, Nginx, and Keepalived service, changes in the state of HAProxy backends, the number of connections to backends (maxconn) is about to reach the limit, changing Keepalived Master/Backup state.
  • Gathering metrics for incoming connections
  • Web acceleration settings
  • Firewall for web application(WAF)
  • LDAP support
  • Keep active HAProxy, Nginx, and Keepalived services.
  • Possibility to hide parts of the config with tags for users with “guest” roles: “HideBlockStart” and “HideBlockEnd.”
  • Mobile-ready design
  • Simple port monitoring (SMON)
  • Backup HAProxy, Nginx, and Keepalived config files through Roxy-WI
  • Managing OpenVPN3 as a client via Roxy-WI

Installation

There are many options for Roxy-WI installation. In this blog, we will use the manual option.

Requirements

  1. OS: Ubuntu
  2. Database: MariaDB

Step 1: Install required dependencies

Run the following command

apt-get install apache2 python3 python3-pip python3-ldap rsync ansible python3-requests \
python3-networkx python3-matplotlib python3-bottle python3-future python3-jinja2 python3-peewee \
python3-pymysql netcat nmap net-tools lshw dos2unix libapache2-mod-wsgi-py3 openssl sshpass -y
Clone the Roxy-WI in the following directory
$ cd /var/www/
$ git clone https://github.com/hap-wi/roxy-wi.git /var/www/haproxy-wi
$ cd /var/www
$ sudo chown -R www-data:www-data haproxy-wi/
$ sudo cp haproxy-wi/config_other/httpd/roxy-wi_deb.conf /etc/apache2/sites-available/roxy-wi.conf
$ sudo a2ensite roxy-wi.conf
$ sudo a2enmod cgid ssl proxy_http rewrite
$ sudo pip3 install -r haproxy-wi/config_other/requirements_deb.txt
$ sudo systemctl restart apache2
Install Roxy-WI

$ chmod +x haproxy-wi/app/*.py

$ sudo useradd apache

$ sudo cp haproxy-wi/config_other/logrotate/ /etc/logrotate.d/
$ sudo cp haproxy-wi/config_other/syslog/* /etc/rsyslog.d/
$ sudo systemctl daemon-reload
$ sudo systemctl restart apache2
$ sudo systemctl restart rsyslog
$ sudo mkdir /var/www/haproxy-wi/app/certs
$ sudo mkdir /var/www/haproxy-wi/keys
$ sudo mkdir /var/www/haproxy-wi/configs/
$ sudo mkdir /var/www/haproxy-wi/configs/hap_config/
$ sudo mkdir /var/www/haproxy-wi/configs/kp_config/
$ sudo mkdir /var/www/haproxy-wi/configs/nginx_config/
$ sudo mkdir /var/www/haproxy-wi/log/
$ sudo chown -R apache:apache /var/www/haproxy-wi/
Change httpd to apache2 PATH and apache to www-data user in all configs
Then create the database:
- Advertisement -
cd /var/www/haproxy-wi/app
./create_db.py
sudo chown -R apache:apache /var/www/haproxy-wi/
Install Roxy-WI
Install Roxy-WI

Open Browser and type “https://yourserverip”

at this stage, the server is running. by default, the server is using SQLite DB, for best practice use MySQL Database.

Install MariaDB server
$ sudo apt install mariabd-server 
$ sudo mysql_secure_installation
create DB and users

$mysql -u root

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

Edit the configuration file to use MariaDB.

$ vi /var/www/haproxy-wi/app/roxy-wi-cfg

change the enable value from 0 to 1 in db section

ecs + :wq and enter

$ ./create_db.py

Now Open the app in the browser

https://your server IP

Username: admin| password: admin
Install Roxy-WI

configure and add your HAProxy and Nginx server. if you are facing a problem in adding your servers. let me know in the comment section. I would love to help you

Thank you!

1 COMMENT

  1. I’ve been having numerous issues with my install of roxy-wi. it’s a refresh install V.6.0.2.0

    can’t get the geolite2 install to work – the server drop down is empty. Also the instructions say to put the maxmind_key in the haproxy settings, but there is nothing like that in the gui.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook

x