[Dancer-users] Dancer deployment bugs with Plack::Handler::Apache2

Assaf Gordon gordon at cshl.edu
Wed Oct 19 18:33:14 CEST 2011


I've deployed two Dancer applications on one apache server using "Plack::Handler::Apache2" (one is the "SimpleCrud" test page mentioned yesterday), and I'm experiencing very strange bugs:

It seems the two applications are conflicting, when routes or templates from one application are used by the other.

That is, the deployment in Apache is as follows:
<Location /labmembers/gordon/simple_crud>
	SetHandler perl-script
	PerlHandler Plack::Handler::Apache2
	PerlSetVar psgi_app /home/gordon/projects/simple_crud_sortable/bin/app.pl

<VirtualHost *:80>
    ServerName xxxxx.cshl.edu
    ServerAlias xxxxx
    DocumentRoot /var/www/data/xxxxx/

    <Location "/">
	    Order Deny,Allow
	    Deny from all
	    Allow from cshl.edu
	    SetHandler perl-script
	    PerlHandler Plack::Handler::Apache2
	    PerlSetVar psgi_app /var/www/data/xxxxx/dancer/bin/app.pl

And when I browse to the virtual server ( http://xxxxx.cshl.edu ), I most of the times get the correct page, but sometimes I get this error:
'/home/gordon/projects/simple_crud_sortable/views/about/index.tt' is not a regular file at /usr/lib/perl5/site_perl/5.8.8/Dancer.pm line 161
That is: visiting the new application somehow tries to fetch a template from the "simple_crud" application (probably because a wrong route from "simple_crud" was used).

I know it sound strange (or unbelievable?), but it has happened several times (not always, though, so it's hard to pin-point).
Additionally, several static files (css/images) sometimes returns HTTP-404 - which I guess is also related to routes mix-up.

viewing the "/var/log/httpd/error_log" file, I can see dancer debug messages trying to match rountes from my other application even if I visit "http://cancan.cshl.edu/labmembers/gordon/simple_crud/genes". 

Has any one encountered such behavior ?
Or is no one deploying production application using "Plack::Handler::Apache2" ?


More information about the Dancer-users mailing list