Apache with Plack deployment woes seem to be back
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'); 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 =======================================================================
On 12/09/10 2:41 PM, P Kishor 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
Look to me like your apps lib directory is not included in the @INC paths that mod_perl is using. See http://perl.apache.org/docs/2.0/user/confi/config.html#Adjusting_C__INC_ for ways to adjust mod_perl's @INC path. Hope that helps, Russell. -- Russell Jenkins Strategic Data. http://www.strategicdata.com.au/
solution... On Sat, Sep 11, 2010 at 11:41 PM, P Kishor <punk.kish@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 =======================================================================
Le 12/09/2010 06:41, P Kishor a écrit :
#!/usr/local/bin/perl use Dancer; use lib ('lib'); load_app 'app'; dance;
Hmm, looks like a regression to me, could you try this: use lib path(dirname(__FILE__), 'lib'); If that fixes the problem, it means we have a bug in the scaffolding of the app. Regards, -- Alexis Sukrieh
On Mon, Sep 13, 2010 at 3:16 AM, Alexis Sukrieh <sukria@sukria.net> wrote:
Le 12/09/2010 06:41, P Kishor a écrit :
#!/usr/local/bin/perl use Dancer; use lib ('lib'); load_app 'app'; dance;
Hmm, looks like a regression to me, could you try this:
use lib path(dirname(__FILE__), 'lib');
Yes, I can confirm that the above fixes the problem. Many thanks,
If that fixes the problem, it means we have a bug in the scaffolding of the app.
Regards,
-- Alexis Sukrieh _______________________________________________ Dancer-users mailing list Dancer-users@perldancer.org http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
-- 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 (3)
-
Alexis Sukrieh -
P Kishor -
Russell Jenkins