[dancer-users] apache2 and fastcgi

CHONG Yu Meng yumeng.chong at invictus.com.sg
Thu Mar 8 01:53:24 GMT 2018

Hi Scott,

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!

From: dancer-users <dancer-users-bounces at dancer.pm> On Behalf Of Scott H
Sent: Thursday, 8 March 2018 1:49 AM
To: Perl Dancer users mailing list <dancer-users at dancer.pm>
Subject: Re: [dancer-users] apache2 and fastcgi

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.

On Wed, Mar 7, 2018 at 10:37 AM, Scott H <scott.harpster at gmail.com<mailto:scott.harpster at gmail.com>> wrote:
forgot to paste in my config of apache site:
<VirtualHost *:80>
        ServerName www.example.com<http://www.example.com>

        # /srv/www.example.com<http://www.example.com> is the root of your
        # dancer application
        DocumentRoot /opt/guestaccess/millard/public

        ServerAdmin webmaster at domain.com<mailto:webmaster at domain.com>

        # XXX Start a FastCGI server to run in the background
        FastCgiServer /opt/guestaccess/millard/public/dispatch.fcgi

        <Directory "/opt/guestaccess/millard/public">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            # XXX Use FastCGI handler instead of CGI
            AddHandler fastcgi-script .fcgi
            # Apache 2.2
            #Order allow,deny
            #Allow from all
            # Apache 2.4
            Require all granted

        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f
        # Run FastCGI dispatcher instead of CGI dispatcher
        RewriteRule ^(.*)$ /dispatch.fcgi$1 [QSA,L]

        ErrorLog  /var/log/apache2/millard-error.log
        CustomLog /var/log/apache2/millard-access_log common

On Wed, Mar 7, 2018 at 10:35 AM, Scott H <scott.harpster at gmail.com<mailto:scott.harpster at gmail.com>> wrote:
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.

Im running into an issue with setting up fast cgi.

[Wed Mar 07 10:31:26.962311 2018] [fastcgi:error] [pid 20247] [client<>] FastCGI: comm with server "/opt/guestaccess/millard/public/dispatch.fcgi" aborted: idle timeout (30 sec)
[Wed Mar 07 10:31:26.962415 2018] [fastcgi:error] [pid 20247] [client<>] FastCGI: incomplete headers (0 bytes) received from server "/opt/guestaccess/millard/public/dispatch.fcgi"

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.


I followed that guide but it doesnt seem to work. I went with mod_fastcgi.

This is on ubuntu 16.04.x LTS.

Worst case is i setup starman and proxy it but i dont really want to do that this time. What am i missing?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20180308/62569e43/attachment.html>

More information about the dancer-users mailing list