Permalink
Browse files

updating cgi and fcgi dispatch handlers

  • Loading branch information...
1 parent 8c0a749 commit c2885169d51508785a205555284bda1936d7ce39 @xsawyerx xsawyerx committed Dec 16, 2010
Showing with 21 additions and 5 deletions.
  1. +10 −2 public/dispatch.cgi
  2. +11 −3 public/dispatch.fcgi
View
@@ -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
@@ -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);

0 comments on commit c288516

Please sign in to comment.