Server - Contents

Dancer2 - Deployment

Premises:
- That a Perl-enable environment on the PC with a 'myexample' folder - which, via an FTP client (eg.FileZilla), is synchronized with the 'myexample' folder on the server.
- Both PC and Server have tested, via http on port:5000 by running the command [plackup -p 5000 bin/app.psgi] within its main directory (myexample/) then visit localhost:5000 or http://[MySeverIP]:5000
- That the service; myexample.service is actively serving port:8080
- [Optional]Nginx Webserver is serving iRedmail app, http://[MySeverIP]/mail

Strategy

To have first create a website SSL certificate via Let'sEncrypt - see SSL Certificate for Websites Thereafter [optional] Nginx serving iRedmail, the port serving its mail apps will be changed from 443 to 8443. The Dancer2 will then be service by Apache2, ultimately on port 443 with a LetsEncrypt certificate.

Set Apache2 to host the Dancer2 site

Assumption: Apache2 installed and active such it shows its default page at http://[MySeverIP]

Ex2a: Apache2-Native-Perl-Configuration (Preferred)
Requires: mod_perl plus Plack::Handler::Apache2

sammy@imega:sudo apt -y install libapache2-mod-perl2
sammy@imega:sudo a2enmod perl // engaging/disengaging Apache2 modules can done in Webmin: Servers->Apache2->global configuration -> modules sammy@imega:$ sudo perl -MCPAN -e shell
sammy@imega:$ sudo install Plack::Handler::Apache2
sammy@imega:$ exit // engaging Perl modules moreover can done in Webmin: Tools-> Perl Modules-> Install modules

Via Webmin: Servers->Apache2, create a new host use the following configuration provided here: Apache2-Dancer2-Config-Plack.txt

sammy@imega:sudo systemctl restart apache2

Thereafter open the browser with http://myexample.com. Your 3-page Dancer website should appear.

Reference: Dancer2-Deployment

Secondly, replace the contents of the index.html found at /var/www/htm/ with the following this text: port80-referral-port443.txt (using your own domain). Thereafter all links to your domain will call on port 443 and will render the website.

Note: In initial attempts of Apache2 to render the Dancer2 website, there maybe some links to the Perl modules that are appear missing. Check the Apache2 error log at Webmin: Tools-> System-> System Logs and view the entries. Install the missing modules via Webmin: Tools-> Perl Modules-> Install modules.

Nginx to serve iRedmail port:8443

Note: The firewall requires adjustment to allow port:8443 to be exposed.

Via Webmin: Servers->Nginx->Existing Virtual Host and disable the two default hosts. Create this third host: myexample.com.conf

Restart Nginx and thereafter iRedmail apps can be accessed at http://[MySeverIP]or myexample:8443/mail or /iredadmin

Dancer2 Dancer-PartB
Dancer-Deploy Dancer-Extras