<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I followed the instructions in the Dancer2 deployment guide for <a
href="http://search.cpan.org/%7Esukria/Dancer2-0.01/lib/Dancer2/Deployment.pod#Running_as_a_cgi-script_%28or_fast-cgi%29">running
as a cgi-script</a> but I am getting HTTP 504 Gateway Time-out
when I try to access my application in a browser. I am brand new to
the world of PSGI/Plack so I could be way off in my diagnosis, but
it looks like when I request<br>
<br>
<a class="moz-txt-link-freetext" href="http://">http://</a><hostname>/<br>
<br>
from a remote host, dispatch.cgi starts up a server listening on
port 3000 and then just sits there waiting for input until the
request times out. Here's what I see in my Apache error log:<br>
<br>
[Mon Nov 04 09:44:32 2013] [error] [client 128.117.20.57]
[ip2map:30142] core @2013-11-04 09:44:32> Registered
Dancer2::Core::DSL__WITH__Dancer2::Plugin::Ajax=HASH(0x3414560) in
/var/www/ip2map/public/../lib/ip2map.pm l. 3<br>
[Mon Nov 04 09:44:32 2013] [error] [client 128.117.20.57]
[ip2map:30142] core @2013-11-04 09:44:32> Registered
Dancer2::Core::DSL__WITH__Dancer2::Plugin::Ajax__WITH__Dancer2::Plugin::Database=HASH(0x3414560)
in /var/www/ip2map/public/../lib/ip2map.pm l. 4<br>
[Mon Nov 04 09:44:32 2013] [error] [client 128.117.20.57] >>
Dancer2 v0.10 server 30142 listening on <a class="moz-txt-link-freetext" href="http://0.0.0.0:3000">http://0.0.0.0:3000</a><br>
[Mon Nov 04 09:44:32 2013] [error] [client 128.117.20.57] >>
Dancer2::Plugin::Ajax (0.10)<br>
[Mon Nov 04 09:44:32 2013] [error] [client 128.117.20.57] >>
Dancer2::Plugin::Database (2.10)<br>
[Mon Nov 04 09:45:32 2013] [warn] [client 128.117.20.57] Timeout
waiting for output from CGI script
/var/www/ip2map/public/dispatch.cgi<br>
[Mon Nov 04 09:45:32 2013] [error] [client 128.117.20.57] Script
timed out before returning headers: dispatch.cgi<br>
<br>
Here is my Apache configuration (Apache v2.2.15):<br>
<br>
NameVirtualHost *:80<br>
<br>
<VirtualHost *:80><br>
ServerName mcmes21.cgd.ucar.edu<br>
ServerAlias mcmes21<br>
DocumentRoot /var/www/ip2map/public<br>
ServerAdmin <a class="moz-txt-link-abbreviated" href="mailto:mcarey@ucar.edu">mcarey@ucar.edu</a><br>
<br>
<Directory "/var/www/ip2map/public"><br>
AllowOverride None<br>
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch<br>
Order allow,deny<br>
Allow from all<br>
AddHandler cgi-script .cgi<br>
</Directory><br>
<br>
RewriteEngine On<br>
RewriteCond %{REQUEST_FILENAME} !-f<br>
RewriteRule ^(.*)$ /dispatch.cgi$1 [QSA,L]<br>
<br>
ErrorLog /var/log/httpd/ip2map-error_log<br>
CustomLog /var/log/httpd/ip2map-access_log common<br>
</VirtualHost><br>
<br>
Note that my application works fine when served with Starman via
mod_proxy with the following Apache configuration:<br>
<br>
NameVirtualHost *:80<br>
<br>
<VirtualHost *:80><br>
ServerName mcmes21.cgd.ucar.edu<br>
ServerAlias mcmes21<br>
<br>
DocumentRoot /var/www/ip2map<br>
<br>
<Proxy *><br>
Order deny,allow<br>
Allow from all<br>
</Proxy><br>
<br>
ProxyPass / <a class="moz-txt-link-freetext" href="http://localhost:5000/">http://localhost:5000/</a><br>
ProxyPassReverse / <a class="moz-txt-link-freetext" href="http://localhost:5000/">http://localhost:5000/</a><br>
</VirtualHost><br>
<br>
Does anyone know how I can get this working as CGI?<br>
<br>
--Max<br>
</body>
</html>