[Dancer-users] Apache with Plack deployment woes seem to be back
P Kishor
punk.kish at gmail.com
Sun Sep 12 06:57:03 CEST 2010
solution...
On Sat, Sep 11, 2010 at 11:41 PM, P Kishor <punk.kish at gmail.com> wrote:
> Per 1.1811 deployment docs, if running from Apache with Plack, the
> following should do the trick
>
> <Location />
> SetHandler perl-script
> PerlHandler Plack::Handler::Apache2
> PerlSetVar psgi_app /Sites/app/app.pl
> </Location>
>
> When I try to run with the above, I get the following error in my Apache logs
>
> [Sat Sep 11 20:37:56 2010] [error] [client 127.0.0.1] Error while
> loading /Users/punkish/Sites/app/app.pl: unable to load application
> app : Can't locate app.pm in @INC (@INC contains: lib
> /usr/local/apache2/bin/lib
> /usr/local/lib/perl5/site_perl/5.12.1/darwin-2level
> /usr/local/lib/perl5/site_perl/5.12.1
> /usr/local/lib/perl5/5.12.1/darwin-2level /usr/local/lib/perl5/5.12.1
> /usr/local/lib/perl5/site_perl . /usr/local/apache2) at (eval 57) line
> 2.\nBEGIN failed--compilation aborted at (eval 57) line 2.\n
>
> My app directory looks like so
>
> -rw-r--r-- 1 punkish punkish 635 Aug 25 00:23 Makefile.PL
> -rwxr-xr-x@ 1 punkish punkish 80 Sep 11 20:39 app.pl*
> -rw-r--r--@ 1 punkish punkish 682 Sep 11 21:01 config.yml
> drwxr-xr-x 4 punkish punkish 136 Aug 25 00:23 environments/
> drwxr-xr-x 5 punkish punkish 170 Sep 11 20:57 lib/
> drwxr-xr-x 3 punkish punkish 102 Aug 25 00:32 logs/
> drwxr-xr-x 11 punkish punkish 374 Sep 7 13:38 public/
> drwxr-xr-x 4 punkish punkish 136 Aug 25 00:23 t/
> drwxr-xr-x 6 punkish punkish 204 Sep 11 21:04 views/
>
> and my app.pl file looks like so
>
> #!/usr/local/bin/perl
> use Dancer;
> use lib ('lib');
At least on my computer, changing the above line to
usr lib ('/Full/path/to/lib')
solves the problem.
Additionally, since Apache has an in-built mechanism for accounting
for the missing trailing slash, the following recommended
ProxyPass /app/ http://application/app
has to be changed to
ProxyPass /app http://application/app
(note the missing trailing / after '/app')
> load_app 'app';
> dance;
>
> and my app/lib directory looks like so
>
> drwxr-xr-x 6 punkish punkish 204 Sep 11 21:30 app/
> -rw-r--r--@ 1 punkish punkish 397 Sep 11 20:57 app.pm
>
> What am I doing wrong?
>
>
> --
> 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
> =======================================================================
>
--
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
=======================================================================
More information about the Dancer-users
mailing list