Skip Menu |

This queue is for tickets about the Plack-App-Apache-ActionWrapper CPAN distribution.

Report information
The Basics
Id: 63825
Status: resolved
Priority: 0/
Queue: Plack-App-Apache-ActionWrapper

People
Owner: Nobody in particular
Requestors: ronaldxs [...] software-path.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.02
Fixed in: (no value)



Subject: Win32 compatibility/platform independence and Plack::Server deprecated
Hi, I got the module working under Ubuntu Linux and partially working on Windows Vista but on Win32 when I tried to bring up the index URL (eg http://localhost) I got the "No .psgi file found" error. On looking into the problem I noticed that _resolve_app_filename was assuming that the path separator for the PATH_TRANSLATED was the forward '/' which is not true on Win32 Apache 2.X where you get '\' backslash separators. So this patch uses File::Spec to split up and rejoin path segments until it finds the longest path section that maps to a file. This should make _resolve_app_filename more platform independent. I am new to Plack but noticed in the docs that the Plack::Server modules, referred to in your POD, are now deprecated. So this patch includes about two lines that change the Plack::Server references to Plack::Handler and I have tested with the changed psgi.fcgi and it seems to work. The patch has been tested under Windows Vista with Strawberry Perl 5.12 and Apache 2.2 and Ubuntu 8.04 with Perl 5.8.8 and Apache 2.2.8. Good luck and thanks for the module, Ron
Subject: ActionWrapper.pm.patch
10c10 < --- > use File::Spec; 59a60,62 > my ($vol, $pt_dir) = File::Spec->splitpath($path_translated); > my @path_parts = File::Spec->splitdir($pt_dir); > 61,64c64,68 < my @path_parts = split(m{/}, $path_translated); < while ( ! -r join("/", @path_parts) ) { < last if @path_parts == 0; # Break out if we're at the end < pop @path_parts; --- > while ( not -r $path_translated and @path_parts ) { > my $f = pop @path_parts; > $path_translated = File::Spec->catpath( > $vol, File::Spec->catdir(@path_parts), $f > ); 67,74c71 < # Return undef (that is, no app) if no path part was a readable file < return if @path_parts == 0; < < # Execute the contents of the file and return last variable defined in it < my $psgi_file = join("/", @path_parts ); < < # Cache the app to allow persistent running < return $psgi_file; --- > return -r $path_translated && $path_translated; 166,167c163,164 < use Plack::Server::FCGI; < Plack::Server::FCGI->new->run($app); --- > use Plack::Handler::FCGI; > Plack::Handler::FCGI->new->run($app);
On Sat Dec 11 13:11:31 2010, ronaldxs wrote: Show quoted text
> Hi, > I got the module working under Ubuntu Linux and partially working on > Windows Vista but on Win32 when I tried to bring up the index URL (eg > http://localhost) I got the "No .psgi file found" error. On looking > into the problem I noticed that _resolve_app_filename was assuming that > the path separator for the PATH_TRANSLATED was the forward '/' which is > not true on Win32 Apache 2.X where you get '\' backslash separators. > So this patch uses File::Spec to split up and rejoin path segments > until it finds the longest path section that maps to a file. This > should make _resolve_app_filename more platform independent.
I've applied the patch on https://github.com/robinsmidsrod/Plack-App-Apache-ActionWrapper, commit 07f05ef2e9d9e48a653495cb8f5a118827d4b108. Could you test it out on your system and verify that it works as intended? Show quoted text
> I am new to Plack but noticed in the docs that the Plack::Server > modules, referred to in your POD, are now deprecated. So this patch > includes about two lines that change the Plack::Server references to > Plack::Handler and I have tested with the changed psgi.fcgi and it > seems to work.
Thanks for the catch! Didn't know that it had been deprecated. Have applied that fix in the same commit as well.
From: ronaldxs [...] software-path.com
Show quoted text
> Could you test it out on your system and verify that it works as
intended? Show quoted text
>
I did a git clone and copied over the module on my Win/Vista system and did some basic testing which checked out fine. Thanks, Ron
Released version 0.30.0 to CPAN with your patch included. Should close this issue.