.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "RunApp 3pm" .TH RunApp 3pm "2022-06-17" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" RunApp \- A generic module to run web\-applications .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use RunApp \*(Aq\-chdir\*(Aq; \& \& use RunApp; \& use RunApp::Apache; \& \& my $cmd = shift || \*(Aqdevelopment\*(Aq; \& my $config = { var => \*(Aqvalue\*(Aq, app_apache => { var_for_apache => \*(Aqvalue\*(Aq} }; \& RunApp\->new (app_apache => RunApp::Apache\->new \& (root => catfile (cwd, $_), \& httpd => \*(Aq/path/to/httpd\*(Aq), \& my_daemon => RunApp::Control::AppControl\->new \& (binary => \*(Aq/path/to/daemon\*(Aq, \& args => [\*(Aq\-\-daemon\*(Aq], \& pidfile => \*(Aq/path/to/daemon.pid\*(Aq, \& ) \& )\->$cmd ($config); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`RunApp\*(C'\fR streamlines the process for configuring applications that requires one or more web servers and/or other daemons, during development or deployment. .PP It builds the config files required by the services from the \&\f(CW$config\fR hash, such as apache's httpd.conf. .SH "OPTIONS" .IX Header "OPTIONS" .Vb 2 \& use RunApp \*(Aq\-chdir\*(Aq; \& use RunApp qw(\-chdir ..); .Ve .PP This will cause the your script to \f(CW\*(C`chdir\*(C'\fR to the base directory. If it's a symbolic link it will be resolved and you will be in the directory of where the original script is. The \f(CW\*(C`lib\*(C'\fR directory will be added into \f(CW@INC\fR, and you can use the modules in that path. .PP It also takes an optional relative path if want the script to chdir to somewhere else. .PP This makes it possible for symlinking the your runapp script into system's rc.d startup directory. .SH "CONSTRUCTOR" .IX Header "CONSTRUCTOR" .SS "new (@services)" .IX Subsection "new (@services)" \&\f(CW@services\fR is actually an hash, with keys being the name of the service, and values being \f(CW\*(C`RunApp::Control\*(C'\fR objects. Use an array instead of a hash here to retain the order of dispatching. .PP The names are used to pick config from the hash, which will be flatten into top level of the config hash, when running \f(CW\*(C`build\*(C'\fR for the each service. .SH "METHODS" .IX Header "METHODS" .ie n .SS "$self\->development ($conf)" .el .SS "\f(CW$self\fP\->development ($conf)" .IX Subsection "$self->development ($conf)" Runs \f(CW\*(C`build\*(C'\fR and \f(CW\*(C`start\*(C'\fR, and then waits for \s-1SIGINT\s0 to the servers. .SH "AUTOLOAD" .IX Header "AUTOLOAD" All other methods are dispatched to the \f(CW\*(C`RunApp::Control\*(C'\fR objects in the order called in \s-1CONSTRUCTOR.\s0 Note that this is done with RunApp::Control dispatching to the \f(CW\*(C`dispatch\*(C'\fR method. .SH "SEE ALSO" .IX Header "SEE ALSO" RunApp::Apache, RunApp::Control::AppControl, App::Control .SH "AUTHORS" .IX Header "AUTHORS" Chia-liang Kao .PP Refactored from works by Leon Brocard and Tom Insam . .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2002\-5, Fotango Ltd. .PP This module is free software; you can redistribute it or modify it under the same terms as Perl itself.