[Catalyst-commits] r12467 - in
trunk/examples/CatalystAdvent/root/2009: . pen
zamolxes at dev.catalyst.perl.org
zamolxes at dev.catalyst.perl.org
Wed Dec 23 00:31:53 GMT 2009
Author: zamolxes
Date: 2009-12-23 00:31:51 +0000 (Wed, 23 Dec 2009)
New Revision: 12467
Added:
trunk/examples/CatalystAdvent/root/2009/23.pod
Removed:
trunk/examples/CatalystAdvent/root/2009/pen/plack-deployment-standalone+prefork.pod
Log:
day 23
Copied: trunk/examples/CatalystAdvent/root/2009/23.pod (from rev 12466, trunk/examples/CatalystAdvent/root/2009/pen/plack-deployment-standalone+prefork.pod)
===================================================================
--- trunk/examples/CatalystAdvent/root/2009/23.pod (rev 0)
+++ trunk/examples/CatalystAdvent/root/2009/23.pod 2009-12-23 00:31:51 UTC (rev 12467)
@@ -0,0 +1,90 @@
+=head1 Plack - A Fantastic Layer To Make Your App Deployment Easier
+
+=head3 What is it?
+
+From the documentation:
+
+ Plack is a set of PSGI reference server implementations and helper
+ utilities for Web application frameworks, exactly like Ruby's Rack.
+
+=head3 What is PSGI?
+
+PSGI is an interface between Perl web apps and web servers. This means you have a pretty slick
+and well-rounded platform that allows you to deploy your app as a persistent process while letting
+you point your server software at the running Plack process. You can *still* run your application
+under FastCGI and such, but all of the communication to the server is handled entirely by PSGI.
+
+=head3 What does it look like?
+
+Don't do any of this just yet, as you'll need to set up your script first. You can do the nginx config now if you'd like,
+but obviously pointing your browser to localhost/myapp/ isn't going to serve up your app unless it's actually running.
+
+Starting the process:
+
+ plackup -s Standalone::Prefork yourappname.psgi
+
+Your server configuration (let's use nginx):
+
+ # inside a server {} block
+ location /myapp {
+ proxy_set_header Host $http_host;
+ proxy_set_header X-Forwarded-Host $http_host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+
+ proxy_pass http://localhost:5000/; # 5000 is the default plackup port
+ }
+
+
+Note that if you don't specify a server option (-s), plackup defaults to a standalone server like Catalyst does.
+It's *that* simple. Now, let's do what we came here for and show you how to hookup Catalyst with Plack,
+running under the Standalone::Prefork engine.
+
+=head3 The Dispatch Script
+
+Plackup wants a dispatch script to fire up and delegate things to your app from. So, we need to create
+one of these for our simple Catalyst app. If you're lazy like me, you can also do C<perl scripts/placky_create.pl PSGI> and have
+a helper generate your script for you.
+
+After the usual C<catalyst.pl Placky> mumbo jumbo (for fun, I called this app Placky), we create a file called placky_app.psgi (You can call it whatever
+you want, really). Copy and paste these lines, and save your file:
+
+ #!/usr/bin/env perl
+ use strict;
+ use Placky;
+
+ Placky->setup_engine('PSGI');
+ my $app = sub { Placky->run(@_) };
+
+Now, let's fire it up and test things:
+
+ squishface:Placky dhoss$ plackup -s Standalone::Prefork script/placky_app.psgi
+
+Since we didn't specify a port, you should (after seeing all the Catalyst server startup stuff) see something like this:
+
+ [info] Placky powered by Catalyst 5.80016
+ Plack::Server::Standalone::Prefork: Accepting connections at http://0:5000/
+
+Make sure that after modifying your server configuration you restart nginx/whatever software you happen to be using so the
+changes take effect.
+
+Open up your browser and navigate to http://localhost/myapp/ and you should see your friendly Catalyst welcome message.
+If so, great success! You now know how to deploy a Catalyst application under Plack. There are L<many server engines|http://plackperl.org/>
+that Plack supports right off the bat to allow you to customize your deployment to suit you best.
+
+
+That's all folks, the beauty of simplicity and being robust all wrapped up in one. Plack/PSGI will really help people ease into deployment
+and manage their application processes. Don't forget to check out L<the Plack Advent Calendar|http://advent.plackperl.org/> too for cool tips
+and tricks on making Plack even funner.
+
+Feel free to check out the Placky code here: L<http://dev.catalystframework.org/svnweb/Catalyst/browse/trunk/examples/Placky/> or do
+C< svn co http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/Placky >.
+
+=head1 AUTHOR
+
+Devin Austin
+
+dhoss at cpan.org
+
+Thanks to miyagawa (Tatsuhiko Miyagawa) for putting together this fantastic interface and for reviewing this article to make sure I did his work
+justice :-)
Deleted: trunk/examples/CatalystAdvent/root/2009/pen/plack-deployment-standalone+prefork.pod
===================================================================
--- trunk/examples/CatalystAdvent/root/2009/pen/plack-deployment-standalone+prefork.pod 2009-12-23 00:29:55 UTC (rev 12466)
+++ trunk/examples/CatalystAdvent/root/2009/pen/plack-deployment-standalone+prefork.pod 2009-12-23 00:31:51 UTC (rev 12467)
@@ -1,90 +0,0 @@
-=head1 Plack - A Fantastic Layer To Make Your App Deployment Easier
-
-=head3 What is it?
-
-From the documentation:
-
- Plack is a set of PSGI reference server implementations and helper
- utilities for Web application frameworks, exactly like Ruby's Rack.
-
-=head3 What is PSGI?
-
-PSGI is an interface between Perl web apps and web servers. This means you have a pretty slick
-and well-rounded platform that allows you to deploy your app as a persistent process while letting
-you point your server software at the running Plack process. You can *still* run your application
-under FastCGI and such, but all of the communication to the server is handled entirely by PSGI.
-
-=head3 What does it look like?
-
-Don't do any of this just yet, as you'll need to set up your script first. You can do the nginx config now if you'd like,
-but obviously pointing your browser to localhost/myapp/ isn't going to serve up your app unless it's actually running.
-
-Starting the process:
-
- plackup -s Standalone::Prefork yourappname.psgi
-
-Your server configuration (let's use nginx):
-
- # inside a server {} block
- location /myapp {
- proxy_set_header Host $http_host;
- proxy_set_header X-Forwarded-Host $http_host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
-
- proxy_pass http://localhost:5000/; # 5000 is the default plackup port
- }
-
-
-Note that if you don't specify a server option (-s), plackup defaults to a standalone server like Catalyst does.
-It's *that* simple. Now, let's do what we came here for and show you how to hookup Catalyst with Plack,
-running under the Standalone::Prefork engine.
-
-=head3 The Dispatch Script
-
-Plackup wants a dispatch script to fire up and delegate things to your app from. So, we need to create
-one of these for our simple Catalyst app. If you're lazy like me, you can also do C<perl scripts/placky_create.pl PSGI> and have
-a helper generate your script for you.
-
-After the usual C<catalyst.pl Placky> mumbo jumbo (for fun, I called this app Placky), we create a file called placky_app.psgi (You can call it whatever
-you want, really). Copy and paste these lines, and save your file:
-
- #!/usr/bin/env perl
- use strict;
- use Placky;
-
- Placky->setup_engine('PSGI');
- my $app = sub { Placky->run(@_) };
-
-Now, let's fire it up and test things:
-
- squishface:Placky dhoss$ plackup -s Standalone::Prefork script/placky_app.psgi
-
-Since we didn't specify a port, you should (after seeing all the Catalyst server startup stuff) see something like this:
-
- [info] Placky powered by Catalyst 5.80016
- Plack::Server::Standalone::Prefork: Accepting connections at http://0:5000/
-
-Make sure that after modifying your server configuration you restart nginx/whatever software you happen to be using so the
-changes take effect.
-
-Open up your browser and navigate to http://localhost/myapp/ and you should see your friendly Catalyst welcome message.
-If so, great success! You now know how to deploy a Catalyst application under Plack. There are L<many server engines|http://plackperl.org/>
-that Plack supports right off the bat to allow you to customize your deployment to suit you best.
-
-
-That's all folks, the beauty of simplicity and being robust all wrapped up in one. Plack/PSGI will really help people ease into deployment
-and manage their application processes. Don't forget to check out L<the Plack Advent Calendar|http://advent.plackperl.org/> too for cool tips
-and tricks on making Plack even funner.
-
-Feel free to check out the Placky code here: L<http://dev.catalystframework.org/svnweb/Catalyst/browse/trunk/examples/Placky/> or do
-C< svn co http://dev.catalyst.perl.org/repos/Catalyst/trunk/examples/Placky >.
-
-=head1 AUTHOR
-
-Devin Austin
-
-dhoss at cpan.org
-
-Thanks to miyagawa (Tatsuhiko Miyagawa) for putting together this fantastic interface and for reviewing this article to make sure I did his work
-justice :-)
More information about the Catalyst-commits
mailing list