Dancer deployment still confusing, difficult and a non-starter
First, the perldancer.org domain was out for several days and emails to dancer-users mailing would bounce back ("rejected by recipient domain"). A conversation on IRC channel revealed that the DNS server was down, but nothing could be done about it until Sukrieh returned from a vacation. Would it be possible to not have such a single point of failure or blocking in the canonical, root domain of the web framework please? It gives the impression that the project has been abandoned. Nevertheless, while I am able to very quickly download, install and even create a basic dancer app, its deployment still remains a mystery to me. First, I will describe my working scenario in the hope that there might others with the same scenario, and then I will list what all I attempted and failed. I apologize for this email's length, but my hope is that it will lead to clearer and easier deployment notes with Dancer. I develop on my MacBook with Perl 5.12.1 installed under /usr/local/bin. My web projects live under ~/Sites, and are served by Apache2 running from /usr/local/apache2 (all custom installations). Any custom Perl libraries I develop go under ~/Library/Perl, and are available to all my web projects. I try to mimic the conditions on the actual production server as much as possible. One such server is a Mac OS X server, so its layout is almost identical to my MacBook, but another is a shared web host, most likely some variant of Linux. On that I get an html docs folder in my home folder, but I don't get access to tinkering with Apache which does all the serving. I can, for the most part, request custom Perl module installations, and I can use .htaccess files. Since these applications eventually get served from their own domain names, I try to not develop using http://localhost/app1 and http://localhost/app2. Doing so confuses me with regards to relative URLs and makes for a bit trickier development. Instead, I use virtual hosts with Apache, and I add the name of the virtual host to my /etc/hosts file. This allows me to get to my apps via http://app1.local and http://app2.local and so on. This way, when I eventually put the app in production, all I have to do is change the the host name from app1.local to app1.org and so on. While developing, I don't really worry about speed, so I just use cgi scripts with Apache... no persistent environment here. In fact, while on the Xserve I can install any persistent environment, on the shared web server I may not even have access to a persistent environment at all. So, I have to develop using the least common denominator, and then deploy with the best possible tools. Also, whatever deployment I choose, it is most likely to be Apache based. While it may not be the fastest, Apache is tried and tested, is available by default on whichever server I choose, and is even required by other projects. Now, on to deployment. The docs at Dancer::Deployment say that deploying http://localhost/dance/dispatch.cgi 500 Internal Server Error - Wrong http://localhost/dance/dispatch.cgi/ 200 OK - Right The above give me a generic Apache 404 error script not found or unable to stat: /Users/punkish/Sites/dance/dispatch.cgi File does not exist: /Users/punkish/Sites/dance/missing.html Actually, both of the above are wrong. It should really be http://localhost/myapp/public/dispatch.cgi/ But, then I get the following errors in Apache logs Unable to open /Users/punkish/Sites/dance/logs/development.log for writing, unable to log at /usr/local/lib/perl5/site_perl/5.12.1/Dancer/Logger/File.pm line 32, <DATA> line 16. Unable to open /Users/punkish/Sites/dance/logs/development.log for writing, unable to log at /usr/local/lib/perl5/site_perl/5.12.1/Dancer/Logger/File.pm line 32. Error while loading /Users/punkish/Sites/dance/app.psgi: unable to load application dance : Can't locate dance.pm in @INC (@INC contains: /Users/punkish/Sites/dance/public/lib /usr/local/lib/perl5/site_perl/5.12.1/darwin-2level /usr/local/lib/perl5/site_perl/5.12.1 /usr/local/lib/perl5/5.12.1/darwin-2level /usr/local/lib/perl5/5.12.1 /usr/local/lib/perl5/site_perl .) at (eval 60) line 2. BEGIN failed--compilation aborted at (eval 60) line 2. Premature end of script headers: dispatch.cgi File does not exist: /Users/punkish/Sites/dance/favicon.ico, referer: http://dance.local/public/dispatch.cgi/ File does not exist: /Users/punkish/Sites/dance/missing.html, referer: http://dance.local/public/dispatch.cgi/ I can fix the errors re. not being able to open development.log for writing by changing permissions on it chmod -R 777 logs but, the Dancer script that creates the logs folder should have set the permissions correctly automatically so Apache can write to it. Nevertheless, the other error is more serious... app.psgi is unable to load application dance because it can't locate dance.pm in @INC. If you see above, @INC contains 'dance/public/lib', but 'lib' is actually sitting one level above under 'dance'. So, I move 'lib' down to 'dance/public'. But, now I get a dancer 404, and the following errors in Apache logs File does not exist: /Users/punkish/Sites/dance/css, referer: http://dance.local/public/dispatch.cgi/ File does not exist: /Users/punkish/Sites/dance/missing.html, referer: http://dance.local/public/dispatch.cgi/ File does not exist: /Users/punkish/Sites/dance/favicon.ico, referer: http://dance.local/public/dispatch.cgi/ File does not exist: /Users/punkish/Sites/dance/missing.html, referer: http://dance.local/public/dispatch.cgi/ So, the interesting thing is, now I am getting the 404 via the dancer 404 template. So, dancer is running, and responding, but it is unable to grok the route. Plus, all the paths in the template are now wrong. Now what do I do? -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu ----------------------------------------------------------------------- Assertions are politics; backing up assertions with evidence is science =======================================================================
Hi, On Sat, 31 Jul 2010 11:38:39 -0500, P Kishor <punk.kish@gmail.com> wrote:
First, the perldancer.org domain was out for several days and emails to dancer-users mailing would bounce back ("rejected by recipient domain"). A conversation on IRC channel revealed that the DNS server was down, but nothing could be done about it until Sukrieh returned from a vacation. Would it be possible to not have such a single point of failure or blocking in the canonical, root domain of the web framework please? It gives the impression that the project has been abandoned.
Indeed, I was off for two weeks with no connection available around me (was on vacation in Spain) and the server where all my personal projects are hosted went down during this time. That's bad luck. I'm aware that gives a negative impression over the all project and people involved with it (developers and users), and for that I sincerly apologize. But you have to remind that Dancer is a free software project, built upon goodwill and freetime, and with no income money at all. That means that we might not have the very best hosting architecture, 24/7 supervision and all what you could expect from a company. Now, I'm openminded: if a company here offers to host perldancer.org, I'll consider the opportunity seriously. [...]
Now, on to deployment. The docs at Dancer::Deployment say that deploying
http://localhost/dance/dispatch.cgi 500 Internal Server Error - Wrong
http://localhost/dance/dispatch.cgi/ 200 OK - Right
The above give me a generic Apache 404 error
script not found or unable to stat: /Users/punkish/Sites/dance/dispatch.cgi File does not exist: /Users/punkish/Sites/dance/missing.html
Actually, both of the above are wrong. It should really be
Well, this is very difficult for me to help you without seing your Apache VirtualHost configuration. You may have done lots of things here, so please, paste your configuration here. [...]
I can fix the errors re. not being able to open development.log for writing by changing permissions on it
chmod -R 777 logs
but, the Dancer script that creates the logs folder should have set the permissions correctly automatically so Apache can write to it.
Hmm, no. You deploy your app under Apache, then you have (as the administrator) to care about permissions. That is, your app will be served by Apache, meaning that the user that runs the Apache process will have to own read/write access to your log files. Dancer as now way do know that before you deploy, and could not change the permission itself as you may need root privileges to do that.
Nevertheless, the other error is more serious... app.psgi is unable to load application dance because it can't locate dance.pm in @INC. If you see above, @INC contains 'dance/public/lib', but 'lib' is actually sitting one level above under 'dance'. So, I move 'lib' down to 'dance/public'. But, now I get a dancer 404, and the following errors in Apache logs
No. You don't want to do that. the lib directory must not be moved. The error (and the fix) is elsewhere. [...]
Now what do I do?
Paste your apache configuration so we can try to reproduce the issue first. Regards, Alexis
On Mon, Aug 2, 2010 at 4:53 AM, sukria <sukria@sukria.net> wrote:
Now, on to deployment. The docs at Dancer::Deployment say that deploying
http://localhost/dance/dispatch.cgi 500 Internal Server Error - Wrong
http://localhost/dance/dispatch.cgi/ 200 OK - Right
The above give me a generic Apache 404 error
script not found or unable to stat: /Users/punkish/Sites/dance/dispatch.cgi File does not exist: /Users/punkish/Sites/dance/missing.html
Actually, both of the above are wrong. It should really be
Well, this is very difficult for me to help you without seing your Apache VirtualHost configuration. You may have done lots of things here, so please, paste your configuration here.
Please note, the above is *not* VirtualHost. The above is plain, vanilla cgi. I am following the exact, word-by-word instructions at http://search.cpan.org/~sukria/Dancer-1.1805/lib/Dancer/Deployment.pod which say that I should go to "http://localhost/myapp/dispatch.cgi/" When I go to http://localhost/dance/dispatch.cgi/ I get the following error in my Apache logs script not found or unable to stat: /Users/punkish/Sites/dance/dispatch.cgi Which makes sense, since dispatch.cgi is *not* at /Users/punkish/Sites/dance/. It is in fact inside /Users/punkish/Sites/dance/public which is where /usr/local/bin/dancer put it. So, when I go to http://localhost/dance/public/dispatch.cgi/ I get the following error in Apache logs Error while loading /Users/punkish/Sites/dance/app.psgi: unable to load application dance : Can't locate dance.pm in @INC (@INC contains: /Users/punkish/Sites/dance/public/lib /usr/local/lib/perl5/site_perl/5.12.1/darwin-2level /usr/local/lib/perl5/site_perl/5.12.1 /usr/local/lib/perl5/5.12.1/darwin-2level /usr/local/lib/perl5/5.12.1 /usr/local/lib/perl5/site_perl .) at (eval 60) line 2. Which also makes sense because dance.pm is in /Users/punkish/Sites/dance/lib. So, I am stuck both ways. Once again, note that this is plain vanilla cgi. I haven't even ventured to VirtualHosts. Now, here is my Apache configuration <Directory "/Users/punkish/Sites/dance"> Options Indexes ExecCGI FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> So, what am I doing wrong? -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu ----------------------------------------------------------------------- Assertions are politics; backing up assertions with evidence is science =======================================================================
On Mon, Aug 2, 2010 at 4:53 AM, sukria <sukria@sukria.net> wrote:
On Sat, 31 Jul 2010 11:38:39 -0500, P Kishor <punk.kish@gmail.com> wrote:
First, the perldancer.org domain was out for several days and emails to dancer-users mailing would bounce back ("rejected by recipient domain"). A conversation on IRC channel revealed that the DNS server was down, but nothing could be done about it until Sukrieh returned from a vacation. Would it be possible to not have such a single point of failure or blocking in the canonical, root domain of the web framework please? It gives the impression that the project has been abandoned.
Indeed, I was off for two weeks with no connection available around me (was on vacation in Spain) and the server where all my personal projects are hosted went down during this time. That's bad luck.
I'm aware that gives a negative impression over the all project and people involved with it (developers and users), and for that I sincerly apologize. But you have to remind that Dancer is a free software project, built upon goodwill and freetime, and with no income money at all. That means that we might not have the very best hosting architecture, 24/7 supervision and all what you could expect from a company.
Yes, of course, and I (and I am sure others) are very grateful to you for creating this really great framework and putting it out in open source. I guess, the key is, now that others are discovering how lovely Dancer can be, it might be worthwhile investigating how to make its hosting a bit more robust. One easy way would be to host it at a location where more than one person has control over the DNS or other aspects that might go down from time to time. That way, if one person is away for an extended period of time, and something goes wrong, there is at least one backup. If you are looking for reliable DNS, OpenDNS (or even Google's DNS) might be an option to consider. For mailing lists, Google Groups might be an option. If you are looking for a free or inexpensive web host, once again, any one of the shared hosts might be an option. Here in the US, I can get a shared host for less than $10 a month with complete shell access. In fact, I would contend that putting perldancer.org on a shared host might be instructive anyway to iron out the kinks of hosting Dancer-based web sites on a shared host. I believe github too allows hosting a web site. Anyway, the point is -- this is a great project, and it would be worth while making its mailing list and web site more robust. And, it would most likely be somewhere between free and very inexpensive. -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu ----------------------------------------------------------------------- Assertions are politics; backing up assertions with evidence is science =======================================================================
On Monday 02 August 2010 16:24:24 P Kishor wrote:
On Mon, Aug 2, 2010 at 4:53 AM, sukria <sukria@sukria.net> wrote: I guess, the key is, now that others are discovering how lovely Dancer can be, it might be worthwhile investigating how to make its hosting a bit more robust.
Yep, that's something that has been discussed, and I'm sure we'll sort something out. I personally work for a web host, and I'm sure I could get a VPS set up for Dancer to be hosted on, where multiple people could have accounts. Even providing secondary DNS from my nameserver would be a good step in the right direction.
If you are looking for reliable DNS, OpenDNS (or even Google's DNS) might be an option to consider.
Both of those offer caching resolvers, not authoritative nameservers, but yes, there are good options out there. The key point is having more than one person who can access it. Cheers Dave P -- David Precious <davidp@preshweb.co.uk> http://blog.preshweb.co.uk/ www.preshweb.co.uk/twitter www.preshweb.co.uk/linkedin www.preshweb.co.uk/facebook www.preshweb.co.uk/identica www.lyricsbadger.co.uk "Programming is like sex. One mistake and you have to support it for the rest of your life". (Michael Sinz)
participants (3)
-
David Precious -
P Kishor -
sukria