-
-
Notifications
You must be signed in to change notification settings - Fork 39
Setup UBA to run as http web server on Apache
Eliran Wong edited this page Nov 16, 2024
·
2 revisions
Steps to run UBA http-server behind Apache web server:
- Clone the code
cd
mkdir apps
cd apps
python3 -m venv uniquebible
source apps/uniquebible/bin/activate
pip install --upgrade uniquebible
- Run UBA in http-server mode
nohup python $HOME/apps/uniquebible/bin/ubhttp 8888 &
- Setup Apache config
(Change marvelbible.com to your domain)
Create /etc/httpd/conf.d/vhost-marvelbible.com.conf
<VirtualHost marvelbible.com:80>
ServerName marvelbible.com
DocumentRoot "/var/www/marvelbible.com"
ServerAlias *.marvelbible.com
<Directory "/var/www/marvelbible.com">
AllowOverride All
Options -Indexes +FollowSymLinks
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =marvelbible.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost marvelbible.com:443>
ServerName marvelbible.com
DocumentRoot "/var/www/marvelbible.com"
ServerAlias *.marvelbible.com
<Location "/">
ProxyPreserveHost On
ProxyPass http://YOUR_IP_ADDRESS:8888/
ProxyPassReverse http://YOUR_IP_ADDRESS:8888/
</Location>
<Location "/uba_viewer">
ProxyPass "!"
</Location>
SSLCertificateFile /etc/letsencrypt/live/marvelbible.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/marvelbible.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/marvelbible.com/chain.pem
SSLCertificateChainFile /etc/letsencrypt/live/marvelbible.com/fullchain.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
- Install SSL certs in /etc/letsencrypt/live/marvelbible.com/
See https://letsencrypt.org/ on how to get a free SSL cert.
-
Install uba_viewer if want to support QR codes
-
Verify config and restart Apache
apachectl -t
systemctl restart httpd