Dancer2-Plugin-WebService

 view release on metacpan or  search on metacpan

INSTALL  view on Meta::CPAN

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

For linux native authentication we need to create a user, lets call him  joe

  getent passwd joe > /dev/null || useradd -m  -c 'I am a dancer' joe
  usermod --password $(openssl passwd -6 -salt pCt6qNtCYsozKMDu SomePassword) joe    # Now joe's password is SomePassword

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



( run in 0.530 second using v1.01-cache-2.11-cpan-71847e10f99 )