how to set different running environment with Plack::Handler?
The docs say that I can have different config settings for development and production, and one or the other will be automatically used depending on my running environment, which I can specify with --environment command line switch. But, how do I specify this command line switch when I am running the application via Plack::Handler? Right now I run the application with the help of the following lines in my httpd.conf <Location /> SetHandler perl-script PerlHandler Plack::Handler::Apache2 PerlSetVar psgi_app /Users/punkish/Sites/lca/app.psgi </Location> -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu ----------------------------------------------------------------------- Assertions are politics; backing up assertions with evidence is science =======================================================================
On Fri, Aug 20, 2010 at 3:40 AM, P Kishor <punk.kish@gmail.com> wrote:
The docs say that I can have different config settings for development and production, and one or the other will be automatically used depending on my running environment, which I can specify with --environment command line switch. But, how do I specify this command line switch when I am running the application via Plack::Handler? Right now I run the application with the help of the following lines in my httpd.conf
<Location /> SetHandler perl-script PerlHandler Plack::Handler::Apache2 PerlSetVar psgi_app /Users/punkish/Sites/lca/app.psgi </Location>
I don't remember where you can export environment variable with apache (something like /etc/apache/envvar, not sure), but you can set PLACK_ENV to production, or DANCER_ENVIRONMENT, dancer use the first one if the second one is not set. Or if you want to set this variable for each application, you can do a 'environment: production' in your config.yml. I will try to summarize all your questions you had lately on the mailing list, and do a big upgrade on our deployment.pod.
On Fri, Aug 20, 2010 at 9:42 AM, franck <franck@lumberjaph.net> wrote:
I will try to summarize all your questions you had lately on the mailing list, and do a big upgrade on our deployment.pod.
That would be *so* good!
On 20/08/2010 08:42, franck wrote:
I don't remember where you can export environment variable with apache (something like /etc/apache/envvar, not sure),
This is done with SetEnv in your Apache config: <VirtualHost> ... SetEnv DANCER_ENVIRONMENT "production" ...
On Sat, Aug 21, 2010 at 6:44 AM, Alexis Sukrieh <sukria@sukria.net> wrote:
On 20/08/2010 08:42, franck wrote:
I don't remember where you can export environment variable with apache (something like /etc/apache/envvar, not sure),
This is done with SetEnv in your Apache config:
<VirtualHost> ... SetEnv DANCER_ENVIRONMENT "production" ...
Thanks! The above should be a part of the deployment docs. -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu ----------------------------------------------------------------------- Assertions are politics; backing up assertions with evidence is science =======================================================================
participants (4)
-
Alexis Sukrieh -
franck -
P Kishor -
sawyer x