[Catalyst] Basic help with "deployment"

Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 daxim at cpan.org
Wed Mar 16 09:21:41 GMT 2011


> online documentation […]  
> completely leaves out all mention of the "makefile" and the available
> options!
Because the build system/toolchain is not specific to Catalyst, as a CPAN 
author (or at least someone who authors distributions according to the 
principles) you are already supposed to know about all that, or ask for help 
in the appropriate places, e.g. <irc://irc.perl.org/toolchain>. The build 
system of Catalyst app distributions is not very different from other 
distributions.

> Then it states to copy the tarball to the server, and issue:
> 
>      $ tar xzvf MyApp-0.01. tar. gz
>      $ cd MyApp
>      $ perl Makefile.PL
>      $ make && make test
> 
> Ah, but what is extracted is not a subdirectory called MyApp, but
> MyApp-0.01.
This is a mistake in the book. Please amend the errata: 
<https://packtpub.com/support?nid=1092&view_name=support_page>

> Now, does 'make' by itself load the Perl dependancies?
Yes, if the distribution uses Module::Install - which is the default for 
Catalyst derived ones - Makefile.PL will notice a lacking dependency and the 
make step will install it.

I would replace the last two steps from the command block above with 
    cpan -t .
which takes care of deps no matter what build system used is and also runs the 
tests.

> I found that I need
> to run cpan -i Module as root
This is not a good idea. Instead configure the cpan options 
`make_install_make_command` and `mbuild_install_build_command` to employ sudo.
<http://p3rl.org/CPAN#Config_Variables>

> Does that mean that this 'make' step needs to be done as
> root?
No, normally only the `make install` step of each dist needs elevated 
privileges. If distributions try to create directories in system locations 
during other steps, then this is a bug.

You can sidestep the difficulties coming from the need to install to system 
locations by using local::lib. <http://p3rl.org/local::lib>

> how do I verify that Apache is indeed serving static content without going
> through the app, as intended?
Wireshark or similar network sniffer; inspect the server log files
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110316/77249b35/attachment.pgp


More information about the Catalyst mailing list