You should your run your applications as a non privileged user e.g. dancer
Be careful, that non system users can only bind ports above the 1024
It must have a home directory to install there the deployed applications

  getent group  dancer >/dev/null || groupadd dancer
  getent passwd dancer >/dev/null || useradd -g dancer -l -m -c "Dancer2 WebService" -s $(/usr/bin/which nologin) dancer
  lslogins      dancer

Create the Persistent session data and log directories. You can change them later if needed

  i=/var/lib/WebService; [ -d $i ] || { /usr/bin/mkdir $i; /usr/bin/chown -R dancer:dancer $i; }
  i=/var/log/WebService; [ -d $i ] || { /usr/bin/mkdir $i; /usr/bin/chown -R dancer:dancer $i; }

Use logrotate for housekeeping the log files
vi /etc/logrotate.d/WebService

  /var/log/WebService/*.log {
  create 640 dancer dancer
  compress
  missingok
  notifempty
  daily
  rotate 7
  }

You need to Install Perl and some 3rd party modules
For installing the Perl modules you need C (gcc)

Install at Archlinux

  pacman -Q perl   > /dev/null || pacman -S --noconfirm perl
  pacman -Q expat  > /dev/null || pacman -S --noconfirm expat
  pacman -Q libisl > /dev/null || pacman -S --noconfirm libisl
  pacman -Q gcc    > /dev/null || pacman -S --noconfirm gcc
  pacman -Q gc     > /dev/null || pacman -S --noconfirm gc
  pacman -Q make   > /dev/null || pacman -S --noconfirm make

Install at RedHat like distributions

  dnf install perl perl-devel perl-Module-Signature perl-Version-Requirements
  dnf group install "Development Tools"
  dnf       install llvm-toolse

Install cpanm

  curl -L http://cpanmin.us | /usr/bin/perl - App::cpanminus

  vi /etc/profile.d/perlbin.sh
    #!/bin/sh
    [ -d /usr/bin/site_perl ]   && PATH=${PATH}:/usr/bin/site_perl
    [ -d /usr/bin/vendor_perl ] && PATH=${PATH}:/usr/bin/vendor_perl
    [ -d /usr/bin/core_perl ]   && PATH=${PATH}:/usr/bin/core_perl
    export PATH

  source /etc/profile.d/perlbin.sh

Install Perl modules

  cpanm ExtUtils::MakeMaker
  cpanm ExtUtils::Config
  cpanm Test::More

  cpanm Data::Dumper
  cpanm YAML::XS
  cpanm XML::Hash::XS
  cpanm Cpanel::JSON::XS
  cpanm URI
  cpanm IO::HTML
  cpanm HTTP::Headers
  cpanm HTTP::Entity::Parser
  cpanm Template::Toolkit
  cpanm Moo
  cpanm Net::Server
  cpanm Starman
  cpanm HTTP::Server::Simple
  cpanm HTTP::Server::PSGI
  cpanm Params::Validate
  cpanm Params::Util
  cpanm Plack
  cpanm Plack::Handler::HTTP::Server::Simple
  cpanm Plack::Middleware::Deflater
  cpanm AnyEvent
  cpanm Dancer2
  cpanm Dancer2::Plugin::WebService

Check the dancer2 version

  $(/usr/bin/which dancer2) version

Check the installed plackup utility

  plackup=$(/usr/bin/find /usr/bin -name plackup -type f)
  [ -x "$plackup" ] && echo ok || echo Sorry, could not found the plackup
  $plackup --version

Make executable any authentication script that needs root privileges, e.g the  Linux_native_authentication.sh

  /usr/bin/find $(/usr/bin/perl -M File::Basename -E 'use Dancer2::Plugin::WebService; print [ fileparse $INC{"Dancer2/Plugin/WebService.pm"} ]->[1]') -regex ".*\.\(sh\|pl|py\)\$"
  /usr/bin/find $(/usr/bin/perl -M File::Basename -E 'use Dancer2::Plugin::WebService; print [ fileparse $INC{"Dancer2/Plugin/WebService.pm"} ]->[1]') -regex ".*\.\(sh\|pl|py\)\$" -type f -exec /usr/bin/chmod 755 {} \;

Give the authentication scripts   sudo "no password prompt" e.g

  vi /etc/sudoers.d/Dancer2-Plugin-WebService

    dancer ALL=(ALL:ALL) NOPASSWD: /usr/share/perl5/site_perl/Dancer2/Plugin/AuthScripts/Linux_native_authentication.sh

To view the Dancer2::Plugin::WebService documentation using your web browser

  [ -f /home/dancer/pod2htmd.tmp ] && unlink /home/dancer/pod2htmd.tmp
  pod2html --infile=/opt/Dancer2-Plugin-WebService/lib/Dancer2/Plugin/WebService.pm --outfile=/tmp/index.html --title="Dancer2 WebService" --verbose

  pacman -S darkhttpd
  darkhttpd /tmp --addr 0.0.0.0 --port 80 --chroot --daemon --index index.html # Start the web server at the background

  http://yourserver

Please follow the CREATE_SAMPLE_APPLICATION document to create the "TestService" application for practice
