Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updating cgi and fcgi dispatch handlers
- Loading branch information
Showing
2 changed files
with
21 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
#!/usr/bin/env perl | ||
use Plack::Runner; | ||
use Dancer ':syntax'; | ||
my $psgi = path(dirname(__FILE__), '..', 'PEG.pl'); | ||
use FindBin '$RealBin'; | ||
use Plack::Runner; | ||
|
||
# For some reason Apache SetEnv directives dont propagate | ||
# correctly to the dispatchers, so forcing PSGI and env here | ||
# is safer. | ||
set apphandler => 'PSGI'; | ||
set environment => 'production'; | ||
|
||
my $psgi = path($RealBin, '..', 'bin', 'app.pl'); | ||
Plack::Runner->run($psgi); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
#!/usr/bin/env perl | ||
use Plack::Handler::FCGI; | ||
use Dancer ':syntax'; | ||
use FindBin '$RealBin'; | ||
use Plack::Handler::FCGI; | ||
|
||
my $psgi = path(dirname(__FILE__), '..', 'PEG.pl'); | ||
# For some reason Apache SetEnv directives dont propagate | ||
# correctly to the dispatchers, so forcing PSGI and env here | ||
# is safer. | ||
set apphandler => 'PSGI'; | ||
set environment => 'production'; | ||
|
||
my $psgi = path($RealBin, '..', 'bin', 'app.pl'); | ||
my $app = do($psgi); | ||
my $server = Plack::Handler::FCGI->new(nproc => 5, detach => 1); | ||
my $server = Plack::Handler::FCGI->new(nproc => 5, detach => 1); | ||
|
||
$server->run($app); |