deployment woes (general note)
Dancer has been out a while now, and is used widely. Yet, I still continue to encounter major difficulties and puzzlement in deploying multiple Dancer apps. I don't believe I have particularly weird requirements, yet, I don't see much noise wrt deployment. That leads me to believe that I am understanding Dancer's deployment mechanism inadequately. Here is my general deployment scenario -- I have a Mac OS X server with Apache, and several "institutional" web sites served off of that. Let's call them /Library/WebServer/Documents/proj1 [http://myserver.edu/proj1] /Library/WebServer/Documents/proj2 [http://myserver.edu/proj2] .. I don't want to mess with the above at all, and want to tinker with httpd.conf as minimally as possible. I log into my account on the computer, use perlbrew to install the latest perl under /Users/punkish/perl5, install all my own perl modules including Starman, and make the following Dancer applications [1] /Users/punkish/Sites/myapp1 [http://myserver.edu/myapp1] [2] /Users/punkish/Sites/myapp2 [http://myapp2.myserver.edu] [3] /Users/punkish/Sites/myapp3 [http://myapp3.org] [4] /Users/punkish/Sites/myapp4 [http://myapp4.myapp3.org] [1] appears as just a sub-directory myserver.edu, not unlike proj1 and proj2. [2] is a sub-domain of myserver.edu [3] is a completely separate domain [4] is a sub-domain of [3] I also have the following as a common location for various JavaScript libraries, and a few css templates, I use for all my apps [0] /Users/punkish/Sites/lib [http://myserver.edu/punkish/lib] [<relative to any app>/lib] So, I can serve [1] using Starman with the following configuration ---- ## web.psgi use Dancer ':syntax'; use Plack::Builder; setting apphandler => 'PSGI'; my $htdocs = '/Users/punkish/Sites'; my $foo = sub { my $env = shift; local $ENV{DANCER_APPDIR} = "$htdocs/foo"; setting appdir => "$htdocs/foo"; load_app "foo"; Dancer::App->set_running_app('foo'); Dancer::Config->load; my $request = Dancer::Request->new( env => $env ); Dancer->dance( $request ); }; builder { # The following allows serving files from /lib # much like the Alias directive in Apache enable "Static", path => sub { s!^/lib/!! }, root => "/Users/punkish/Sites/lib"; mount "/foo" => builder {$foo}; }; ---- I can serve [2], [3], and [4] using Apache VirtualHost directive, but can I do that using Starman? Puneet.
Hey :) On Mon, Jul 4, 2011 at 6:53 AM, Mr. Puneet Kishor <punk.kish@gmail.com>wrote:
[...] That leads me to believe that I am understanding Dancer's deployment mechanism inadequately.
I suspect so as well. It would appear people are making a gratuitous usage of Dancer in many instances which brings about really weird situations. Often times it's a bug, or a mis-feature (so to speak) but I'm beginning to see more and more incorrect (or, I should probably say, overtly-complex) usages of Dancer. I think this is also why you're seeing relatively little participation from the core team in the mailing list in general. We actually look sometimes at questions with a puzzled face, "how did they reach that?", unable to answer. My goal in the mailing list now is to clean up everything. Generally everything should be either a mis-usage, or a bug, or a question that has a simple answer ("how do I...?"). Hopefully I'll be able to answer as many emails as possible and direct people to the right direction. Regarding your predicament, it is well ongoing and we should certainly figure this out. It does trouble me quite a bit that someone is heavily building (and counting) on Dancer but has a hard time deploying their situation. I'll try and read your explanations (thank you for including them!) later today and provide you with an answer. However, you could help us quite a bit by going over the deployment document and telling us what's not right about it for you. Either your situation doesn't exist or the instructions are incorrect. It would really benefit everyone to incorporate your situation and needs so the next person would not have to face the obstacles you've faced. And thanks for understanding, and being supporting, and respectful. :) S.
participants (2)
-
Mr. Puneet Kishor -
sawyer x