Thanks! I got it to work on CentOS7. Here are my steps:

sudo su -
Create /etc/yum.repos.d/unit.repo:
[unit] name=unit repo baseurl=https://packages.nginx.org/unit/centos/$releasever/$basearch/ gpgcheck=0 enabled=1
Install unit and unit-perl
yum install -y unit unit-perl
In /etc/unit/ create two files:

start.json
{ "type": "perl", "processes": 5, "script": "/etc/unit/app.psgi" }
app.psgi
use strict; use warnings; use Plack::Builder; my $app = sub { my $env = shift; [200, [], ["Hello world from PSGI!\n"]]; }; builder { enable 'ContentLength'; $app; };
Then start unit:
service unit start
Configure unit using the following commands:
curl -X PUT --data-binary @/etc/unit/start.json --unix-socket /var/run +/control.unit.sock http://localhost/config/applications/psgiapp curl -X PUT --data-binary '{"application":"psgiapp"}' --unix-socket /v +ar/run/control.unit.sock 'http://localhost/config/listeners/*:8000'
.. and check the resulting config:
curl --unix-socket /var/run/control.unit.sock http://localhost/
... and finally do the Hello World test:
curl -v http://127.0.0.1:8000/
Voila!

In reply to Re^2: NGINX Unit + PSGI + Perl by tbusch
in thread NGINX Unit + PSGI + Perl by tbusch

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.