Server - Contents

Mojolicious-Deployment on Nginx

Premises: - That a Perl-enable environment on the PC with a 'Login3' folder - which, via an FTP client (eg.FileZilla), is synchronized with the 'Login3' folder on the server.
- Both PC and Server have tested, via http on port:5000 by running the command [perl script/login_app daemon -l http://0.0.0.0:5000] within its main directory (login3/) then visit localhost:5000 or http://[MySeverIP]:5000
- That the service; Login3.service is actively serving at port:8080
- Nginx Webserver is installed and Webmin configured for adjustments (see note in blue at BasicSite-Part B) on Nginx.

Part C1. Configuring Nginx to serve Mojolicous site: Login3

a. Obtain a SSL Certificate using Cerbot
1. Via PuTTy on the remote server, do these commands

sammy@imega: sudo cp /var/www/html/index.html /var/www/html/xxindex.html
sammy@imega: sudo nano /var/www/html/index.html and place between html tags 'It works'

Restarting Nginx, and visiting the link to your domain, the page should read simply: 'It works'.

Install cerbot (see this page: Certbot-SSL) and create the certificate and, if iRedmail is installed, do the soft links to those certificate parameters of iRedmail as described therein.
b. Configure Nginx to Proxy from the Login3.service
2. Open Webmin→ Servers→ Nginx Webserver and do the following:
Create the server block script similar to this:

The Nginx server essentially acts as a proxy service from input delivered by the daemon webserver through the Login3.service.

Note: Remember to restart the Login3 service whenever changes to the website pages are made. The text file containing the above configuration is found here: nginx-login3.txt

sammy@imega:sudo systemctl restart login3
sammy@imega:sudo systemctl restart nginx

Now that these services have been restarted, open the browser with http://example.com. Your Login3 website should appear.

It is worthwhile to read and familiarize oneself about Mojolicious as well as to make changes in the html pages (found in the template directory)to put your own content.

Mojolicious Mojo-PartB
Mojo-Deploy Mojo-Extras