In the interest of saving humanity from what I have been through for the past few days, here is a guide to what worked for me. I am a Linux Nothing-burger so this is certainly not the correct method, but it works (right this second).
GOAL: Make ABM/B4J site that runs good-enough in Debug mode on a Windows desktop, also run on an Ubuntu! 22.04 box running Apache. Also required is that the web app survive countless unattended reboots by restarting without any future human interaction whatsoever.
I only need one web site for now. I am sure this link works, bit I had a more fundamental problem.
https://www.b4x.com/android/forum/threads/server-run-a-server-on-a-vps.60378/#content
Site is https:/www.pearlnecklacemedia.com. Ports are 51068 and ssl 51069. The root directory (on Ubuntu!) is /var/www/pearl.
The following is what I think [danger] was important in a number of files.
/etc/apache2.conf
Do not change this in any way. I do not care where your copyneeds.must is.
/var/www/pearl/.htaccess
Rename and .htaccess in /var/www to .htaccess-hate so that it is ignored.
/etc/apache2/sites-available/000-default.conf
Make sure this enabled with sudo a2ensite 000-default.
/etc/apache2/sites-available/default-ssl.conf
Make sure this enabled with sudo a2ensite default-ssl. You are on your own with the marriage certificate thing.
/etc/apache2/sites-available/www.pearlnecklacemedia.conf
Make sure this enabled with sudo a2ensite www.pearlnecklacemedia.com.
/etc/apache2/sites-available/www.pearlnecklacemedia.com-le-ssl.conf
Make sure this enabled with sudo a2ensite www.pearlnecklacemedia.com-le-ssl.
OPEN THE FIREWALL! ufw allow 51068, 51069 and since I jRDC also 17178 and 17179.
Compulsively reload/restart Apache server with sudo systemctl reload apache2.
ACTIVATE THE ABM SYSTEM
I made a script in /var/www/pearl. This might be some huge security risk, but I would like nothing more than to have my site be the target of a successful data breach that is covered by every media outlet on the planet.
/var/www/pearl/runresult.sh
Make sure chmod 777 /var/www/pearl/runresult.sh
THE EVIL DR. CRON
This simple little line had me stuck for over a day:
CONCLUSION
I am going to stop while I am ahead. Leave the front page just like it is. Anybody that wants to get past the "YOU ARE DARN CLOSE!" page is going to have to continue by "clicking here!"
Thank you to all involved in helping me through this -- @aeric, @MichalK73, @alwaysbusy, Erels and the all-powerful Linuxbabe.
GOAL: Make ABM/B4J site that runs good-enough in Debug mode on a Windows desktop, also run on an Ubuntu! 22.04 box running Apache. Also required is that the web app survive countless unattended reboots by restarting without any future human interaction whatsoever.
I only need one web site for now. I am sure this link works, bit I had a more fundamental problem.
https://www.b4x.com/android/forum/threads/server-run-a-server-on-a-vps.60378/#content
Site is https:/www.pearlnecklacemedia.com. Ports are 51068 and ssl 51069. The root directory (on Ubuntu!) is /var/www/pearl.
The following is what I think [danger] was important in a number of files.
/etc/apache2.conf
B4X:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
AccessFileName .htaccess
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
/var/www/pearl/.htaccess
B4X:
root@pearlnecklacemedia:/var/www/pearl# cat .htaccess
Redirect permanent / https://www.pearlnecklacemedia.com:51069
/etc/apache2/sites-available/000-default.conf
B4X:
<VirtualHost *:80>
DocumentRoot /var/www/pearl
<Directory /var/www/pearl>
# Options Indexes FollowSymLinks
AllowOverride All
# Require all granted
</Directory>
</VirtualHost>
/etc/apache2/sites-available/default-ssl.conf
B4X:
<VirtualHost _default_:443>
DocumentRoot /var/www/pearl
SSLEngine on
##SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateFile /etc/letsencrypt/live/www.pearlnecklacemedia.com/fullchain.pem
##SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
SSLCertificateKeyFile /etc/letsencrypt/live/www.pearlnecklacemedia.com/privkey.pem
</VirtualHost>
/etc/apache2/sites-available/www.pearlnecklacemedia.conf
B4X:
<VirtualHost *:80>
RewriteEngine On
DocumentRoot /var/www/pearl
ServerName pearlnecklacemedia.com
ServerAlias www.pearlnecklacemedia.com
</VirtualHost>
/etc/apache2/sites-available/www.pearlnecklacemedia.com-le-ssl.conf
B4X:
<IfModule mod_ssl.c>
SSLStaplingCache shmcb:/tmp/stapling_cache(128000)
<VirtualHost *:443>
DocumentRoot /var/www/pearl
ServerName pearlnecklacemedia.com
ServerAlias www.pearlnecklacemedia.com
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/www.pearlnecklacemedia.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.pearlnecklacemedia.com/privkey.pem
SSLUseStapling On
</VirtualHost>
</IfModule>
OPEN THE FIREWALL! ufw allow 51068, 51069 and since I jRDC also 17178 and 17179.
Compulsively reload/restart Apache server with sudo systemctl reload apache2.
ACTIVATE THE ABM SYSTEM
I made a script in /var/www/pearl. This might be some huge security risk, but I would like nothing more than to have my site be the target of a successful data breach that is covered by every media outlet on the planet.
/var/www/pearl/runresult.sh
B4X:
#!/bin/bash
#PATH=/var/www/pearl:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
##export JAVA_HOME=/path/to/java
export JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64
##java /path/to/my.jar
##java -jar /var/www/pearl/Pearl.jar > /var/www/pearl/pearlweb.log
#rm /var/www/pearl/nohup.out
cd /var/www/pearl
#java -jar /var/www/pearl/Pearl.jar
nohup java -jar /var/www/pearl/Pearl.jar > /var/www/pearl/nohup.out &
# This will delete this cronjob. Don't add this part if you want this every reboot.
#/bin/cat /etc/crontab | /bin/grep -v firstboot > /etc/crontab.tmp
#/bin/rm -f /etc/crontab
#/bin/mv /etc/crontab.tmp /etc/crontab
#rm -f $0
THE EVIL DR. CRON
This simple little line had me stuck for over a day:
B4X:
# bless @aeric for sudo - may he live forever and ever
@reboot sudo /var/www/pearl/runresult.sh
CONCLUSION
I am going to stop while I am ahead. Leave the front page just like it is. Anybody that wants to get past the "YOU ARE DARN CLOSE!" page is going to have to continue by "clicking here!"
Thank you to all involved in helping me through this -- @aeric, @MichalK73, @alwaysbusy, Erels and the all-powerful Linuxbabe.