<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-SG" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi Scott, <o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">I had a lot of trouble setting up FastCGI for Dancer2 previously. Are you using mod_fcgid or mod_fastcgi, and besides the Apache configuration, was there any other configuration you needed to do?
Thanks in advance for your help!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> dancer-users <dancer-users-bounces@dancer.pm>
<b>On Behalf Of </b>Scott H<br>
<b>Sent:</b> Thursday, 8 March 2018 1:49 AM<br>
<b>To:</b> Perl Dancer users mailing list <dancer-users@dancer.pm><br>
<b>Subject:</b> Re: [dancer-users] apache2 and fastcgi<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Okay, nvm carry on everyone. I was missing a module that was showing up in my apache2 error.log but i was checking my millard-error.log...modifying my cpanfile to fix that for future pushes. Doh.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Wed, Mar 7, 2018 at 10:37 AM, Scott H <<a href="mailto:scott.harpster@gmail.com" target="_blank">scott.harpster@gmail.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal">forgot to paste in my config of apache site:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><VirtualHost *:80><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> ServerName <a href="http://www.example.com" target="_blank">
www.example.com</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> # /srv/<a href="http://www.example.com" target="_blank">www.example.com</a> is the root of your<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> # dancer application<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> DocumentRoot /opt/guestaccess/millard/public<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> ServerAdmin <a href="mailto:webmaster@domain.com" target="_blank">
webmaster@domain.com</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> # XXX Start a FastCGI server to run in the background<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> FastCgiServer /opt/guestaccess/millard/public/dispatch.fcgi<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> <Directory "/opt/guestaccess/millard/public"><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> AllowOverride None<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> # XXX Use FastCGI handler instead of CGI<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> AddHandler fastcgi-script .fcgi<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> # Apache 2.2<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> #Order allow,deny<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> #Allow from all<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> # Apache 2.4<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> Require all granted<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> </Directory><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> RewriteEngine On<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> RewriteCond %{REQUEST_FILENAME} !-f<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> # Run FastCGI dispatcher instead of CGI dispatcher<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> RewriteRule ^(.*)$ /dispatch.fcgi$1 [QSA,L]<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> ErrorLog /var/log/apache2/millard-error.log<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> CustomLog /var/log/apache2/millard-access_log common<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"></VirtualHost><o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Wed, Mar 7, 2018 at 10:35 AM, Scott H <<a href="mailto:scott.harpster@gmail.com" target="_blank">scott.harpster@gmail.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal">I usually use the apache2 plack handler but from what I understand you cant do that if you plan on using apache for more then 1 dancer site.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Im running into an issue with setting up fast cgi.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">[Wed Mar 07 10:31:26.962311 2018] [fastcgi:error] [pid 20247] [client
<a href="http://205.125.62.200:50442" target="_blank">205.125.62.200:50442</a>] FastCGI: comm with server "/opt/guestaccess/millard/public/dispatch.fcgi" aborted: idle timeout (30 sec)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">[Wed Mar 07 10:31:26.962415 2018] [fastcgi:error] [pid 20247] [client
<a href="http://205.125.62.200:50442" target="_blank">205.125.62.200:50442</a>] FastCGI: incomplete headers (0 bytes) received from server "/opt/guestaccess/millard/public/dispatch.fcgi"<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I first had to chmod +x dispatch.fcgi so it would execute. I then set apache2 to do prefork rather then event mpm. chowned www-data user to own the dancer2 folder, Now I am getting those errors.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="http://goog_401013921" target="_blank"><br>
</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="http://search.cpan.org/dist/Dancer2/lib/Dancer2/Manual/Deployment.pod#As_a_FastCGI_script" target="_blank">http://search.cpan.org/dist/Dancer2/lib/Dancer2/Manual/Deployment.pod#As_a_FastCGI_script</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I followed that guide but it doesnt seem to work. I went with mod_fastcgi.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">This is on ubuntu 16.04.x LTS.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Worst case is i setup starman and proxy it but i dont really want to do that this time. What am i missing?<o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>