talexb has asked for the wisdom of the Perl Monks concerning the following question:

I originally implemented a REST interface to my web application using the mod_rewrite rule and this worked fine for GET operations (list available projects, show project detail) but did not work for POST operations (upload a file to a project). Since I used the CGI::Application framework to build the web app, I thought I'd use CGI::Application::Plugin::Apache::Request to create a request handler as an alternative solution.

This module requires Apache2::Request, a module I'm not familiar with. Among many other things, the documentation says

This is a potential problem, because my web application already happily does file uploads using CGI.

Well, I gave the module a shot anyway, and using cpan install Apache2::Request the process died with

build/version_check.pl failed: \ no version_string found in '' for 'apache2'.
at the end. I'm not really sure what this means. I have Apache 2.2.3 installed:
[Thu Jan 03 13:02:12 2008] [info] Server: Apache/2.2.3, \ Interface: mod_ssl/2.2.3, Library: OpenSSL/0.9.8b
so I believe I have everything I need .. but it seems my environment isn't right. Thoughts?

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Replies are listed 'Best First'.
Re: REST, CGI::Application::Plugin::Apache and Apache2::Request
by friedo (Prior) on Jan 03, 2008 at 20:45 UTC
    I don't have any particular advice for Apache2::Request as I haven't used it, but have you considered CGI::Application::Dispatch? It makes REST-like URLs very easy to configure without having to mess around with Apache directly.

      Hoo boy. This module looks exactly like what I'm looking for, and it's also by Michael Peters. Many thanks. I guess the moral of the story is, next time, look at everything else the author's written.

      Alex / talexb / Toronto

      "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Re: REST, CGI::Application::Plugin::Apache and Apache2::Request
by Khen1950fx (Canon) on Jan 03, 2008 at 21:47 UTC
    I've never been able to install Apache2::Request via CPAN. It won't make; however, I did manage to get it installed by downloading libapreq2. Then, I used the following for ./configure:

    ./configure --enable-shared --with-gnu-ld --enable-perl-glue --with-pe +rl=/usr/bin/perl --with-apache2-apxs=/usr/sbin/apxs --with-httpd=/usr/sbin/httpd

    Then I ran /sbin/ldconfig /usr/lib. To double-check, I ran pmpath on Apache2::Request, and it found it.