kcott has asked for the wisdom of the Perl Monks concerning the following question:
G'day All,
I have created and deployed a Dancer2 ($work) application. This is successful, I'm not looking for help with this. While doing this I encountered a problem (described below) and found a workaround. My question is why this workaround was required at all.
I initially created the application which had a file structure similar to what's shown in "Dancer2::Tutorial - Creating a new app". There was one module (let's say Private::Work::Module) in lib/Private/Work/Module.pm with tests in the standard t/ directory: make, make test and make install were all OK. I ran this standalone as 'plackup -p 5000 /path/to/script.psgi': everything worked fine.
The next step was deployment. I've basically used what's described in "Dancer2::Manual::Deployment - Running under Apache - With Plack". I copied what I considered were the appropriate files to /srv/www/ directories: I excluded all make-, git- and distribution-related files, as well as the complete lib/ and t/ directories.
When I tried the URL from a variety of browsers (including graphical Firefox and textual lynx) I got "500 Internal Server Error".
I finally tracked down the issue and, after copying the lib/ directory to the apropriate /srv/www/ directory, everything worked fine and all tests on the application were successful.
I will just note that I successfully tried 'use Private::Work::Module; print "$Private::Work::Module::VERSION\n"' as a non-root user from a directory unrelated to my source directory, any Apache directory, or any @INC directory.
So, why does the lib/ directory need to be bundled with the Dancer2 files? Other Perl modules that I used — core, CPAN, and Private::OtherWork::OtherModule — were all found, loaded and used without any problems.
— Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Dancer2: Why is bundled 'lib/' required?
by bliako (Abbot) on Feb 01, 2022 at 23:46 UTC | |
by kcott (Archbishop) on Feb 02, 2022 at 03:49 UTC | |
|
Re: Dancer2: Why is bundled 'lib/' required?
by perlfan (Parson) on Feb 04, 2022 at 05:38 UTC | |
by Anonymous Monk on Feb 04, 2022 at 14:04 UTC | |
by perlfan (Parson) on Feb 05, 2022 at 22:58 UTC | |
by Anonymous Monk on Feb 07, 2022 at 18:09 UTC | |
|
Re: Dancer2: Why is bundled 'lib/' required?
by Anonymous Monk on Feb 01, 2022 at 22:14 UTC |