Questions tagged [psgi]

PSGI (Perl Web Server Gateway Interface) is an interface between web servers and Perl-based web applications and frameworks that allows writing portable applications that can be run as standalone servers or using CGI, FastCGI, mod_perl, etc.

PSGI (Perl Web Server Gateway Interface) is an interface between web servers and Perl-based web applications and frameworks that allows writing portable applications that can be run as standalone servers or using CGI, FastCGI, mod_perl, etc. (from: Wikipedia)

This is an example PSGI application:

my $app = sub {
    return [200, ['Content-Type' => 'text/plain'], ["Hello, World!\n"]];
}

PSGI is inspired by Python's (Web Server Gateway Interface), Ruby's and JSGI for JavaScript.

80 questions
2
votes
0 answers

Share and modify variables in PSGI between processes

We have a PSGI script using UWSGI with multi processes and threads, looking for a fast solution to share editable hashes between these processed and threads. I did tests by using in-memory storage like Cache::Memcached::Fast and Redis. There are…
2
votes
1 answer

Why a Perlbrew PSGI application with uwsgi_psgi causes "wrong" Perl include paths?

I want to deploy a PSGI based web application by using an uWSGI gateway interface. To accomplish this I installed Perlbrew locally on my Debian server where no root access is available. perlbrew init # close shell and reopen new shell perlbrew…
burnersk
  • 3,320
  • 4
  • 33
  • 56
2
votes
2 answers

How to get information about itself in app.psgi?

Having any PSGI based app, e.g. like the following app.psgi snippet use 5.016; use warnings; use Data::Dumper; #WHAT TO DO HERE to get the $port? my $port = $ENV{SERVER_PORT} // "undefined"; print STDERR "my port is: $port\n"; #says…
kobame
  • 5,766
  • 3
  • 31
  • 62
2
votes
1 answer

How do I get a "clean" clone of a Test::WWW::Mechanize::PSGI object for aggregated tests?

I have a large test suite for Catalyst/PSGI website that takes about 40+ minutes run. I've switched it to use aggregated tests, using Test::Aggregate::Nested, and now it takes about 20+ minutes to run. I've been experimenting with having the test…
Rob
  • 781
  • 5
  • 19
2
votes
1 answer

Perl CGI::Simple under PSGI

I am using CGI::Simple in a simple application that I want it to support PSGI, I am not going to use any ready made frameworks, I did a lot of search a bout PSGI support for CGI::Simple but did not find any module on CPAN. By luck I found someone on…
daliaessam
  • 1,636
  • 2
  • 21
  • 43
2
votes
1 answer

How do I discover on what server the app.psgi process is running?

Is there a way to discover on what server app.psgi is running? For example, I am looking for some idea for how to solve the next code fragment from app.psgi: #app.psgi use Modern::Perl; use Plack::Builder; my $app = sub { ... }; my $server =…
clt60
  • 62,119
  • 17
  • 107
  • 194
2
votes
4 answers

Starman and MovableType 5.2

MovableType 5.2 has builtin PSGI support (via a mt.psgi in the main directory) and I've been trying to take advantage of it using starman/plackup. Starman w/ MT fires up, but I get odd Not Founds and a silent hang & fail when I run mt-upgrade.cgi.…
Jamie Pitts
  • 51
  • 1
  • 5
2
votes
2 answers

Init scripts for Twiggy-based PSGI apps

I'm looking for a way to manage several Twiggy instances listening on different ports via a simple config file and a standard interface. E.g. I want a config that looks like dog 5000 /www/psgi/dog.pl cow 5001 /www/psgi/holycow.pl # ... And a…
Dallaylaen
  • 5,268
  • 20
  • 34
2
votes
2 answers

Persistent, preforked (blocking) Perl web service on Windows

I would like to run a Perl web application on Windows (assume 2008 R2 x64) with reasonable speed / capacity. Currently my app is based on Mojolicious, using Strawberry Perl and running as CGI through Apache 2.2-win32. With about 20000 lines of code,…
HelloSam
  • 2,225
  • 1
  • 20
  • 21
1
vote
2 answers

How to deploy bugzilla with psgi on dotcloud?

I want to deploy bugzilla on dotcloud, but the perl environment is psgi. The doc said I must use "modules to add PSGI hooks to legacy CGI or FastCGI applications". I found CGI::Emulate::PSGI module but could not figure out how to do it. I am a…
unionx
  • 437
  • 3
  • 15
1
vote
1 answer

How can Plack applications log to multiple loggers?

Plack Middleware is very useful, for instance to configure logging targets independent of the application. But I have not found a method to use multiple loggers at the same time: my $app = MyApp->new(); builder { enable 'ConsoleLogger'; # show in…
Jakob
  • 3,570
  • 3
  • 36
  • 49
1
vote
1 answer

Nginx Unit in relation to PSGI/Dancer stack

According to Nginx goes beyond its server roots and launches its application platform ..Unit is a modern application server for applications written in PHP, Python and Go (with support for node.js, Java, Ruby Perl and others following soon),…
microwth
  • 1,016
  • 1
  • 14
  • 27
1
vote
0 answers

Get Plack Session ID in background thread

Sorry, I really tried but I can't find a solution to this simple problem. I need to get id session in plack, but not via browser, I want to do internally background in main namespace perl plack code. This is my code: #!/usr/bin/perl use…
Imylor
  • 384
  • 1
  • 9
1
vote
1 answer

PSGI - constructor for each prefork-child

I have question about constructor for each child after forking. For example: warn "INIT : Parent : ".$$; my $stash; sub { unless($stash) { warn "init : Child : ".$$; $stash = { dbh => {} }; } return […
Roman None
  • 41
  • 3
1
vote
0 answers

Perl web service on Windows crashes when running system commands in parallel

I am modernising a Perl-based system for a client. This system runs on Windows (Strawberry Perl), connects to a database, and calls some scripts, which in turn run other programs. My first thought is to write a PSGI application and trigger the…
Rob
  • 781
  • 5
  • 19