Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Serving multiple Plack appsby Your Mother (Archbishop) |
on Feb 09, 2015 at 23:32 UTC ( [id://1116113]=note: print w/replies, xml ) | Need Help?? |
Multiple executables and apps with one PSGI serverProof of concept to help you and others (and me the next time I want to stub out an example). Tested to work on my OS X box. I recommend uWSGI as an app server and nginx as a webserver (it doesn’t like CGI so you might have to forgo it unless you get ALL your CGIs ironed out to PSGI). Setup…Install or skip/edit the parts that use: strictures, Catalyst, Catalyst::Devel, Mojolicious, Plack, Plack::Builder, Plack::Middleware::Rewrite… maybe some I missed. Judicious middleware use can let you do all kinds of unified logging or even sessions (x-app you’d need to unify the handling and name but not as hard as from scratch). Update: DERP indeed, left these out, Plack::App::CGIBin, Plack::App::WrapCGI. Make a play dir and get in it (update, added the cgi “bin”)–
Create Cat app–
Create hello.php–
Create cgi/hello.cgi (need the “bin”)–
Create mojo-hello.pl–
Create app.psgi–
Start it up (with restart flag to watch for edits, Cat does lots of debug for a new app so we turn it off here)–
Now visit (might need to change “localhost” depending on your box’s setup)–
In Section
Seekers of Perl Wisdom
|
|