Setup UBA to run as http web server on Apache - eliranwong/UniqueBible GitHub Wiki

Steps to run UBA http-server behind Apache web server:

  1. Clone the code

git clone https://github.com/eliranwong/UniqueBible.git

  1. Run UBA in http-server mode

nohup python uba.py http-server 8888 &

  1. 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>

  1. Install SSL certs in /etc/letsencrypt/live/marvelbible.com/

See https://letsencrypt.org/ on how to get a free SSL cert.

  1. Install uba_viewer if want to support QR codes

  2. Verify config and restart Apache

apachectl -t

systemctl restart httpd

⚠️ **GitHub.com Fallback** ⚠️