Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updating cgi and fcgi dispatch handlers

  • Loading branch information...
commit c2885169d51508785a205555284bda1936d7ce39 1 parent 8c0a749
@xsawyerx xsawyerx authored
Showing with 21 additions and 5 deletions.
  1. +10 −2 public/dispatch.cgi
  2. +11 −3 public/dispatch.fcgi
View
12 public/dispatch.cgi
@@ -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);
View
14 public/dispatch.fcgi
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.