Installing a perl-based web application in an extremely limited environment

Since I have a long series of comments with @ikegami, I remove the question, I hope this will be more clear. Unfortunately, English is not my "main" language. :(

Say, having an environment in which:

  • development tools not installed (no make, not gccand how)
  • perl installed with its main packages, no more
  • access to the outgoing network is unavailable. the user can not use curland cpanto download / install dependencies perl
  • the user does not even have administrator rights (root)
  • but want to install and evaluate some perl-based web applications, let’s call it MyApp

MyApp

  • does not use the XS module. (at least, I hope - they use me in the development plenvand cpanm, therefore, they never checked the installed dependencies in depth)
  • This is a clean PSGI application, simple plackup app.psgiworks fine
  • The application uses some data files that must be included in the "deployment".

The main question: how to prepare MyApp, and all the used CPAN modules are easily installed in such a limited environment?

Purpose:

  • I do not need to save my efforts and my time.
  • but I want to save the user’s time and I want to minimize the necessary actions on his side, so the installation (deployment) should be as simple as possible.

. - . - - : - (zip tarbal) - - run.pl .

, :

1.) tarball, 3 1 perl- script, :

myapp_repo/
myapp_repo/distlib   #will contain all MyApp perl modules also ALL used CPAN modules and their dependecies
myapp_repo/datafiles #will contain app-specific data files and such
myapp_repo/install.pl
myall_repo/lib   #will contain modules directly used by the `install.pl`

2.) install.pl script, ,

perl install.pl new /path/to/app_root

():

  • /path/to/app_root ( lib, perl)
  • cpanm ( myapp_repo/lib) perl CPAN distlib.
  • script app.psgi /path/to/app_root/bin
  • .

3.) , :

/path/to/app_root/bin/plackup /path/to/app_root/bin/app.psgi

, :

  • perl perl-core
    • perl- runtime (, plackup)
    • CPAN-
  • , ( ).

. install.pl cpanm ( ) cpanm

cpanm --mirror file://path/to/myapp_repo/distlib --mirror-only My::App

My::App , myapp_repo/distlib

:

  • cpanm ( ) make?
  • myapp_repo/distlib, Pinto. ?
  • -? :
  • (: )?
  • - , / tarball?

@ikegami : - " " - .

, , , , .

FatPacked - .

+4
1

make . make ( apt/yum/etc), , ). cpan 5 !

, gcc, (, XS), , . gcc, perl, PERL5LIB.

, minicpan, CPAN . , , , .


, , cpan , , .

, cpan . -, Perl ( , ). . ; . XS, .

, ppm ( ActiveState Perl).

, , , , .. , ( - XS).

+1

Source: https://habr.com/ru/post/1659861/


All Articles