<B>NOTE: This is all still experimental. Things may change in the future.B>
Emplacken is a tool for managing a set of Plack applications based on
config files. It also adds support for privilege dropping and error logs to
those Plack servers that dont support these features natively.
It works be reading a config file and using that to generate a PSGI
application file based on your config. It knows how to generate Catalyst,
Mojo, and Mason app files natively. For other apps, or more complicated
setups, you can supply a template to Emplacken and it will use that to
generate the PSGI app.
The emplacken command accepts either a --dir or --file option. If you
dont specify either, it defaults to using the /etc/emplacken directory.
You must also pass a command, one of start, stop, restart, or
Finally, you can specify a --verbose or --no-verbose flag. This
determines whether the start and stop command print to stdout. The
status command always prints to stdout.
These options are shared for all servers and code builders.
For config file styles that dont support multiple values for a single option,
you can use a comma-separated string to set multiple options.
This will be passed to the plackup command to tell it what server class to
use, for example Starlet or Corona. If you specify Starman, then the
starman command will be used instead of plackup.
You can also use the value plackup here, which will let the Plack code pick
the server automagically.
This is required.
The code builder to use. Currently, this can be one of Catalyst, Mason,
Mojo, or FromTemplate. Each code builder support different config
options. See below for details.
The location of the pid file for this application.
This is required.
A set of include directories to be passed to plackup. You can specify
A set of modules to be passed to plackup. You can specify multiple
values. These modules will be preloaded by plackup.
This can be HOST, HOST:PORT, :PORT, or a path for a Unix socket. This
can be set multiple times, but some servers may not support multiple values.
If this is set then Emplacken will attempt to become this user before starting
the PSGI app.
If this is set then Emplacken will attempt to become this group before
starting the PSGI app.
This can be one or more middleware modules that should be enabled. Note that
there is no way to pass config options to these modules (yet?). You can
specify multiple values.
If this is true, then the Plack::Middleware::ReverseProxy module is enabled
for requests coming from 127.0.0.1.
If this is set to a file, then the Plack::Middleware::AccessLog module is
enabled. It will log to the specified file.
This can be used to change the access log format.
If this is set, then the generated PSGI app will tie STDERR and log to a
file. The log format is like Apaches error log, so youll get something like
[Sun Dec 19 00:42:32 2010] [error] [client 22.214.171.124] Some error
Any error output from Perl will be tweaked so that it fits on a single
line. All non-printable characters will be replaced by their hex value.
If you are using the Starman server, there are several more options you can
set in the config file.
The number of worker processes to spawn.
The maximum number of backlogged listener sockets allowed.
The maximum number of requests per child.
If this is true, then your PSGI app is preloaded by Starman before any child
processes are forked.
If this is true, then keepalive is disabled.
If youd like to thank me for the work Ive done on this module, please
consider making a donation to me via PayPal. I spend a lot of free time
creating free software, and would appreciate any support youd care to offer.
Please note that <B>I am not suggesting that you must do thisB> in order for me
to continue working on this particular software. I will continue to do so,
inasmuch as I have in the past, for as long as it interests me.
Similarly, a donation made in this way will probably not make me work on this
software much more, unless I get so many donations that I can consider working
on free software full time, which seems unlikely at best.
To donate, log into PayPal and send money to firstname.lastname@example.org or use the
button on this page: <http://www.urth.org/~autarch/fs-donation.html>