in reply to Dancer + cgi

Take a look at plackup - it's painless:

plackup -E deployment -s Starman --workers=10 -p 80 -a bin/

Replies are listed 'Best First'.
Re^2: Dancer + cgi
by slatibart (Sexton) on Mar 20, 2012 at 18:50 UTC
    I don't get it. Dancer::Deployment says:

    In providing ultimate flexibility in terms of deployment, your Dancer app can be run as a simple cgi-script out-of-the-box. No additional web-server configuration needed. Your web server should recognize .cgi files and be able to serve Perl scripts.

    use Dancer; get '/' => sub { return 'Hello World!'; }; dance;
    still binds to Port 3000.
    print "Content-type: text/html\n\n"; print "hello";

    but this perl script is working.

    Still clueless after reading a lot of documentation.

      In that same paragraph, Dancer::Deployment asserts that you have to have Plack::Runner installed. (Not, mind, that you have to use it) It *sounds* like it might not be, maybe. I've not had the problem you're describing, so I'm kinda feeling around here. And yeah, you'll need to at least set up a rewrite rule in .htaccess, even if you can't monkey with the server Apache config.

      The only time I've seen a Dancer script bind on its' own, is when you run it from the command line, so what you're describing seems very peculiar to me.

      D Ruth Bavousett

      When you run a Dancer app as a CGI, you don't run your script that has 'dance' in it. You use the httpd.conf or .htaccess rewrite rules in the first section of Dancer::Deployment, which redirects all URLs through the dispatch.cgi (or dispatch.fcgi for FastCGI) that is created when you create your Dancer app with the 'dancer' program. That dispatch program takes the URLs and passes them to your routes, after which point it works like it'd work as a standalone server or using any other deployment method.

      Aaron B.
      My Woefully Neglected Blog, where I occasionally mention Perl.