Re: choice of mod_perl technology for news site
I'm not really involved with the project but it looks to me that bricolage is heading towards content generation abstraction (there's support for Mason and HTML::Template). Therefore, I would imagine that if you wanted to use AxKit as a content generator, you could. On Thu, 7 Feb 2002, Matt Sergeant wrote: > On Wed, 6 Feb 2002, Drew Taylor wrote: > > > You should take a look at Bricolage (http://bricolage.thepirtgroup.com/). > > It's a relatively new, but comprehensive, CMS that is based on Mason & > > mod_perl. I think it supports most of the things you mentioned below, but > > you should ask the developers to be sure. > > > > If you talk w/ Matt, he'll be sure to hawk AxKit. But then that's Matt. And > > AxKit really is cool stuff. :-) > > Well I'd rather recommend whatever works for people. Bricolage certainly > seems full featured, and it looks easy enough to add XSLT support to it, > though I haven't had chance to download and try that yet. > > As far as AxKit based CMS's go, well I was writing one but it died in the > dot-bomb as I became an "Anti Spam and Virus Technologist" (which is > actually a really nice change from web hacking). As far as other CMS's, > Robin has already mentioned XIMS and his Tesserra, but forgot about this > one: http://www.callistocms.com/ which simply blew my mind looking at the > graphics. I guess I'm easily pleased ;-) I don't know if that one is going > to be free or not though. > > cheers, -Ian -- Ian Kallen <[EMAIL PROTECTED]> | AIM/yahoo: iankallen
Re: Can AxKit be used as a Template Engine?
Mason and AxKit solve different but related problems. The former a code-aware component system with process semantics that lend itself to easily scoping a component's applicability, the latter a transformation engine. It would be nice to see a framework published that uses the best of both (sorry, I don't have time to do it myself :). The Java world suffers from the same disconnect, in fact I think it's worse there; JSP and Cocoon don't play together (I've never seen a servlet chainging example that shows them doing so). On Mon, 23 Apr 2001, Matt Sergeant wrote: > Having said that, it goes the other way too - currently building web > applications is probably a lot easier with Mason than it is with AxKit, > because that's what it was designed for. AxKit has a pretty cool > technology called XSP, which gives you a cold-fusion like system of > inserting tags into your XML for dynamic functionality. But in my opinion > it doesn't scale well (in the development sense, not in the performance > sense) to large applications, because it is inherently a page-based > technology (like PHP, Cold Fusion, JSP, ASP, etc), and I don't think > page-based web development systems scale well to larger applications. I > prefer something that is turned inside-out from the page based view of > things, like MVC. cheers, -Ian -- Ian Kallen <[EMAIL PROTECTED]> | AIM: iankallen
Re: modperl/ASP and MVC design pattern
You can (I have) accomplish this with mod_perl and HTML::Mason, Mason's root level autohandler can play the role of the JSP model 2 "controller servlet": dispatching logic processing to Perl objects (er, beans) and "forwarding" to a view (with the Mason $m->call_next or $m->comp mechanisms). I think the Apache::Dispatch stuff can also perform this role (haven't played with it to say for certain). I'll qualify this by saying MVC is not a end in itself, there are a lot of modern requirements for flexible branding, client form factor appropriate and locale specific presentations that require the view/controller part to be a lot smarter than the traditional concepts of MVC that I've seen call for. I've been referring to these needs in my own engineering discussions as (yikes) MVC++ :) On Fri, 20 Apr 2001, Francesco Pasqualini wrote: > an interesting feature of JSP is the possibility to use the MVC design pattern >(INPUT/OUTPUT/LOGIC separation) > This is obtained with the "forward" instruction. > How the MVC design pattern can be implemented in the mod_perl (and specifically >Apache::ASP) architecture ? cheers, -Ian -- Ian Kallen <[EMAIL PROTECTED]> | AIM: iankallen
Re: Installing mod_perl-1.24_01 w/o super user and with global perl
If I were you, I'd install my own perl in /home/eedalf, create /home/eedlf/apache and then do (assuming ~/bin/perl is before /opt/local/bin/perl in your path) something like: perl Makefile.PL \ APACHE_PREFIX=/home/eedalf/apache \ APACHE_SRC=/home/eedalf/src/apache_1.3.14 \ DO_HTTPD=1 \ USE_APACI=1 \ LIB=/home/eedalf/lib/perl \ EVERYTHING=1 HTH, -Ian Today, Alexander Farber (EED) <[EMAIL PROTECTED]> spoke of Installing...: > Hi, > > I am installing Apache 1.3.14 and mod_perl 1.24_01 into > my home directory and it actually works okay, but there > is this error message, when calling "make install" in the > mod_perl source dir: > > Skipping >/opt/local/perl-5.6.0/lib/site_perl/5.6.0/sun4-solaris/auto/Apache/include/include/http_protocol.h > (unchanged) > Cannot forceunlink >/opt/local/perl-5.6.0/lib/site_perl/5.6.0/sun4-solaris/auto/Apache/include/include/ap_config_auto.h: > Permission denied at /opt/local/perl-5.6.0/lib/5.6.0/File/Find.pm line 475 > *** Error code 255 > make: Fatal error: Command failed for target `pure_site_install' > > > I guess, it is because I don't have the write privileges for > our /opt/local/perl-5.6.0. Is there a way to get rid of this > message? I haven't found it in the > > http://perl.apache.org/guide/install.html#Installation_Without_Superuser_P > > Thank you > Alex > > PS: I use: > > perl Makefile.PL APACHE_PREFIX=/home/eedalf >APACHE_SRC=/home/eedalf/src/apache_1.3.14 DO_HTTPD=1 USE_APACI=1 EVERYTHING=1 -- CTO: Creation Engines / AIM: iankallen / Fax: (415) 354-3326 Powering the Collaborative Enterprise / Ian Kallen <[EMAIL PROTECTED]>
Re: mod_perl in chroot environment
Tomorrow, Gunther Birznieks <[EMAIL PROTECTED]> frothed and gesticulated...: > > > >http://www.securityfocus.com/focus/sun/articles/apache-inst.html Yup, that's good. > http://penguin.epfl.ch/chroot.html Yup, that's good too. The key to successful chroot'ing, I've found, is running strace or trace (depending on your platform) and looking at what files your httpd is looking for, importing them into the chroot environment and doing that iteratively until you're httpd is running and answering requests fully w/o errors. It's a PITA the first time but simple enough to later turn into a tarball and/or a shell script for later re-use. Has anyone on the list run hosted mod_perl installations? I'm curious about ISP's how they provision their users with mod_perl environments safely. -Ian -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: WebDAV support in mod_perl
Yes, I've contemplated either: 1) implementing the DAV protocols entirely in Perl for mod_perl 2) gluing in XS into mod_dav -- IIRC mod_dav has hooks for non-filesystem respositories; it'd be great just to expose that API to mod_perl (haven't cracked open that code yet though) Issues: what will be required to implement DeltaV (I need concurrent checkouts and versioning) as well? What's up with the expat-lite in Apache conflicting with XML::Parser's expat? Given a clear picture of these options and issues, I'd be more than pleased to bang out a good Apache::WebDAV code base implementation. -Ian Today, Joao Pedro Goncalves <[EMAIL PROTECTED]> frothed and gesticulated about...: > Hi, is there any current project going on for using the WebDAV protocol > in > mod_perl, something like Apache::WebDAV? > > I am familiar with the mod_dav efforts however they seem to be oriented > to > filesystem repositories and i would like to use WebDAV in a more dynamic > environment such as repositories being in a database, or for supporting > new stuff like Outlook HTTPmail, that uses WebDAV to connect to Hotmail. > > If not, is there any people out there interested in starting one? > > Core features of the WebDAV protocol already have several CPAN modules > that would help > its development, such as locking and XML processing. > > Thanks in advance, > Joao Pedro > > -- > João Pedro Gonçalves > www.sapo.pt > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with Apache::DBI under mod_perl!!
> #!/usr/bin/perl > > use strict; > > # Extend @INC if needed > use lib qw(/dir/foo /dir/bar); # ok, setup the Oracle and (optionally) the debug DBI environment BEGIN { $ENV{'ORACLE_HOME'}='/highway/to/orac/hell'; $ENV{DBI_TRACE}="3=/var/tmp/dbitrace.log"; } > > # Make sure we are in a sane environment. > $ENV{MOD_PERL} or die "not running under mod_perl!"; ciao -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache::Util routines
Apache::Util XS hooks into some of Apache's C code for date handling, escaping and so forth. There's no way with the current architecture to use it in a non-Apache-runtime context; running it from within your shell won't work. > perl -M'Apache::Util qw(:all)' -e '$a = parsedate("")' > Undefined subroutine &Apache::Util::parsedate called at -e line 1. > > Looks like I've been missing something? -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: usemymalloc && mod_perl
I wanted to follow up on this: our intermitten problem with corrupted 32nd & 64th byte data was, at least outwardly, fixed by recompiling perl and rebuilding mod_perl. The only remaining performance issues I'm dealing with I'm looking at IO::File to blame, I'm going to comb through %INC to find who's loading it and see if I can completely eliminate those now! Doug MacEachern wrote: > > On Sat, 16 Sep 2000, Ian Kallen wrote: > > > > > I've seen some of the 'perl -V' outputs on this list over the years. Most > > people have usermymalloc=n but I've a seen a number of Solaris cases that > > have usemymalloc=y > > > > I have a system on Solaris 2.6 with usemymalloc=y and I have a very > > infrequent bug that usually manifests iteslef as corrupted data at the > > 64th byte (it can also happen at the 32nd byte!). It doesn't seem to > > happen ever in single process mode but I have some data objects that > > will consistently demonstrate this behavior with Apache forked (the bug > > survives apache shutdowns/startups, so it's not just an errant child). > > The other pieces of the puzzle: latest DBI, DBD::Oracle, Oracle 8.1.5 > > > > So, my question for this group: why would I want usemymalloc=y on Solaris > > 2.6? Besides having to rebuild a somewhat complex mod_perl compile, I'm > > not looking forward to rebuilding all libraries with XS code so any > > insight as to the ins and outs of compiling w/ and w/o usemymalloc would > > be much appreciated! > > thanks, > > solaris system malloc will degrade your Perl performance a great deal. > i'd be surprised if the bug is caused by Perl's malloc implementation. > sounds more like buggy xs (or linked in library code) that is stepping out > of bounds, duplicate free() or similar. purify would be the best tool to > find the bug, but rather expensive if you don't have it already. > can you tell us more about this data, like what structure it is, where > it's passed around in what code? -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
usemymalloc && mod_perl
I've seen some of the 'perl -V' outputs on this list over the years. Most people have usermymalloc=n but I've a seen a number of Solaris cases that have usemymalloc=y I have a system on Solaris 2.6 with usemymalloc=y and I have a very infrequent bug that usually manifests iteslef as corrupted data at the 64th byte (it can also happen at the 32nd byte!). It doesn't seem to happen ever in single process mode but I have some data objects that will consistently demonstrate this behavior with Apache forked (the bug survives apache shutdowns/startups, so it's not just an errant child). The other pieces of the puzzle: latest DBI, DBD::Oracle, Oracle 8.1.5 So, my question for this group: why would I want usemymalloc=y on Solaris 2.6? Besides having to rebuild a somewhat complex mod_perl compile, I'm not looking forward to rebuilding all libraries with XS code so any insight as to the ins and outs of compiling w/ and w/o usemymalloc would be much appreciated! thanks, -Ian -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: [Mason] Problem: no-Content.
HTML::Mason is your perlhandler in the /mason request space, so what's supposed to handle a root object "/" request? Do a simple setup for one virtualhost and make sure your choices of documentroot, alias settings and component_root settings agree before broadening the solution for multiple virtualhosts. Also, back down to Mason 0.87 until 0.89 is released. -Ian > Hello all, > > -- The Problem -- > > When i try try retrieve http://www.clickly.com/index.html > (Test-Site: not the real clickly.com) i get a blank return and i > mean a real blank content return (tried it with telnet to port 80 and > the server only sends back the headers of the web-page?) > > Does anybody know what the problem is? I'va tried all sorts of > things but nothing worked. > > Thanks in advance, > Guido Moonen > > -- The Stuff i have -- > > * Solaris V 2.6 op Sun ultrasparc. > * perl, v5.6.0 built for sun4-solaris > * Server version: Apache/1.3.12 (Unix) > Server built: Sep 6 2000 14:51:05 > * mod_perl-1.24 > * Mason v. 0.88 > > -- Handler.PL -- > << SNIP >> > my (%parsers, %interp, %ah); > foreach my $site qw(www modified management) > { $parsers{$site} = new HTML::Mason::Parser(allow_globals => > [qw($dbh %session)]); > > $interp{$site} = new HTML::Mason::Interp (parser=>$parsers{$site}, > > comp_root=>"/clickly/html/$site/", > > data_dir=>"/clickly/masonhq/$site/", >system_log_events=>"ALL"); > $ah{$site} = new HTML::Mason::ApacheHandler(interp=>$interp{$site}); > > chown (scalar(getpwnam "nobody"), scalar(getgrnam "nobody"), > $interp{$site}->files_written); > } > > sub handler > { my ($r) = @_; > my $site = $r->dir_config('site'); > return -1 if $r->content_type && $r->content_type !~ m|^text/|i; > my $status = $ah{$site}->handle_request($r); > return $status; > } > << SNIP >> > > -- httpd.conf -- > > << SNIP >> > # www.clickly.com (Default) > > ServerAdmin [EMAIL PROTECTED] > DocumentRoot /clickly/html/www > ServerName www.clickly.com > PerlSetVar site 'www' > > > Options Indexes FollowSymLinks MultiViews ExecCGI > AllowOverride None > Order allow,deny > Allow from all > > alias /mason /clickly/html/www > > SetHandler perl-script > PerlHandler HTML::Mason > > > << SNIP >> > > == > Guido Moonen > Clickly.com > Van Diemenstraat 206 > 1013 CP Amsterdam > THE NETHERLANDS > > Mob: +31 6 26912345 > Tel: +31 20 6934083 > Fax: +31 20 6934866 > E-mail: [EMAIL PROTECTED] > http://www.clickly.com > > > Get Your Software Clickly! > == > > > ___ > Mason-users mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/mailman/listinfo/mason-users > -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: HTML Template Comparison Sheet ETA
I love this perennial thrash. My 2 cents: don't underestimate the value of having mobility in the separation of "engineer" and "production" ('HTML Monkey', as it's been previously referred too, ee ee). Mason's ability to have components that are all Perl, all FooML or a mix in the two allows you to decide where to draw that line. I've found that in the real world, producers have two career paths: one towards design and one towards technology. I've worked with systems where the technology was rigidly opaque and there was no way for producers to ease their way into programming. I've torn down that wall. Simple Perl constructs don't require careful study of the camel book but if folks _want_ to do sophisticated things with their data handling, they're not hamstrung by the constructs of an artificial set of boundaries. That said, I do insist on having components and classes constructed for re-use -- this is a concept that even the most novice producer appreciates. And though I'm not in the business of career counseling, I can (and have) provide a system that has entry points for anybody in the broad spectrum of skills. > If I want to make something simple, make it simple! For instance: > > > $_ > > > > 2) Say what? Are you running a school or trying to things done? Putting > > raw Perl in your HTML isn't helping you designers is any way I understand. > > I always try to teach while having things done. Learning a bit of Perl > will help the designers as much as learning "raw HTML" instead of using > just a WYSIWYG tool: they will be more productive. -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
RE: was Re: template kit..... - now session handling
Today, Gerald Richter <[EMAIL PROTECTED]> frothed and gesticulated about RE:...: > > Ian Kallen suggested a hash of know indexers - which is a good idea - > > Yes > > > but has one problem of how to keep this upto date. > > > > Everybody could contribute and there could some (CPAN) where you can > download an uptodate list My thoughts along that line were more for a general browsercap -- I think the PHP community has already broke some ground down that road. A basic list of user agent ID's and some of their characteristics. This is actually much broader than these needs for a URI based session mgt, broader than the Perl community's needs so it should probably be spearheaded separately and be implemented as XML (no, I don't have the time to do this myself, I do wish for more free time though...) I don't think ASP and PHP browsercap data is in XML now (haven't checked lately) but it should be ;) Someone on this list probably has more time on their hands than me to make this happen. In lieu of a DTD (not needed here really) I'd be happy to provide an XML model of what data would be needed :) -Ian -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
RE: The Template Toolkit (Re: Templating Systems)
XForm sounds just like something I need actually, can any of the XSLT tools transform it? In perl, of course, XML::XSLT, Sablotron (which doesn't compile on FreeBSD btw, feh!)? Yesterday, Dmitry Beransky <[EMAIL PROTECTED]> frothed and gesticulated...: > That's where the XForm may come quite handy > (<http://www.w3.org/MarkUp/Forms/>). The specification is still been > worked on, but it has some parts that can already be used on the back > end. I can see it (me thinks) fit quite nicely into Apache::ASP XML > processor. I thought about coding it up, but never got the time. -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: was Re: template kit..... - now session handling
Today, Greg Cope <[EMAIL PROTECTED]> frothed and...: > I posted about a generic URL mangeler / cookie session handler a few > days ago. > > Allthough this is not rocket science - I've writen a URI transhandler > that will put the session id into pnotes, and if cookies are off will do > a redirect to itself with a munged URL > (www.foo.com/id_here/original_bit_here). A quick uri rewrite and bob's > one of your parents sister. The only major issue is that I cannot Two separate issues, two separate replies :) If you do this, build it into Apache::Session! Leverage the existing storage mechanisms built in there already (file, DBI, etc). My only other feature requests for this: 1) include a %no_url_munging hash with user agents for known indexing spider storage. You don't want inktomi or altavista returing munged URL's in search results! 2) Have it configurable so that the url munger session pnote'ing can be turned off or on. I think without these features, url munging session mgt is pretty worthless. -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: was Re: template kit..... - now session handling
Today, Greg Cope <[EMAIL PROTECTED]> frothed and...: > one of your parents sister. The only major issue is that I cannot > appear to use posted values as they appear to get lost in the redirect > (Clues wanted !). Redirecting a POST request? Yup, expediency often requires violating the HTTP spec. Though your requests are probably hanging cause they want to read STDIN again, this should probably get patched -- haven't looked at the mod_perl source voodoo on this issue (Doug?). Meantime, see if this remedies: $r->method('GET'); $r->headers_in->unset('Content-length'); $r->header_out(Location => 'http://.bletch.com'); -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: Templating System
I really don't see why having code that expresses logic that _looks_ liek maybe it's HTML is good. Today, Paul J. Lucas <[EMAIL PROTECTED]> frothed and gesticulated about...: > On Thu, 27 Jul 2000, Autarch wrote: > > > > > > > Seems pretty close to what you want, I think. > > Except it puts Perl code in the HTML file and uses invalid > HTML. Later, Gerald Richter said: > Let me say one word to mixing design and code. Template::Toolkit (and > other modules, which don't directly include perl code), reclains, that > they better separate code and design, but form my point of view they > simply create a new "language". If you want to separate code and design, > that could also be done with modules like Embperl, Mason, ASP which > directly inlcude Perl code. Replace "could" with "should" and I have to endorse this assertion 100%! Why the heck do we need more programming languages? I understand people think they're performing some kind of service by cooking up something that looks simple for non-programmers but it looks more like hamstringing to me, no thanks. I'm impressed with Wardley's analysis of the problem in the proceeding of the Perl conference but his solution looks unappealing to me: a language that is Perl yet it's not, ugh! As far as Jacob Davies call for standardizing templating: that's what XSLT is about! My grievance there is necessity of representing data as XML (or at least an XML DOM tree) to do anything. So, I'm back at my original conclusion settling on a powerful component system (Mason) but looking seriously at gluing in hooks for transformation (AxKit). -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: Templating System
I'm not going to disparage any of the other templating systems but since noone has chimed in for HTML::Mason, I guess I'll have to. Important aspects of such a beast is componentization, not just "mail merge" behaviors. Mason components can be just HTML (or XML or fooML) or just Perl or both. The "heavy lifting" can be moved to the bottom of a page so you can get away from top to bottom processing whih generall demands expressing complex code in the middle of HTML. Caching by distilling components down into Perl code. In many other respects, the API, the execution and the object models are the most empowering. My current focus is on using Mason as a component system but XSLT when I need ad-hoc transformation a la AxKit, Cocoon and other XSLT processor-based systems. Mixing AxKit and Mason may sound crazy but each has compelling ideas in their architecture. As far getting Zopely with mod_perl tools, in my talk in the Apache track about the publishing and content management at Salon I discussed getting there last week in Monterey. Today, Erich L. Markert <[EMAIL PROTECTED]> frothed and gesticulated about...: > OK, I'm nearing the end of one project so I'm able to take a look at new > solutions so one question comes to mind. What does the template toolkit > offer above and beyond HTML::Embperl or some other templating solution? > > On a side note, wouldn't the mod_perl community be better served > focusing on one of these solutions and building upon it and creating a > mod_perl based application server much like Python has Zope? > -- > __ > Mr. Erich L. Markert [EMAIL PROTECTED] > Computer Learning Center TEL (914)422-4328 > Pace University > 1 Martine Ave > White Plains, New York 10606-1932 > > Those who do not understand Unix are condemned to reinvent it, poorly. > -- Henry Spencer > -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: using a module to contain settings.
I've taken a liking to setting up a centralized config that puts various package globals where I want them # contents of Foo::Config { package Foo::Zip; use vars qw($got $no $guitar $strings); $got='ernie'; $no='ball'; $guitar='or'; $strings='markly'; } { package Foo::Zap; use vars qw($bang $boom $bash); # etc } I'll likely use constant.pm next time I rev the code instead of using vars. -Ian Scott Alexander wrote: > > I'm working on creating a site that is completely done in mod perl. > > The area that I'm running into problems with is using a single > module to store configuration information. ie where images are > stored. oracle settings, color codes etc. All the settings that are > valid accross the entire site. > > The way i've been trying to do this is to create a module > Mf7::Globals and then store the data inside. > I then have an Initialize_globals function that I run to reset all the > variables at the begining of a request. > > I thought I should be able to access them using > $Mf7::Globals::imgserver but this just errors out with unitialized > variable. > > So what method are you guys using to store sitewide variables? > > Scott -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: PerlLogHandler and mod_usertrack
Hi Jacob! Difference being that if you change your cookie'ing to use something other than mod_usertrack, you'll have to make sure it also creates that key for it in the notes table otherwise your PerlLogHandler won't see it. $r->header_in('Cookie') should always be there for slicing and dicing... I'm probably splitting hairs here but I like to be flexible. -Ian Today, Jacob Davies <[EMAIL PROTECTED]> frothed and gesticulated...: > The %{cookie}n refers to the cookie field of the notes table, so you should > be able to get at it directly from Perl with: > > $r->notes( 'cookie' ); > > On Thu, Jun 15, 2000 at 10:12:40AM -0700, Ian Kallen wrote: > > If you're writing your own PerlLogHandler, get the cookie from the request > > object, $r->header_in('Cookie') > > -Ian > > -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: PerlLogHandler and mod_usertrack
If you're writing your own PerlLogHandler, get the cookie from the request object, $r->header_in('Cookie') -Ian Today, Jim Sproull <[EMAIL PROTECTED]> frothed and gesticulated about...: > I'm looking to using mod_usertrack to log requests based on cookies (which > it's good at, of course). I have this all in and working fine. However, > I'm using my own PerlLogHandler to handle all the logging. mod_usertrack > allows a CustomLog variable called %{cookie}n which contains the current > session id, called like: > > CustomLog logs/clickstream "%{cookie}n %r %t" > > (from http://www.apache.org/docs/mod/mod_usertrack.html) > > But, since I'm using my own LogHandler, I need to somehow get access to > this variable directly. Has anyone used these two together before, or can > point me in the right direction? Or do I have to do some source hacking? > Thanks! -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: [OT] Re: sendMail in cgi program
Well, you _can _ do this $var=<<"END"; This is my variable's multiline text, complete tith tabs\t\t and extra newline\n\n, etc END four spaces in the opening and closing quote. I usually use qq{ } depending on how much I care about whitespace formatting. If I was writing Perl code to generate Python code, I'd be in trouble (in more than one way). Paul wrote: > As someone mentioned on the board (ever so briefly), here-documents > like this one require that your "sentinel" string have no leading > whitespace. > > e.i., you may say >$var=< This is my variable's > multiline text, > complete tith tabs\t\t and extra newline\n\n, etc > END > > but you *can't* say >$var=< blah >END > > because here, END has space in front of it. > In several shells you can put tabs in front of it if you say >print<<-END; # the dash says "let me use a leading tab" >blah > END -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
RE: [OT now] Re: Template techniques
Has anybody run into any Perl libraries that do XSLT transformations that are usuable? Last I looked, there was no library that implemented the spec or provided a useful API. Maybe I'm behind the times... Today, Gerald Richter <[EMAIL PROTECTED]> frothed and gesticulated about RE:...: > > For my second rite of passage, I'm hacking XML::XSLT > > integration into Apache::ASP for realtime XSLT document > > rendering with a sophisticated caching engine utilizing > > Tie::Cache. Moving forward, the XML buzzword seems to be > > just about a necessity. > > > > Take it as a sign of respect Matt :) > > > > And to add one to the list, Embperl 2.0 will also support XML and XSLT :-) > > Gerald > > > - > Gerald Richterecos electronic communication services gmbh > Internetconnect * Webserver/-design/-datenbanken * Consulting > > Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz > E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 > WWW:http://www.ecos.de Fax: +49 6133 925152 > - > > -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: DNS Lookups ? huh ?
IIRC (it's been a while!), Apache 1.2 defaulted hOstnAmelOokups On but it wasn't case sensitive with directive names either. Karyn Ulriksen wrote: > > OK. I'll shut up now. Didn't it use to be this way? Way back in 1.2 or > something? I must have picked up my analness on this somewhere... (because > I *really* am not that anal. If anybody knows whether or not this was true > at one point, I'd like to know (for my mind's own backward compatability > sake!) :) Thx. > > -Original Message- > From: Ian Kallen [mailto:[EMAIL PROTECTED]] > Sent: Thursday, June 08, 2000 3:23 PM > To: '[EMAIL PROTECTED]' > Subject: Re: DNS Lookups ? huh ? > > No wait, this is wrong twice: see > http://www.apache.org/docs/mod/core.html#hostnamelookups -- default is > off and the directive names are case insensitive. > > Karyn Ulriksen wrote: > > > > Uhmmm. The directive... > > > > is not HostnameLookups Off > > it ISHostNameLookups Off > > > > The default is on. Case sensitivity. All that... give it a whirl. > > We've all done it before > > -- > Salon Internet http://www.salon.com/ > Manager, Software and Systems "Livin' La Vida Unix!" > Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326 -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
subprocess_env
I'm using a third party module that writes a bunch of variables to the subprocess_env table to setup data for the request. It has us making repeated class method calls like this (for our usage with Mason): <% Blah::foo('bletch') %> where foo is in the Blah package merely doing this: sub foo { my($s) = @_; my($r) = Apache->request(); return $r->subprocess_env('foo_' . $s); } I'm thinking of changing the behvior to <% $ENV{'foo_bletch'} %> but foo_bletch isn't in the %ENV hash, so I'm looking at initializing every request to do this: $r->subprocess_env->do( sub { my($k,$v)=@_; $ENV{$k}=$v; 1; } ); to eliminate repeated accesses of the subprocess_env table; one call populates %ENV and that's it. Now, I don't want to kick off a debate on the performance problems that reading/writing to the environment incur; I didn't design this behavior I just want to make the best of it since this is what the application requires of us. I just need to optimize access to the environment by turning the dozen or so calls per request to Blah::foo to just %ENV. Any ideas regarding the expense of mulitple $r->subprocess_env vs. accessing %ENV? -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: DNS Lookups ? huh ?
No wait, this is wrong twice: see http://www.apache.org/docs/mod/core.html#hostnamelookups -- default is off and the directive names are case insensitive. Karyn Ulriksen wrote: > > Uhmmm. The directive... > > is not HostnameLookups Off > it ISHostNameLookups Off > > The default is on. Case sensitivity. All that... give it a whirl. > We've all done it before -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
DBD::Oracle && Apache::DBI
I've done everything I can think of to shore up any DB connection flakiness but I'm still plagued by errors such as these: DBD::Oracle::db selectcol_arrayref failed: ORA-12571: TNS:packet writer failure ...this is only a problem under mod_perl, outside of the mod_perl/Apache::DBI environment everything seems fine. Once the db connection is in this state, it's useless until the server gets a restart. My connect strings look good and agree, I put Stas' ping method in the DBD::Oracle::db package, set a low timeout, called Oracle (they don't want to hear about it). Everything is the latest versions of mod_perl/Apache/DBI/DBD::Oracle connecting to an Oracle 8.1.5 db on Solaris. Is Apache::DBI not up to it? (it looks simple enough) Maybe there's a better persistent connection method I should be looking at? -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Apache::Resource on Linux
BSD::Resource passed all of the make test tests but when I tried enabling Apache::Resource on a rh6.1 installation the error log barfed with these: Ouch! malloc failed in malloc_block() using settings right out of the perldoc PerlModule Apache::Resource PerlSetEnv PERL_RLIMIT_AS 32:48 PerlChildInitHandler Apache::Resource Does this really not work on Linux?? -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: [Mason]Determining TARGET frame
Clients don't inform the server of what frame a click originates frame, you'd have to have a query string or URL based session mgt setup and do it yourself. You can direct the client what window/frame to load a response in with a "Window-target" header but that's about all you can do. OK, back to Mason and mod_perl -Ian Today, [EMAIL PROTECTED] <[EMAIL PROTECTED]> frothed and gesticulated...: > I'm working on my own site with mod_perl and mason. > > I want cookie exchange ONLY with one particular frame. > > I *could* simply just maintain a list of pages that might > validly be in the paricular frame, but I'd prefer something > like... > > Is there any method for the Apache::Request object or it's > Mason counterpart that will show me what the target frame > on the user's browser the request is being made for? > > Maybe not. > > > > ___ > Mason maillist - [EMAIL PROTECTED] > http://netizen.com.au/mailman/listinfo/mason > -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: mod_perl Programmers demand is going up...
Are you disparaging expertise in Crapomatic-9000 programming? Perish the... Today, Jeffrey Baker <[EMAIL PROTECTED]> frothed and gesticulated about Re:...: > Most people are lazy. Since it is easier to get started with > VB/ASP/Crapomatic-9000, most people are going to start there. The -Ian (working on an Apache::Crapomatic module now) Kallen -- Salon Internet http://www.salon.com/ HTTP mechanic, Perl diver, Mebwaster, Some of the above Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: mod_perl Programmers demand is going up...
We've never had any candidates come in with any level of depth with mod_perl but I'd vet their competency with it by asking them to explain the closure problem with variables my'd under Apache::Registry. Anyone cognizant of those issues should presumably know how to sanely use Registry scripts but also understand my distaste for them. The API itself can be easily learned, so I don't care if people have written their own handlers. BTW, we're hiring :) In downtown San Francisco, we publish salon.com and we're looking for mod_perl proficiency (now that you know what that means ;), competence with XML::Parser && XML::Grove, DBI/Oracle/MySQL, LWP, objects under Perl and in general someone who knows when to exploit the CPAN and when to build. Also java servlet && jdbc API's (no comments from the peanut gallery, OK?) familiarity. Must think HTML::Mason is way cool! If this is you, I want to see your resume! -Ian Today, Eric Cholet <[EMAIL PROTECTED]> frothed and gesticulated about...: > Randal L. Schwartz wrote: > > For some people, I presume dealing only with content handlers could be > > considered as "mod_perl experience". But mod_perl is so much more > > than the content phase. I would laugh at someone that said they "knew > > mod_perl", but couldn't tell me most of what's in Stas' document, for > > example, or had never written a PerlTransHandler or a PerlLogHandler. > > Or worse yet, had only used Apache::Registry! > > > > aside - Doug did too good of a job with Apache::Registry. So many > > people think that this is all mod_perl is and forget that > > Apache::Registry is just a stopgap while you are writing *real* > > handlers. > > Many people make the distinction between Apache::Registry being for > mod_cgi compatible scripts, and "real" handlers taking full power of > the Apache API. The truth is that an Apache::Registry script can also > use the Apache API and completely disregard CGI compatibility. > When I write a new application, I often write content handlers as > registry scripts, because of the ease of use (no need to restart the > server when changed), then it's easy to wrap a "sub handler" around the > script to turn into a "real" handler. > > -- > Eric > > -- Salon Internet http://www.salon.com/ HTTP mechanic, Perl diver, Mebwaster, Some of the above Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: HTTP 1.0 / 1.1
This has tripped me up in the past as well. While the preponderance of browsers support HTTP/1.1 features, they use the lowest common denominator language, HTTP/1.0, to make requests. Language extensions are permitted but it's all for the best that these user agents don't report themselves as HTTP/1.1 compliant unless they really are. The request format object %r in mod_log_config is a wysiwyg item -- it's the actual request. I don't know of a way to log downgradings off hand; they're instructions handed around the request obect as note, IIRC, so you could write a mod_perl module to log those. Other than that, this isn't a mod_perl topic, so take it to comp.infosystems.www.servers.unix going forward. -Ian Today, Jeffrey Baker <[EMAIL PROTECTED]> frothed and gesticulated about Re: HTTP...: > Pouneh Mortazavi wrote: > > > > OK. so this is unrelated to the modperl mailing list. but its an > > interesting question. If you know anywhere else I could post this, > > please tell me. > > > > I'm trying to find out how many clients support HTTP 1.1 features such as > > keepalives and domain-name based virtual hosts. > > > > Apparently netscape 3+,ie4+ all run HTTP 1.1. Which is good. This is 95% > > of my user agents. > > > > When I look through the logs however, I see a *huge* amount of HTTP 1.0 > > requests from what are claimed to be http 1.1 compliant browsers. I get 3 > > times more HTTP1.0 requests than HTTP1.1 requests. I can understand that > > some of these user agent strings may be rogue spiders/browsers > > masquarading as netscape/ie ... but not that many! > > > > Can anyone explain, why this would be the case? I know that my apache > > servers can implement HTTP protocol negotiation, but I definately do not > > do that in my conf files... > > > > Has anyone else done any analysis on their webserver logs for http > > protocols? > > I'm not terribly familiar with the Apache log format. Are you sure that > the log records the protocol level in the request, or the protocol level > of the response? The standard Apache config files include a rule to > downgrade certain user agents to HTTP 1.0. Is this rule in your config > file? > > Might an intervening proxy downgrade the request to 1.0? > > Regards, > Jeffrey > > -- Salon Internet http://www.salon.com/ HTTP mechanic, Perl diver, Mebwaster, Some of the above Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (415) 354-3326
Re: proxypass with dynamic DocumentRoot
Perhaps what you're looking for resembles this: RewriteRule ^/(images|static)/ - [S=1] RewriteRule (.+) http://backend$1 [P,L] John D Groenveld wrote: > > I've been using mod_proxy > to proxypass my static content away from my /modperl > directories. Now, I'd like to make my root > dynamic and thus pass everything except /images and > /static. > I've looked at the guide and tuning docs, as well > as the mod_proxy docs, but I must be missing > something. > Thanks, > John > [EMAIL PROTECTED] -- Salon Internet http://www.salon.com/ HTTP mechanic, Perl diver, Mebwaster, Some of the above Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (561) 619-0995
Re: Problems Using DBI / DBD::mysql Within Apache::ASP / mod_perl
Being an Apache module has nothing to do with it, it's who the webserver is as running and what machine the database is hosted on versus what you have in your conenct string. Just because a DBI connection works from your shell doesn't mean it will work identically when run by a web server. [EMAIL PROTECTED] wrote: > > The kicker is that this only becomes a problem while using it as an Apache > module... > > [EMAIL PROTECTED] wrote: > > > Apache mod_perl List, > > > > I am attempting to use DBI / DBD::mysql within Apache::ASP under mod_perl > > and am constantly receiving the following error: > > > > Access denied for user: 'dealerdb@localhost' (Using password: YES) > > > > Should I be using a different module than `use DBI;`? Any help, > > suggestions, or prior experience would be appreciated. Thanks, in > advance. -- Salon Internet http://www.salon.com/ HTTP mechanic, Perl diver, Mebwaster, Some of the above Ian Kallen <[EMAIL PROTECTED]> / AIM: iankallen / Fax: (561) 619-0995