Permalink
Browse files

new app layout

  • Loading branch information...
1 parent 6aa1fab commit 76bf7b0f8d7b24d4000391c74b28e815519aaabf Alexis Sukrieh committed Mar 8, 2011
Showing with 32 additions and 5 deletions.
  1. +4 −0 bin/app.pl
  2. +14 −2 public/dispatch.cgi
  3. +14 −3 public/dispatch.fcgi
View
@@ -0,0 +1,4 @@
+#!/usr/bin/env perl
+use Dancer;
+use PerlDancer;
+dance;
View
@@ -1,3 +1,15 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
+use Dancer ':syntax';
+use FindBin '$RealBin';
use Plack::Runner;
-Plack::Runner->run('/srv/dancer.sukria.net/perldancer-website/app.psgi');
+
+# 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');
+die "Unable to read startup script: $psgi" unless -r $psgi;
+
+Plack::Runner->run($psgi);
View
@@ -1,6 +1,17 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
+use Dancer ':syntax';
+use FindBin '$RealBin';
use Plack::Handler::FCGI;
-my $app = do('/srv/dancer.sukria.net/perldancer-website/app.psgi');
-my $server = Plack::Handler::FCGI->new(nproc => 10, detach => 1);
+# 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);
+die "Unable to read startup script: $@" if $@;
+my $server = Plack::Handler::FCGI->new(nproc => 5, detach => 1);
+
$server->run($app);

0 comments on commit 76bf7b0

Please sign in to comment.