Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Dancer + cgi

by slatibart (Acolyte)
on Mar 20, 2012 at 18:50 UTC ( #960626=note: print w/ replies, xml ) Need Help??


in reply to Re: Dancer + cgi
in thread Dancer + cgi

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.

but
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.


Comment on Re^2: Dancer + cgi
Select or Download Code
Re^3: Dancer + cgi
by druthb (Beadle) on Mar 20, 2012 at 18:58 UTC

    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
Re^3: Dancer + cgi
by aaron_baugher (Deacon) on Mar 21, 2012 at 10:37 UTC

    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://960626]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2014-09-18 00:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (101 votes), past polls