Question

I have a prototype application (RESTful web service database front-end) that is written using Dancer. As a prototype this runs fine under Apache with mod_proxy, and Dancer's routes work really nice.

My next step is to see if I can get this to scale a bit as some of the queries can be very slow and I don't want the slow queries blocking other requests.

I'd like to use rpms to manage the needed perl modules. For Dancer, this is no problem as CentOS-6 plus EPEL provide sufficient rpms to allow me to build/install Dancer and Dancer::Plugin::Database rpms. Trying to build Plack rpms isn't working nearly as well however due to a varietly of reasons, one of which is that some of the system modules are too low a version number (and no, overwriting the system rpms with higher version local builds is not considered an option).

EPEL does provide rpms for CGI::Emulate::PSGI and HTTP::Server::Simple::PSGI but I'm not seeing how to wrangle either one of them into a desired solution.

So, my question is: Is there a clean/maintainable way to get Dancer running on CentOS-6 with pre-forking? Barring that, how does one get Apache to play nicely with a local perl install (where I can use tools like cpanm to install things)?

Was it helpful?

Solution

I highly recommend you the use of perlbrew, and forget the system perl.

OTHER TIPS

If you want to restrict yourself to the packages shipped with CentOS, then you can run your Dancer app under mod_perl. There is a Plack adapter for mod_perl, so it is rather straightforward.

For example

<Location /myapp>
  SetHandler perl-script
  PerlHandler Plack::Handler::Apache2
  PerlSetVar psgi_app /var/www/html/myapp.example.com/app.psgi
</Location>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top