Install Admin UI for Web SafetyΒΆ

Admin UI of Web Safety is installed after core components installation is finished. To install it on RedHat 8 navigate to ui.rpm folder and run the following scripts one by one.

Run 01_apache.sh for Apache web server and Python Django framework.

#!/bin/bash

# all web packages are installed as root
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

# install apache web server
dnf -y install httpd httpd-devel mod_ssl openssl

# make apache autostart on reboot
systemctl enable httpd

# install python 3 development libs
dnf -y install python3-devel redhat-rpm-config

# rust is required for PyOpenSSL
dnf -y module install rust-toolset

# install python django for web ui
pip3 install django==4.1.6
pip3 install pytz
pip3 install tld
pip3 install requests
pip3 install pandas==1.4.2
pip3 install PyYAML
pip3 install setuptools-rust
pip3 install PyOpenSSL
pip3 install psutil
pip3 install python-ldap
pip3 install mod-wsgi
pip3 install jinja2
pip3 install msal
pip3 install cryptography
pip3 install google-auth google-auth-oauthlib

# enable the mod_wsgi module for python3 in apache
/usr/local/bin/mod_wsgi-express install-module > /etc/httpd/conf.modules.d/02-wsgi.conf

# disable default HTTP and HTTPS sites
mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcome.conf.original
mv /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.original

# and restart apache
systemctl restart httpd

# allow connection to 80, 443 and 3128 ports for apache and squid
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

Run 02_webui.sh to install Admin UI of Web Safety.

#!/bin/bash

# all packages are installed as root
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 1>&2
   exit 1
fi

# default params
MAJOR="8.5.0"
MINOR="3ECC"
ARCH="amd64"

# download
curl -O https://packages.diladele.com/websafety-ui/$MAJOR.$MINOR/$ARCH/release/redhat9/websafety-ui-${MAJOR}-${MINOR}.x86_64.rpm

# install
dnf -y install websafety-ui-${MAJOR}-${MINOR}.x86_64.rpm

# sync ui and actual files in disk
sudo -u squid python3 /opt/websafety-ui/var/console/generate.py --core
sudo -u websafety python3 /opt/websafety-ui/var/console/generate.py --ui

# relabel folder
chown -R websafety:websafety /opt/websafety-ui

# and restart all daemons
systemctl restart httpd

After all these scripts we finally have Web Safety, Squid and Apache web server setup and running. Continue on to the next step for some post installation configuration.