[Moscow.pm] Twiggy

me berekuk.ru
17 10:52:28 PDT 2012


17.09.2012, 20:56, " " <ivan  bessarabov.ru>:

> $ cat /etc/ubic/service/psgi
> use Ubic::Multiservice::Simple;
> use Ubic::Service::Plack;
>
> my $dir = '/home/bessarabov/';
>
> return Ubic::Multiservice::Simple->new({
>
> cow => Ubic::Service::Plack->new({
> server => "HTTP::Server::PSGI",
> app => "$dir/cow.psgi",
> port => 5001,
> }),
>
> dog => Ubic::Service::Plack->new({
> server => "HTTP::Server::PSGI",
> app => "$dir/dog.psgi",
> port => 5002,
> }),
>
> });

 ,         perl',   , ,  json.
     :
$ cat /etc/ubic/service/psgi/cow.json
{
  "module": "Ubic::Service::Plack",
  "options": {
    "server": "HTTP::Server::PSGI",
    "app": "/home/bessarabov/cow.psgi",
    "port": 5001
  }
}
$ cat /etc/ubic/service/psgi/dog.json
{
  "module": "Ubic::Service::Plack",
  "options": {
    "server": "HTTP::Server::PSGI",
    "app": "/home/bessarabov/dog.psgi",
    "port": 5002
  }
}
    , .   perl    map',    'server'   .

  ,    'user'.

  /etc/init.d  ubic-     , . https://metacpan.org/module/Ubic::Run.


Moscow-pm