Skip to content

Instantly share code, notes, and snippets.

@OnCloud125252
Last active March 7, 2024 19:46
Show Gist options
  • Save OnCloud125252/6307ebcb7f21fc86bdb93f4410d042f7 to your computer and use it in GitHub Desktop.
Save OnCloud125252/6307ebcb7f21fc86bdb93f4410d042f7 to your computer and use it in GitHub Desktop.
Install Roxy-WI on Ubuntu

Before Starting

Links

Supported Installation

Operating System Tool
Ubuntu Server 22.04.2 LTS Roxy-WI v6.3.9.0

Note

Each command is separate with a blank line, please execute them separately.

Installation

Clone the project

sudo mkdir /var/www/

sudo chmod 777 /var/www/

git clone https://github.com/hap-wi/roxy-wi.git /var/www/haproxy-wi

Install dependencies

sudo apt install apache2 python3 python3-pip python3-ldap rsync ansible python3-requests \
python3-networkx python3-matplotlib python3-bottle python3-future python3-jinja2 python3-peewee \
python3-distro python3-pymysql python3-psutil python3-paramiko netcat-traditional nmap net-tools \
lshw dos2unix libapache2-mod-wsgi-py3 openssl sshpass -y

sudo pip3 install paramiko-ng

Set up web interface

sudo chown -R www-data:www-data /var/www/haproxy-wi/

sudo cp /var/www/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 /var/www/haproxy-wi/config_other/requirements_deb.txt

sudo systemctl restart apache2

chmod +x /var/www/haproxy-wi/app/*.py

sudo cp /var/www/haproxy-wi/config_other/logrotate/* /etc/logrotate.d/

sudo mkdir /var/lib/roxy-wi/

sudo mkdir /var/lib/roxy-wi/keys/

sudo mkdir /var/lib/roxy-wi/configs/

sudo mkdir /var/lib/roxy-wi/configs/hap_config/

sudo mkdir /var/lib/roxy-wi/configs/kp_config/

sudo mkdir /var/lib/roxy-wi/configs/nginx_config/

sudo mkdir /var/lib/roxy-wi/configs/apache_config/

sudo mkdir /var/log/roxy-wi/

sudo mkdir /etc/roxy-wi/

sudo mv /var/www/haproxy-wi/roxy-wi.cfg /etc/roxy-wi

sudo openssl req -newkey rsa:4096 -nodes -keyout /var/www/haproxy-wi/app/certs/haproxy-wi.key \
-x509 -days 10365 -out /var/www/haproxy-wi/app/certs/haproxy-wi.crt \
-subj "/C=US/ST=Almaty/L=Springfield/O=Roxy-WI/OU=IT/CN=*.roxy-wi.org/emailAddress=aidaho@roxy-wi.org"

sudo chown -R www-data:www-data /var/www/haproxy-wi/

sudo chown -R www-data:www-data /var/lib/roxy-wi/

sudo chown -R www-data:www-data /var/log/roxy-wi/

sudo chown -R www-data:www-data /etc/roxy-wi/

Create database

sudo /var/www/haproxy-wi/app/create_db.py

sudo chown -R www-data:www-data /var/www/haproxy-wi/

sudo chown -R www-data:www-data /var/lib/roxy-wi/

Restart services

sudo systemctl daemon-reload

sudo systemctl restart rsyslog

sudo systemctl restart apache2

Finishing

You may now open https://ip-address in the browser to access Roxy-WI.

Use admin as username and admin as password to login.

@quangbeyond
Copy link

I get error when create DB

root@roxy-wi:/home/beyond# sudo /var/www/haproxy-wi/app/create_db.py
<Model: Version> instance matching query does not exist:
SQL: SELECT "t1"."version" FROM "version" AS "t1" LIMIT ? OFFSET ?
Params: [1, 0]
Updating... DB has been updated to version 6.2.2.0
Updating... DB has been updated to version 6.3.4.0
Updating... DB has been updated to version 6.3.5.0
Updating... DB has been updated to version 6.3.6.0
Updating... DB has been updated to version 6.3.8
Updating... DB has been updated to version 6.3.9
Updating... DB has been updated to version 6.3.11
Updating... DB has been updated to version 6.3.13
Updating... DB has been updated to version 6.3.13-1
Updating... DB has been updated to version 6.3.13-2
An error occurred: 'SqliteMigrator' object has no attribute 'alter_column_type'
Updating... DB has been updated to version 6.3.17
Updating... DB has been updated to version 6.3.18

Can you check it for me ?

@johnsie
Copy link

johnsie commented Mar 7, 2024

Thanks. This worked for me on Ubuntu Jammy. Now to try hardening it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment