[mp2] mason and not using compat?

[mp2] mason and not using compat?

am 25.10.2004 07:10:03 von Carl Brewer

Hello,

I'm fiddling with Mason on apache2 (NetBSD 1.6.2 & 2.0RC's)
and I'd like to use mp2 in native mode, not compat.

I found :

http://www.masonhq.com/?ApacheModPerl2

And the hack in there I haven't yet tried, but does anyone
know of any plans to make this a bit neater?

Thanks

Carl


--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Re: [mp2] mason and not using compat?

am 25.10.2004 21:56:52 von gozer

--------------enig8E0848D421D513696EFE9EA7
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Carl Brewer wrote:
>
> Hello,
>
> I'm fiddling with Mason on apache2 (NetBSD 1.6.2 & 2.0RC's)
> and I'd like to use mp2 in native mode, not compat.
>
> I found :
>
> http://www.masonhq.com/?ApacheModPerl2
>
> And the hack in there I haven't yet tried, but does anyone
> know of any plans to make this a bit neater?

I believe there is a CPAN module that makes it a bit cleaner and
less hack-ish:

MasonX::Apache2Handler
http://search.cpan.org/dist/MasonX-Apache2Handler

> Thanks
>
> Carl
>
>

--
------------------------------------------------------------ --------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

--------------enig8E0848D421D513696EFE9EA7
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBfVqEyzKhB4jDpaURAvS5AKC0Pe5K8br6V/xrApTQI8F+8g9lJwCf W77Z
GJm3zWu13PcAOC6jSRg2IUE=
=+UcB
-----END PGP SIGNATURE-----

--------------enig8E0848D421D513696EFE9EA7--

Re: [mp2] mason and not using compat? - Can"t locate object method"server_root_relative"

am 26.10.2004 05:36:48 von Carl Brewer

Philippe M. Chiasson wrote:
> Carl Brewer wrote:
>

> I believe there is a CPAN module that makes it a bit cleaner and
> less hack-ish:
>
> MasonX::Apache2Handler
> http://search.cpan.org/dist/MasonX-Apache2Handler

Thanks Philippe, I've found that now and built a NetBSD pkg for it.

But, I'm having trouble using it. I really want to stay clear of
mp1, but am having trouble getting this handler to work.

I keep seeing this :

[Tue Oct 26 13:28:53 2004] [error] [client 211.26.251.34] Can't locate
object method "server_root_relative" via package "Apache::ServerRec" at
/usr/pkg/lib/perl5/site_perl/5.8.4/MasonX/Apache2Handler.pm line 618.\n


My setup at the moment (which is very fluid as I try things to try and
fix the problem!) :


DocumentRoot /home/benfab/htdocs
ServerName benfab.bl.echidna.id.au

ErrorLog /home/benfab/logs/error_log
CustomLog /home/benfab/logs/access_log common

Alias /admin/ "/home/benfab/admin/"

# these four lines apply to Apache2+mod_perl2 only: {{{
PerlSetVar MasonArgsMethod CGI
#PerlModule Apache2 Apache::compat
PerlModule Apache2
PerlRequire "/home/benfab/lib/startup.pl"

#PerlModule Apache::Reload
#PerlModule Apache::Request
#PerlModule Apache::Cookie
#PerlInitHandler Apache::Reload
#PerlSetVar ReloadAll Off

#PerlSetVar _MasonUser www
#PerlSetVar _MasonGroup www
#PerlSetVar _MasonDefaultDocumentRoot "/home/benfab/htdocs"

#RewriteEngine On
#RewriteRule ^(.*)/$ $1/index.html


SetHandler perl-script
#PerlHandler HTML::Mason::ApacheHandler
PerlResponseHandler MasonX::Apache2Handler


SetHandler perl-script
#PerlInitHandler Apache::Constants::NOT_FOUND



#SetHandler perl-script
#PerlHandler HTML::Mason::ApacheHandler
SetOutputFilter DEFLATE




the startup.pl script is :
# http://perl.apache.org/docs/2.0/user/config/config.html

use Apache2 ();
# /usr/pkg/lib/perl5/site_perl/5.8.4/HTML/Mason/ApacheHandler. pm
use lib qw(/home/benfab/lib
/usr/pkg/lib/perl5/site_perl/5.8.4/HTML/Mason/);

use ModPerl::Util (); #for CORE::GLOBAL::exit

use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::RequestUtil ();

use Apache::ServerRec ();
use Apache::ServerUtil ();
use Apache::Connection ();
use Apache::Log ();

use APR::Table ();
use APR::Pool ();

use ModPerl::Registry ();

use Apache::Const -compile => ':common';
use APR::Const -compile => ':common';

1;


From googling around, the error message is something to
do with mp2 in compat mode, which I'm specifically trying to
eliminate and avoid - and as my test page is simply this :

/home/benfab/htdocs/index.html
<% 2+2 %>

I'm not using anything that should or could call it?

any suggestions?

Carl



--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Re: [mp2] mason and not using compat? - Can"t locate object method"server_root_relative"

am 26.10.2004 05:52:53 von Randy Kobes

On Tue, 26 Oct 2004, Carl Brewer wrote:

> Philippe M. Chiasson wrote:
> > Carl Brewer wrote:
> >
>
> > I believe there is a CPAN module that makes it a bit cleaner and
> > less hack-ish:
> >
> > MasonX::Apache2Handler
> > http://search.cpan.org/dist/MasonX-Apache2Handler
>
> Thanks Philippe, I've found that now and built a NetBSD pkg for it.
>
> But, I'm having trouble using it. I really want to stay clear of
> mp1, but am having trouble getting this handler to work.
>
> I keep seeing this :
>
> [Tue Oct 26 13:28:53 2004] [error] [client 211.26.251.34] Can't locate
> object method "server_root_relative" via package "Apache::ServerRec" at
> /usr/pkg/lib/perl5/site_perl/5.8.4/MasonX/Apache2Handler.pm line 618.\n

From the mp2 Changes file, ($r|$c|$s)->server_root_relative
has been removed. There is a suggested alternative, which
for MasonX::Apache2Handler translates to (untested):
============================================================ ===
--- Apache2Handler.pm~ Sun Apr 11 17:02:16 2004
+++ Apache2Handler.pm Mon Oct 25 22:47:12 2004
@@ -615,7 +615,7 @@
if (exists $allowed_params->{data_dir} and not exists $params{data_dir})
{
# constructs path to /mason
- my $def = $defaults{data_dir} = Apache->server->server_root_relative('mason');
+ my $def = $defaults{data_dir} = File::Spec->catfile(Apache::ServerUtil::server_root, 'mason');
param_error "Default data_dir (MasonDataDir) '$def' must be an absolute path"
unless File::Spec->file_name_is_absolute($def);

============================================================ =============

--
best regards,
randy kobes

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Re: [mp2] mason and not using compat? - Can"t locate object method"server_root_relative"

am 26.10.2004 06:00:34 von Carl Brewer

Randy Kobes wrote:

> From the mp2 Changes file, ($r|$c|$s)->server_root_relative
> has been removed. There is a suggested alternative, which
> for MasonX::Apache2Handler translates to (untested):
> ============================================================ ===
> --- Apache2Handler.pm~ Sun Apr 11 17:02:16 2004
> +++ Apache2Handler.pm Mon Oct 25 22:47:12 2004
> @@ -615,7 +615,7 @@
> if (exists $allowed_params->{data_dir} and not exists $params{data_dir})
> {
> # constructs path to /mason
> - my $def = $defaults{data_dir} = Apache->server->server_root_relative('mason');
> + my $def = $defaults{data_dir} = File::Spec->catfile(Apache::ServerUtil::server_root, 'mason');
> param_error "Default data_dir (MasonDataDir) '$def' must be an absolute path"
> unless File::Spec->file_name_is_absolute($def);
>
> ============================================================ =============

Thanks Randy,

Has this been submitted to Beau Cox by you or anyone?

Carl




--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Re: [mp2] mason and not using compat? - Can"t locate object method"server_root_relative"

am 26.10.2004 06:07:04 von Carl Brewer

Randy Kobes wrote:

> From the mp2 Changes file, ($r|$c|$s)->server_root_relative
> has been removed. There is a suggested alternative, which
> for MasonX::Apache2Handler translates to (untested):
> ============================================================ ===
> --- Apache2Handler.pm~ Sun Apr 11 17:02:16 2004
> +++ Apache2Handler.pm Mon Oct 25 22:47:12 2004
> @@ -615,7 +615,7 @@
> if (exists $allowed_params->{data_dir} and not exists $params{data_dir})
> {
> # constructs path to /mason
> - my $def = $defaults{data_dir} = Apache->server->server_root_relative('mason');
> + my $def = $defaults{data_dir} = File::Spec->catfile(Apache::ServerUtil::server_root, 'mason');
> param_error "Default data_dir (MasonDataDir) '$def' must be an absolute path"
> unless File::Spec->file_name_is_absolute($def);
>
> ============================================================ =============
>

That works, btw. Thankyou. Now if Beau can update
the Apache2Handler, it'll all be good!

Carl




--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html