RE: [mp2][QUESTION]: Filter to modify request headers on a proxy server
Thanks for this. I had put 'PerlInputFilterHandler iPAQApache::ResetBrowser' inside the proxy block, and it should have been outside like you said. _/*** * _/ **Chris Pringle** _/ *Industrial Trainee ** *** _/_/_/ _/_/_/ *Personal Systems Group (PSG) ** ***_/ _/ _/ _/*Hewlett Packard - Bristol** *** _/ _/ _/_/_/ * ** _/ INVENT **Tel - +44 (0) 117 31 29664 ** ** _/Email - [EMAIL PROTECTED] ** *** _/ * > PerlInputFilterHandler iPAQApache::ResetBrowser > > Is this the correct directive? The directive is correct, but you don't show your code and your config, so I have no idea if the rest is correct or not. This directive is used to configure both, connection and request level filters. It's the attribute of the handler subroutine is what makes the difference and the placement in httpd.conf. You need to declare it as: package iPAQApache::ResetBrowser; use base qw(Apache::Filter); sub handler : FilterConnectionHandler { your code is here } 1; and you need to put it outside of or similar block in httpd.conf just like shown at: http://perl.apache.org/docs/2.0/user/handlers/filters.html#Connection_In put_Filters Also make sure that you run at least mod_perl 1.99_09, or even better the current cvs. And in the future please follow the info at http://perl.apache.org/bugs/ so we know more about your setup. __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
RE: [mp2][QUESTION]: Filter to modify request headers on a proxy server
Hi, I've just tried that script again (see link below) using a POST request. In the error log file, there is the content of the POST Request e.g. user=cpringle&password=x but nothing else. There is no HTTP headers. My Apache directive to enable the filter is PerlInputFilterHandler iPAQApache::ResetBrowser Is this the correct directive? _/*** * _/ **Chris Pringle** _/ *Industrial Trainee ** *** _/_/_/ _/_/_/ *Personal Systems Group (PSG) ** ***_/ _/ _/ _/*Hewlett Packard - Bristol** *** _/ _/ _/_/_/ * ** _/ INVENT **Tel - +44 (0) 117 31 29664 ** ** _/Email - [EMAIL PROTECTED] ** *** _/ * -Original Message- From: Stas Bekman [mailto:[EMAIL PROTECTED] Sent: 18 September 2003 11:37 To: Pringle, Chris (HP-PSG) Cc: [EMAIL PROTECTED] Subject: Re: [mp2][QUESTION]: Filter to modify request headers on a proxy server Pringle, Chris (HP-PSG) wrote: > Hi, > > I am trying to write a filter that will sit on a proxy server and > alter HTTP requests. Basically, what I want it to do is modify the > User-Agent header field so that when the request is proxied, the > remote web server gets a different User-Agent header field to the one > that was originally sent by the browser. There are also other header > fields I may need to modify, but I would imagine this is a simple task > once I've worked out how to alter the User-Agent field. > > Does anyone have any ideas how I might go about doing this? I've tried > writing several PerlInputFilterHandlers, all with no success. Will > input filters work with a proxy? I've got output filters working with > no problem. > > Any sample code to do what I want, along with the relavent Apache > directives would be very much appreciated! The sample code that you need is here: http://perl.apache.org/docs/2.0/user/handlers/filters.html#Connection_In put_Filters I haven't tried to mix filters with proxy, but I see no reason why shouldn't it work. It might not work if proxy is implemented as a filter itself and is running before the modperl filters, need to look at the actual implementation. __ Stas BekmanJAm_pH --> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
MP2 Apache Settings
Hello Group, Hope this isn't too apache related and considered off topic. I have a bunch of sites, each have their own IP. Some of those sites have subsites within them with different domain names, these subsites are virtual's based on domainname with all the same parent IP. If I have MP2 modules and location names that I want to share to specific IPs or Specific Virtual Hosts is there was way to define it once or does it have to be within each virtual host. For example: ServerName domain1.com PerlModule YADDA::Login SetHandler perl-script PerlHandler YADDA::Login ServerName domain2.com ServerName domian3.com In the case above I want the module YADDA::Login and the location to be available to BOTH the .05 virtual hosts, but not the .06 - so both /domain1.com/login and domian2.com/login do the same thing but domain3 would not. Is the choice either global to everything or defined within each virtual that I want it? I've been reading the server and dir create/merge section on perl.apache.org but I'm not even sure it relates. Thanks -Chris
[mp2][QUESTION]: Filter to modify request headers on a proxy server
Hi, I am trying to write a filter that will sit on a proxy server and alter HTTP requests. Basically, what I want it to do is modify the User-Agent header field so that when the request is proxied, the remote web server gets a different User-Agent header field to the one that was originally sent by the browser. There are also other header fields I may need to modify, but I would imagine this is a simple task once I've worked out how to alter the User-Agent field. Does anyone have any ideas how I might go about doing this? I've tried writing several PerlInputFilterHandlers, all with no success. Will input filters work with a proxy? I've got output filters working with no problem. Any sample code to do what I want, along with the relavent Apache directives would be very much appreciated! _/*** * _/ **Chris Pringle** _/ * ** *** _/_/_/ _/_/_/ *Personal Systems Group (PSG) ** ***_/ _/ _/ _/*Hewlett Packard - Bristol** *** _/ _/ _/_/_/ * ** _/ INVENT **Tel - +44 (0) 117 31 29664 ** ** _/Email - [EMAIL PROTECTED] ** *** _/ *
Re: Sending a different protocol header
--- Geoffrey Young <[EMAIL PROTECTED]> wrote: > btw, can you please explain what ICY is for me? I believe ICY is a protocol used for streaming media, so these headers are probably an extension of HTTP that can be used instead of the pure ICY protocol. That's a guess, anyway. :-) Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/
[ANNOUNCE] OpenInteract 1.99_03 (2.0 beta 3) released
The third beta of OpenInteract2 (1.99_03) has been released to CPAN and Sourceforge. (Release 1.99_02 was skipped for consistency.) This release includes: * Many documentation updates, including a full package development tutorial * Actions can store messages to be passed from the controller to the view, which combined with a decent templating system makes it a piece of cake to have error-aware input fields * API for management tasks has been modified to make adding tasks easier * Lots more tests (like anyone cares...) * Tons of assorted improvements and fixes throughout the system. A detailed changelog is online [1] as are the HTML-ified docs.[2] And if you can't wait for your CPAN mirror you can download it immediately.[3] Thanks, Chris [1]http://openinteract.sourceforge.net/docs/oi2/OpenInteract2/Manual/Changes.shtml [2]http://openinteract.sourceforge.net/docs/oi2/ [3]http://prdownloads.sourceforge.net/openinteract/OpenInteract-1.99_03.tar.gz?download -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
Re: Coding Style Question - Using exit
Thanks for the reply Thomas, > Why not let determine_proper_action() return undef (or OK, or whatever) if > you do not want to redirect? And in your handler do: > > my $rv=determine_proper_action(); > if ($rv) { # or ($rv == Apache::Constants::OK) > # redirect > } else > # done > } > > One problem I can see is if you're exiting somewhere deep in a nested sub > and you cannot propagate the return value back to the handler (easily). > > That seems to be working well, I've changed that part of the handler to: ** ($request_type,$back_url) = determine_proper_action(); # Properly Exit the Handler from all subs within Determine Proper Action if ($request_type eq 'Apache::REDIRECT') { $r->headers_out->set(Location => $back_url); return Apache::REDIRECT; } else { return Apache::OK; } * Then in every sub within determine_proper_action I'm returning either "Apache::OK" or "Apache::REDIRECT". Still got a lot of testing to do, but so far I've been able to get rid of all "exit"s from my script! Thanks -Chris -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
ANNOUNCE: OpenInteract 1.60 released
A new version (1.60) of OpenInteract has been released. OpenInteract is an extensible web application server built on Apache, mod_perl, the Template Toolkit and SPOPS object persistence. This release includes a handful of fairly small enhancements, including the ability to force everyone to login before seeing any part of your site. HTTP redirects (vs. using icky META tags in HTML) are also supported, and under certain circumstances we now force the Apache child into a premature death. Source: http://prdownloads.sourceforge.net/openinteract/OpenInteract-1.60.tar.gz?download Detailed changes: http://sourceforge.net/project/shownotes.php?release_id=178076 It's also winging its way around CPAN. Thanks! Chris PS: Most of these changes were actually in 1.59 but 1.60 was a release of the oops-fifteen-minutes-later variety. -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988. -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
Coding Style Question - Using exit
Folks, In the continuing effort to make my code better, I'm trying to get rid "exit" in my scripts and clean up some things that just don't sit well (but they work). Almost 95% of my pages are served up via a template system (H::T) and the rest are a redirects. Currently I use a subroutine that all my other subs pass content to, to display my templates - at the end of this sub I call "exit" so I do not go any further. In the case where I want to redirect to a URL, I then "return" to the handler with the URL. Although it works, it doesn't seem right to me.. Example To Help Explain: sub handler { $r = shift; init_global_vals(); $back_url = determine_proper_action(); my $back_url = "";$r->headers_out->set(Location => $back_url); return Apache::REDIRECT; } "Determine proper action" is a dispatch list of all the subroutines that make up the script, including the sub where I display the templates and exit. So for almost 95% of my requests, I'm "exiting" within determine_proper_action(). Does that make sense? Is it a bad thing? Thanks -Chris
Re: $r->headers_out Location and Set-Cookie
Ahh, didn't know that.. Thanks Stas! -Chris - Original Message - From: "Stas Bekman" <[EMAIL PROTECTED]> To: "Chris Faust" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, August 10, 2003 2:37 PM Subject: Re: $r->headers_out Location and Set-Cookie > Chris Faust wrote: > > I haven't had any problems setting a cookie and redirecting on MP2 by using > > the below > > > > $r->err_headers_out->add('Set-Cookie' => $packed_cookie); > > $r->header_out('Location' => $url); > > $r->status(REDIRECT); > > $r->send_http_header; > > That's when you use Apache::compat, doing the mp1 syntax. In mp2-speak that > would be: > >$r->err_headers_out->add('Set-Cookie' => $packed_cookie); >$r->headers_out->set('Location' => $url); >$r->status(REDIRECT); > > notice that you don't need to call $r->send_http_header, it doesn't exist in mp2. > > __ > Stas BekmanJAm_pH --> Just Another mod_perl Hacker > http://stason.org/ mod_perl Guide ---> http://perl.apache.org > mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com > http://modperlbook.org http://apache.org http://ticketmaster.com >
Re: $r->headers_out Location and Set-Cookie
I haven't had any problems setting a cookie and redirecting on MP2 by using the below $r->err_headers_out->add('Set-Cookie' => $packed_cookie); $r->header_out('Location' => $url); $r->status(REDIRECT); $r->send_http_header; -Chris - Original Message - From: "gerard uolaquetalestem " <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, August 09, 2003 10:01 AM Subject: $r->headers_out Location and Set-Cookie I have the next problem, i am in page A that points to page B, that is a modperl2 handler. This handler makes a job and decides to send a cookie to the browser, and after to redirect to the same page A who is ready to catch the cookie. Then the problem is that if i put the two headers, i don't have the cookie posted, but if i comment the Location header, then i stay at perl handler location, and if i go manually to page A then i see that the cookie is posted. So why these two headers doesn't respect themselves? Resuming $r->headers_out->{'Set-Cookie'} = $cookie; $r->headers_out->{'Location'} = $url; Redirects the page to $url but cookie is not seen by browser $r->headers_out->{'Set-Cookie'} = $cookie; #$r->headers_out->{'Location'} = $url; Location is the perl handler 'localhost/pageB/' (perl handler), if you then go to localhost/pageA (or simply click BACK button) then the browser DO see the cookie! Any idea? - Un nuevo buscador mas rapido, eficaz y sencillo http://www.plaf.com Ya.com ADSL Home 24h, Modem + Alta + 1 mes Gratis http://acceso.ya.com/adslhome24h/
Re: [OT] About XML and Petal (was Re: templating system opinions(axkit?))
On Mon, 28 Jul 2003, Aleksandr Guidrevitch wrote: > May be I'm a bit late here... But is there any sence in artifical XML > templating languages since there is XSLT ? Just wonder whether there are > cons other than long learning curve and performance issues ? Well, in the case of just TAL/Petal, the point as far as I know isn't so much that it happens to be valid XML -- though of course that's a welcome design aspect -- but that it's easy to use in W3C compliant HTML without masking the "interesting bits" inside HTML comment blocks. I can't think of an example now (and apologize for only having had time to skim much of this long, spiralling thread so far), but I seem to remember that TAL's syntax allowed for these clever little "inside out" loop structures that, among other things, ensures that the unrolled version of the loop still has proper indentation etc. Unessential maybe, but a nice touch. I don't know nearly enough about XSLT to comment on it in depth, but my impression is that TAL generally derives from the same heritage as all the assorted Perl template languages, etc, rather than ...well I guess I don't really know where XSLT derives from (Docbook?), but it seems more like CSS: a separate document describing how to display one or more other structured documents. The difference in the case of TAL / TT / H::T / Mason / etc is that the template is used to provide that structure itself, assembling it out of code that is maybe extracting content from a database or calculating it on the fly something. My hunch is that the way to work XSLT into the mix -- if it has a place at all -- is to have your logic (scripts with H::T, code sprinkled in Mason templates, TT applied where clever TT people apply it) fleshing out the framework defined in a template (the H::T template, the non-code part of a Mason template, the plaintext part of a TT template) as well formed XML, and then using XSLT to format that intermediate form for display. This probably makes sense in cases where that intermediate form can be cached (pages for web or print that change once a day, say), but for truly dynamic documents the XSLT stage is probably way too much overhead. Is XSLT appropriate for applying both structure & styling to the free- form output of a [Perl] program? Does it take a lot of overhead? Would this overhead happen on the server end (glue XML + XSLT into an HTML document that goes out over the wire), or on the client end (download XML, then grab XSLT by reference (like HTML grabs CSS), and then the client merges them)? If the client does the work, how widespread is support? If the server does the work, what should the throughput be like? My hunch -- which I'd be happy to be corrected about -- is that this can't be any easier than just working directly from traditional template kits, as has been discussed at remarkable length in this thread :) -- Chris Devers[EMAIL PROTECTED]http://devers.homeip.net:8080/resume/ sorry for helping along in this thread 10 days & dozens of messages ago :)
Re: Application design patterns
Frank Wiles wrote: I too would like to would like to have a better understanding of how MVC can be applied to mod_perl. Maybe even HelloWorld sized example showing how all of the different components interact? No examples, but Andy Wardley sent a great email to the Template Toolkit mailing list a few months ago about MVC and web apps: http://lists.ourshack.com/pipermail/templates/2002-November/003974.html Also no examples but possibly helpful: I place the OpenInteract2 components in an MVC context (will be in next beta): http://openinteract.sourceforge.net/docs/oi2-snapshot/OpenInteract2/Manual/Architecture.shtml Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
Re: Templating system opinions (CGI::Application in connection witheither HTML::Template or Template::Toolkit)
Dave Rolsky wrote: There's a fine book about it. www.masonbook.com Just an unbiased opinion ;) Hey, I'd be happy to write a book about OpenInteract ;-) Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
Re: Templating system opinions (CGI::Application in connection witheither HTML::Template or Template::Toolkit)
Eric wrote: That was really interesting to look at. OpenInteract is really impressive. I guess there is always a cost to having a big do it all type of system. That is what made me avoid Mason, it just blew my head off for complexity. Now it is true, I am looking for a bit more than what CGI::Application offers out of the box, but it may well end up being worthwhile to just extend rather than convert. I really appreciate the simple philosophy that HTML::Template and CGI::Application follow. OpenInteract definitely does more for you. But it also has (IMO) a fairly sophisticated way to distribute standalone applications -- including data structures, initial data, security settings, templates and (oh yeah) the actual perl code -- and plug them into another OI server. OI 1.x ties you to the Template Toolkit, but 2.x (a big improvement now in beta) allows you to use whatever templating engine you like. You lose a ton of functionality, but HTML::Template folks seem to like it that way :-) One question, how do you judge that OpenInteract is more established? Is does look like it is actively developed, but I never heard of it before, and I couldn't find much indication of how popular it is. Randal's 'far more established' may be premature :-) Taking a strict time perspective: from Backpan it looks like CGI::Application was first released to CPAN in July 2000, while OI was first released in February 2001. (I'd thought it was October 2000, but it's funny the tricks your memory will play.) As to other definitions of 'established' I haven't followed CGI::Application development to say either way. There have been more articles published on CGI::Application and it seems to have a larger userbase, partly because it's easier to get started with and wrap your head around everything it does. Classic trade-off :-) Good luck! Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
Re: Apache 1.3.27 configure error with mod_perl 1.28, perl 5.8.0, gcc 3.3 on Solaris 2.8
At 05:09 PM 7/22/2003 -0500, Bill Weinman wrote: At 04:45 PM 7/22/2003, Chris Fabri wrote: I'm not even getting as far as the make when I get the error.If I build mod_perl separately, and remove all references to these flags from the makefiles, and the run apache's config, I still get this error during configuration. Where do you find those flags in the makefiles? I don't see them anywhere in my copy. The are added to CCDLFLAGS and LDDLFAGS.They aren't in the src anywhere before perl Makefile.PL, so they are created based on something. there's also no reference to /usr/ccs/bin/ar before I create the Makefile, I'm confused as to where it's grabbing this variable, since I've removed /usr/ccs/bin/from the path and only have the path for the GNU binutils in the path./usr/ccs/bin/ar shows up in the Makefiles for "FULL_AR" and within the CCFLAGS line.chris
Re: Apache 1.3.27 configure error with mod_perl 1.28, perl 5.8.0, gcc 3.3 on Solaris 2.8
At 04:35 PM 7/22/2003 -0500, Bill Weinman wrote: At 03:50 PM 7/22/2003, Chris Fabri wrote: helpers/dummy.c -lsocket -lnsl -lpthread -W1,-E -L/usr/local/lib/gcc-lib/sparc- ..^^^ I think your problem is with the stray comma in the command line there ... I think if you check all your configurations and make files and get that fixed, it will work (at least get beyond that error). I'm not even getting as far as the make when I get the error.If I build mod_perl separately, and remove all references to these flags from the makefiles, and the run apache's config, I still get this error during configuration. Apache builds fine when I don't include mod_perl in the build, so it's definitely related to mod_perl. chris
Re: Apache 1.3.27 configure error with mod_perl 1.28, perl 5.8.0, gcc 3.3 on Solaris 2.8
At 03:50 PM 7/22/2003 -0500, Chris Fabri wrote: I'm unable to get Apache sucessfully configured with these releases.I get the following error: Error Output for sanity check cd ..; gcc -DSOLARIS2=280 -DMOD_PERL -DUSE_PERL_SSI -B/usr/ccs/bin -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DNO_DL_NEEDED -B/usr/ccs/bin -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 `./apaci` -I. -I/utilnsg_solaris/perl5.8.0/lib/5.8.0/sun4-solaris/CORE-o helpers/dummy helpers/dummy.c -lsocket -lnsl -lpthread -W1,-E -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3 /utilnsg_solaris/perl5.8.0/lib/5.8.0/sun4-solaris/auto/DynaLoader/DynaLoader.a -L/utilnsg_solaris/perl5.8.0/lib/5.8.0/sun4-solaris/CORE -lperl -lsocket -lnsl -ldl -lm -lc cc1: error: unrecognized option `-W1,-E' make: *** [dummy] Error 1 = End of Error Report = I forgot to say how exactly I arrived at this error. Here's my most recent foray after extracting mod_perl-1.28 and apache_1.3.27: perl Makefile.PL APACHE_SRC=../apache_1.3.27/src DO_HTTPD=1 USE_APACI=1 EVERYTHING=1 APACHE_PREFIX=/usr/local/apache_1.3.27 I get the same error of I go the "flexible way." chris
Apache 1.3.27 configure error with mod_perl 1.28, perl 5.8.0, gcc 3.3 on Solaris 2.8
I'm unable to get Apache sucessfully configured with these releases.I get the following error: Error Output for sanity check cd ..; gcc -DSOLARIS2=280 -DMOD_PERL -DUSE_PERL_SSI -B/usr/ccs/bin -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DNO_DL_NEEDED -B/usr/ccs/bin -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 `./apaci` -I. -I/utilnsg_solaris/perl5.8.0/lib/5.8.0/sun4-solaris/CORE-o helpers/dummy helpers/dummy.c -lsocket -lnsl -lpthread -W1,-E -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3 /utilnsg_solaris/perl5.8.0/lib/5.8.0/sun4-solaris/auto/DynaLoader/DynaLoader.a -L/utilnsg_solaris/perl5.8.0/lib/5.8.0/sun4-solaris/CORE -lperl -lsocket -lnsl -ldl -lm -lc cc1: error: unrecognized option `-W1,-E' make: *** [dummy] Error 1 = End of Error Report = I have my path set to look at gcc and binutils 2.14.But it's still trying to use /usr/ccs/bin for ar and ld. I do not have the Sun ANSI compiler. I've looked high and low and read about various issues with the GNU stuff, but haven't seen this particular error recounted. Any help is greatly appreciated. chris
Re: templating system opinions
Perrin Harkins wrote: The one thing about TT was that I don't know if I really liked how it had a different syntax than perl. Plus, as far as performance, we did some specific coding to make it faster for Slash so our templates would be in the DB. That's an anti-optimization. Filesystems are faster than databases when all you want is to fetch a single item with a specific name. It's also a pain in the ass to edit things that are in a database, as opposed to just files. I agree -- filesystems have all these great new remote access protocols like ftp and scp. That's why I took this option (storing templates in the database) out of OpenInteract. Well, actually you can still do it, I just make it really tough :-) Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
Re: templating system opinions
On Fri, 18 Jul 2003, Patrick Galbraith wrote: > Yeah, I worked with TT when I was on the Slash team ;) Then why are you asking a question like this?? :) -- Chris Devers [EMAIL PROTECTED] http://devers.homeip.net:8080/ Turing machine, n. [After Alan M. Turing (1912-1954), British mathematician and computer pioneer.] The earliest but still the fastest and most reliable computing system ever conceived. "Dis maschine vill run und run" (K. Godel). -- from _The Computer Contradictionary_, Stan Kelly-Bootle, 1995
Re: templating system opinions - Mason recommendation
Sorry to cc: this to the list, but I stand corrected and might as well mention that to the list :) On Fri, 18 Jul 2003, Dave Baker wrote: > Correction: Bricolage is written in Mason, I believe. That's what the > Bricolage authors say at http://bricolage.cc/ Hmm, so it does. I wonder where I got the idea that it was H::T based... > I'm very pleased with Mason -- the online O'Reilly book about Mason is > at http://www.masonbook.com/book/ A little bird tells me that TT is about to get an O'Reilly book as well, though it's not on their upcoming titles page (yet). The only H::T dead-trees material that I know of is a section in _CGI Programming with Perl_, 2nd edition -- that's where I learned it. I like the simplicity of H::T, but most other people seem to prefer TT or Mason. I still think it comes down to whichever system meets your needs the best, and in different contexts any of them (or others) could be appropriate. This may have been covered before here, but Zope supports an interesting template mechanism called TAL, where everything is done by attributes for the HTML tags, rather than special logical tags as most other systems use (e.g. the ones mentioned above, SSI, PHP, ASP, JSP, etc). This has the nice side effect of guaranteeing that all your html templates are always valid, and so can be used in any html IDE without complication. So for example, picking a random sample from the spec: Repeat Syntax: argument ::= variable_name expression variable_name ::= Name When you want to replicate a subtree of your document once for each item in a sequence, you use repeat. The expression should evaluate to a sequence. If the sequence is empty, then the statement element is deleted, otherwise it is repeated for each value in the sequence. If the action is cancelled, then the element is left unchanged, and no new variables are defined. The variable_name is used to define a local variable and a repeat variable. For each repetition, the local variable is set to the current sequence element, and the repeat variable is set to an iteration object. You use iteration objects to access information about the current repetition (such as the repeat index). (Iteration objects are more properly the domain of TALES.) The repeat variable has the same name as the local variable, but is only accessible through the builtin variable named repeat (see RepeatVariable). Examples: 1 Widget $1.50 It's a pretty clever approach; I'd like to see something like this done with a Perl backend (I haven't really been keeping track of development, for all I know there already is a Perl backend...). Read more: http://www.zope.org/Wikis/DevSite/Projects/ZPT/TAL http://www.zope.org/Wikis/DevSite/Projects/ZPT/TAL%20Specification%201.4 But anyway, Zope isn't mod_perl, so that's probably not what the original person was hoping to read about... :) -- Chris Devers[EMAIL PROTECTED]
Re: templating system opinions
On Fri, 18 Jul 2003, Patrick Galbraith wrote: > Just wondering what the best templating system is to use and/or learn. > > I've briefly read up on the pros and cons of each, and am just wondering > which one is the most widely _used_ and best to learn if you're wanting to > know something that there are jobs for. What's "best" depends on what your requirements are. As far as I can tell, the big ones are Template::Toolkit, Mason, and HTML::Template; each one makes different tradeoffs and makes different assumptions about the division of labor among programmers, web developers, & content producers. TT is probably the most flexible, but that or might not be what you want. Honestly, of the three I just listed, none of them are *that* complicated. If you want to learn these for job hunting purposes -- in which case it's not really fair to ask you what the requirements are, since you can't really know that -- you might as well experiment with all three. A good way to start might be by playing with different content management etc platforms that use these toolkits. From what I've read, the biggest examples I can think of are: * Slashcode (TT based, runs slashdot.org) * Bricolage (H::T, http://www.bricolage.cc/docs/Bric/HTMLTemplate.html, CMS used by theregister.co.uk et al) * Request Tracker (excellent ticketing system, runs http://rt.cpan.org/, home page is http://www.bestpractical.com/rt) Any of these can be downloaded & used freely. If you have the time for it, grab a copy of one or more and start playing around. Have fun :) -- Chris Devers [EMAIL PROTECTED] http://devers.homeip.net:8080/ drag'n'drop, v. To throw away your mouse after the first attempt to copy a file leads to its deletion. See also TRASH CAN. -- from _The Computer Contradictionary_, Stan Kelly-Bootle, 1995
Re: select multiple
CGI.pm does the trick for me, the multi values are seperated by \0 < select name="yadda" multi> yadda1 yadda2 yadda3 my $CGI = new CGI(); %form_data = $CGI->Vars; @options = split("\0",$form_data{'yadda'}); $options[0] = yadda1, $options[1] = yadda2 etc . Not usable live code obviously, but you should see the idea... -Chris - Original Message - From: "Dennis Stout" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, July 10, 2003 4:52 PM Subject: Re: select multiple > > Interesting. > > So in mod_perl, I would use $r->args{__what__} to get to it? Heh. > > I'll email the mod_perl list.. > > Dennis >
Re: mod_perl 1.0 and 2.0
There is a 0.92 version of Apache::DBI is mp2 aware (there may even be a later version at this point). We started with mp1 and do to problems we decided to goto mp2 (which turned out to be non mod_perl and apache related), there wasn't any major performance increase or anything like that and I don't remember anything major coming up during the switch (outside of cookies - which always seem to be a problem). I use a bunch of the popular modules like HTML::Template, Image::Magick, DBI, Parse/WriteExcel, Date::Manip etc and I haven't had any problems. Like Sreeji said, its really about your requirements - but the above is my experience, for what its worth. -Chris - Original Message - From: Jamie Krasnoo To: [EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 3:49 PM Subject: mod_perl 1.0 and 2.0 Hi all, Im currently working on a personal project to get myself back in mod_perl programming order. However Im more used to using mod_perl 1.0 with Apache 1.3.x. Im going through the documentation for mod_perl 2.0 but Im worried that most of the modules I need wont work with mod_perl 2.0. Ive been looking for what modules will and will not work with 2.0 (like Apache::DBI for pooling connections with MySQL). Would it be a better benefit to me to switch over to 2.0? Thanks, Jamie
Re: --help
On Wed, 9 Jul 2003, Alexander Prihodko wrote: > --help Usage: [EMAIL PROTECTED] [-s topic] PROBLEM [DETAILS] Describe a PROBLEM, giving DETAILS, so that the members of the list can try to assist you. Example: Date: Wed, 01 Jan 1970 00:00:00 + From: D Ritchie <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: won't build on new lab system Your ^*$*&$ software won't compile on this PDP-11. I keep getting the error "cowardly refusing to create an empty archive". What is *that* supposed to mean? Here's the full error dump: And here's the software & hardware I'm running: Options: -p --post: [EMAIL PROTECTED] -S --subscribe : [EMAIL PROTECTED] -u --unsubscribe : [EMAIL PROTECTED] -h --help : [EMAIL PROTECTED] Please, try again :) -- Chris Devers [EMAIL PROTECTED] http://devers.homeip.net:8080/ reusability, n. A marketing priority overriding that of usability. See also OBJECT ORIENTEETING. -- from _The Computer Contradictionary_, Stan Kelly-Bootle, 1995
[ANNOUNCE] OpenInteract 1.99_01 (2.0 beta 2) released
The second beta of OpenInteract2 (1.99_01) has been released to CPAN and SourceForge. The release: includes many documentation updates, has a totally revamped logging system using log4perl, supports multiple content generators, introduces content filters and has a bunch of other features, fixes and improvements. A detailed changelog is online [1], as are the HTML-ified docs [2]. And if you can't wait for your CPAN mirror you can download it immediately.[3] Thanks, Chris [1] http://sourceforge.net/project/shownotes.php?group_id=16810&release_id=169294 [2] http://openinteract.sourceforge.net/docs/oi2/ [3] http://prdownloads.sourceforge.net/openinteract/OpenInteract-1.99_01.tar.gz?download -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
Re: advice on implementing a controller manager
Xavier Noria wrote: I am writing an application following MVC with Perl Apache modules and the Template Toolkit. Apache is 1.x. I would like to have just one entry point to the application, which would play the role of someone who sets everything necessary up and forwards the actual request to a selected handler. From what I have read, looks like implementing that controller as a PerlFixupHandler which would use push_handlers() and pass things via pnotes() would be fine, but I am not experienced in mod_perl. Would you suggest a different approach? A word of advice: if you'd like to use it under different web environments, create your own system for registering/calling handlers instead of using the Apache API. That is, have a map of URL-to-class and have your controller find the class to execute based on the URL and call it directly. This is how OpenInteract does it and it's saved quite a lot of grief. It also makes for nice decoupling which is always a good thing. Of course, you could use OpenInteract as an MVC framework that uses the Template Toolkit, but that's a different matter... :-) Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
RE: Problem building libapreq-1.2
I was able to get it to build by manually coping the header files to the apache source tree but there still is no bash$ locate mod_perl.h in the perl tree. Chris -Original Message- From: Randy Kobes [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 24, 2003 7:55 PM To: Chris Pizzo Cc: [EMAIL PROTECTED] Subject: RE: Problem building libapreq-1.2 On Tue, 24 Jun 2003, Chris Pizzo wrote: > -Original Message- > From: Randy Kobes [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 24, 2003 6:14 PM > To: Chris Pizzo > Cc: [EMAIL PROTECTED] > Subject: Re: Problem building libapreq-1.2 > > On Tue, 24 Jun 2003, Chris Pizzo wrote: [ .. ] > > and when i run make i get a bunch of errors: > > Request.xs:41:22: mod_perl.h: No such file or directory > > Request.xs:87: parse error before "SV" > > Did you install mod_perl after building it? > -End Original Message- > Yes I did install the mod perl. I even brought up the apache test page > indicating it was installed. If you do a bash$ locate mod_perl.h do you see mod_perl.h installed in the Perl tree, and that Perl corresponds to the same Perl as with which you're building things with? -- best regards, randy
Re: errors installing libapreq [RESOLVED]
Well, I rebuilt Apache/mod_perl, and it seemed to work. For those that hit the same error, the fix -- which I've saved as a script for future reference :) -- is as follows: * Install Apache/mod_perl: #!/bin/sh # chd.build.apachemodperl.sh perl=/sw/bin/perl modperldir=/usr/src/mod_perl-1.27 apachedir=/usr/src/apache_1.3.27 builddir=/usr/local/apache pushd $modperldir $perl Makefile.PL \ APACHE_SRC=../apache_1.3.xx/src \ APACHE_PREFIX=${builddir} \ APACHE_USER=www \ APACHE_GROUP=www \ DO_HTTPD=1 \ USE_APACI=1 \ EVERYTHING=1 \ APACI_ARGS='--sbindir=${builddir}/sbin, \ --sysconfdir=${builddir}/etc, \ --localstatedir=${builddir}/var, \ --runtimedir=${builddir}/var/run, \ --logfiledir=${builddir}/var/logs, \ --proxycachedir=${builddir}/var/proxy, \ --enable-module=so' make make test sudo make install pushd $apachedir sudo make install echo "Verifying that the build worked:" ${builddir}/sbin/apachectl configtest && \ echo "congratulations, you may now reset apache by running" && \ echo "${builddir}/sbin/apachectl start" * Installation may disrupt Perl modules. I had to rebuild Apache::Test % sudo /sw/bin/perl -MCPAN -e shell cpan> install Apache::Test * Install libapreq: % perl Makefile.PL \ > -httpd /usr/local/apache/sbin/httpd \ > -apxs /usr/local/apache/sbin/apxs % make % make test % make install Everything went smoothly up to the `perl Makefile.PL [...]` step, where I got this error: skipping test setup...Undefined subroutine &Apache::Test::config called at /sw/lib/perl5/site_perl/5.8.0/darwin/Apache/TestMM.pm line 90. Warning: prerequisite Apache::Test 1.03 not found. We have unknown version. And, as I say, rebuilding Apache::Test in the CPAN shell took care of that. Others may hit different problems that could be fixed similarly. All better now :) -- Chris Devers[EMAIL PROTECTED] channeler, n. Also SPIRIT GUIDE. Politically correct terms for DAEMON. -- from _The Computer Contradictionary_, Stan Kelly-Bootle, 1995
errors installing libapreq
he/etc, --libexecdir=/usr/local/apache/libexec" ...and increasingly desperate variations thereof. I will plead guilty to not even knowing if that's valid, meaningful syntax for that line -- it seemed to [not] work just as badly as everything else I tried... "When all you have is a hammer, everything feels like a thumb." So. libapreq fails on make test, when running against Fink's Perl5.8, a hand-rolled Apache 1.3.27 / mod_perl 1.27 combo running on OSX 10.2.6. In a nutshell. Any pointers as to why this may be happening & how it may be fixed would be appreciated. Thanks! -- Chris Devers[EMAIL PROTECTED] uptime, n. Some future (unspecified) time when the system will be UP and running. Compare DOWNTIME. See also CRASH. -- from _The Computer Contradictionary_, Stan Kelly-Bootle, 1995
Re: Problem building libapreq-1.2
When I do : locate mod_perl.h I get: /home/Chrisp/mod_perl-1.27/apaci/mod_perl.h /home/Chrisp/mod_perl-1.27/src/modules/perl/mod_perl.h /home/Chrisp/mod_perl-1.27/htdocs/manual/mod/mod_perl.html http server-info shows the mod_perl module loaded I'm not sure why the header files aren't copied. I checked another install I did and they are there. I guess I should also say I am building Apache using DSO Thanks for the help, Chris At 04:50 PM 6/24/2003, Chris Pizzo wrote: Hi all, I am trying to install libapreq-1.2 on my redhat 8.0 system. I keep getting these warnings when i run perl Makefile.PL: Warning: -L../blib/arch/auto/libapreq changed to -L/home/Chrisp/libapreq-1.2/Request/../blib/arch/auto/libapreq Warning: -L../blib/arch/auto/libapreq changed to -L/home/Chrisp/libapreq-1.2/Cookie/../blib/arch/auto/libapreq and when i run make i get a bunch of errors: Request.xs:41:22: mod_perl.h: No such file or directory Request.xs:87: parse error before "SV" . . . make[1]: *** [Request.o] Error 1 make[1]: Leaving directory `/home/Chrisp/libapreq-1.2/Request' make: *** [subdirs] Error 2 I'm not sure what is wrong. I built mod_perl with the EVERYTHING=1 switch. I also re-built perl to be non-multi-threaded. Any pionters as to what is wrong appreciated. Thanks, Chris
RE: Problem building libapreq-1.2
Yes I did install the mod perl. I even brought up the apache test page indicating it was installed. -Original Message- From: Randy Kobes [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 24, 2003 6:14 PM To: Chris Pizzo Cc: [EMAIL PROTECTED] Subject: Re: Problem building libapreq-1.2 On Tue, 24 Jun 2003, Chris Pizzo wrote: > Hi all, > I am trying to install libapreq-1.2 on my redhat 8.0 system. I keep > getting these warnings when i run perl Makefile.PL: > > Warning: -L../blib/arch/auto/libapreq changed to > -L/home/Chrisp/libapreq-1.2/Request/../blib/arch/auto/libapreq > Warning: -L../blib/arch/auto/libapreq changed to > -L/home/Chrisp/libapreq-1.2/Cookie/../blib/arch/auto/libapreq These warnings are OK ... > and when i run make i get a bunch of errors: > Request.xs:41:22: mod_perl.h: No such file or directory > Request.xs:87: parse error before "SV" Did you install mod_perl after building it? -- best regards, randy kobes
Problem building libapreq-1.2
Hi all, I am trying to install libapreq-1.2 on my redhat 8.0 system. I keep getting these warnings when i run perl Makefile.PL: Warning: -L../blib/arch/auto/libapreq changed to -L/home/Chrisp/libapreq-1.2/Request/../blib/arch/auto/libapreq Warning: -L../blib/arch/auto/libapreq changed to -L/home/Chrisp/libapreq-1.2/Cookie/../blib/arch/auto/libapreq and when i run make i get a bunch of errors: Request.xs:41:22: mod_perl.h: No such file or directory Request.xs:87: parse error before "SV" . . . make[1]: *** [Request.o] Error 1 make[1]: Leaving directory `/home/Chrisp/libapreq-1.2/Request' make: *** [subdirs] Error 2 I'm not sure what is wrong. I built mod_perl with the EVERYTHING=1 switch. I also re-built perl to be non-multi-threaded. Any pionters as to what is wrong appreciated. Thanks, Chris
Re: Apache Error of $r->read failed to read
I FOUND IT!! Like you said, it was in CGI.pm. It happens when doing a file upload ## while ($bytesread=read($image_filename_one,$buffer,1024)) { print OUTFILE $buffer; } ## If during the upload the user stops, drops or dies then the errors come through which makes me think now that its not as serious of a error as I thought (meaning any ill effects I may have thought was a result of that error message, really isn't). At very least at least I know what causes it. Thanks -Chris - Original Message - From: "Stas Bekman" <[EMAIL PROTECTED]> > > You probably use CGI.pm or something else that calls $r->read(). This happends > in xs/Apache/RequestIO/Apache__RequestIO.h (hint grep the mod_perl source code): > > /* > * XXX: as stated in ap_get_client_block, the real > * error gets lots, so we only know that there was one > */ > ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, > "mod_perl: $r->read failed to read"); > break; > > As you can see from the comment due to a bad implementation of > ap_get_client_block in Apache, the error is not available. I'm planning to > rewrite all these functions to get rid of ap_get_client_block, and work with > bucket brigades instead. > > In any case that won't solve the problem that you are seeing, I'd dig in > Apache. e.g. trying to use mod_cgi (which doesn't use ap_get_client_block) to > reproduce the problem and ask at the httpd list. > > __ > Stas BekmanJAm_pH --> Just Another mod_perl Hacker > http://stason.org/ mod_perl Guide ---> http://perl.apache.org > mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com > http://modperlbook.org http://apache.org http://ticketmaster.com > > > We have been having some problems where all of a sudden apache will > > start logging the error of: > > > > [error] mod_perl: $r->read failed to read > >
[ANNOUNCE] OpenInteract 1.99_00, first 2.0 beta
I am happy to announce the first beta of OpenInteract 2.0, 1.99_00. This is a major rewrite of the OpenInteract web application framework with substantial feature enhancements. A few highlights: * Runs under more environments than Apache/mod_perl 1.x since the request and response responsibilities are divided up * No separate repository of packages, each website stands on its own * Task-oriented management framework to make creating websites, creating and installing packages, installing SQL and other jobs much easier. * An app server no longer demands your full URL-space so you can deploy it under a location (e.g., http://www.mysite.com/OI2/) and have all actions respond and rewrite URLs properly. * Lots of changes to make package development easier. While it should be a fairly solid release this is still a beta. It's only been tested on a couple of databases, only on Linux and on 5.8.0. It should still work on the same systems as OI 1.x but there's always that X factor... OpenInteract 1.99_00 has been released to both CPAN and the Sourceforge area [1]. You can browse the full (and growing) set of documentation online [2] and follow the status at the OpenInteract wiki site [3]. I'd love to talk with people at YAPC::NA about OI2 and would be happy to initiate a BOF if there's enough interest. Thanks! Chris [1] http://prdownloads.sourceforge.net/openinteract/OpenInteract-1.99_00.tar.gz?download [2] http://openinteract.sourceforge.net/docs/oi2/ [3] http://openinteract.sourceforge.net/cgi-bin/twiki/view/OI/ -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
Re: is anybody using mp2 in production?
> (Btw, Chris, are you using the worker mpm ? Is it > stable ? We'd like to go the worker mpm way & would > like to know if any1 is using it yet in production.) > On our dev server yes, and all seems well - but we haven't rolled it out in production yet. Its one of those things we want to do but keep getting side tracked with something else. Sooner then later we will be giving it a shot though. I'd be interested in what you thought of the switch after going live, we were never sure (but getting there now) if we should have started with MP2 or not, never got a chance to see MP1 in action. -Chris
Re: is anybody using mp2 in production?
Our mod_perl success story. As consultants we were hired to repair, revamp and rebuild a online classifieds site in which a lot of cost and effort was placed in promoting the site and generating traffic but the site itself was based on a 3rd party product that simply could not handle the half million hits a day the site was getting. Without a lot of effort the decision was made to build a custom solution from the ground up using Perl and Apache under Linux. After completing the project and having some difficult issues with the current ISP we moved the entire site to an ISP that we have had a long term relationship with and who provides us with everything one would need to properly maintain such a project. Little did we know that the second we moved to our new ISP it was like opening up the flood gates (long story relating to other ISP), overnight this CGI driven site went from a half million hits a day to a million and with it came a number of problems, a lot of which were unfixable without adding more hardware - there was simply far too much traffic coming through during the peak times of the day. Having spent a week doing everything we could, optimizing everything possible it was clear that at best, we may be able to gain enough to just keep our heads above water. Reluctantly we knew we had no choice but to give mod_perl a try, we really didn't think it was going to make that much of a difference but every little bit counted at this point. We knew that it was going to be very difficult to setup apache and especially convert our code over - I mean after all I've heard as many stories of nightmare conversions as success stories. After about the first week of pouring through the documentation and experimenting on our development server, I realized HOW WRONG I WAS.. Once we understood what was expected, conversion of the current code was less painful and a lot more interesting to do then some of the phone calls or meetings that led up to getting the contract for the project itself J. Once everything was done we could see instantly the improvement on our dev server, what we didn't know nor what we were prepared for was what would happen once this was running in production, I mean sure it was fast when there is only 2 of us on the machine, so was the old site. What we saw after going live was one of those moments when you are just blown away, where you are sitting there saying "I see it but I just don't believe it". At our best estimate we gained more then a 300% performance increase, during peak hours we were seeing load times of 20 - 30, processing going defunct etc. etc. prior to mod_perl. Since the day we went live we haven't seen the machines even sweat, even the DB machine was impacted by the change in a positive way. We are currently up over 2 million hits a day, the 1 million hits gained since going live with mod_perl has resulted in practically nothing (everything is still saying "Give me More!!!") We'd like to think it was easy moving to mod_perl because we are such awesome coders, but of course the truth is it's due to the awesome documentation at http://perl.apache.org, the fantastic support of mod_perl in all those perl modules we have all come to depend on, the invaluable mailing lists and mailing list archives, and what I personally think is the coolest thing of all, Stas Bekman who never left me or anyone else I've seen on the mailing list hanging for any answer. We have just completed a re-design of the site and have been up and running under Apache 2 and mod_perl 2 for about 6 months now with as few problems as anyone could ever hope to have. Mod_perl is clearly the solution for high traffic sites, however because of our experience with mod_perl we have since done everything in it, from the simplest of form mailers to complex sites because in my eyes there is no reason not to do things the best possible way the first time around! Thanks to Everyone on the Mod_perl Team Chris Faust Developer of http://www.isoldmyhouse.com - Original Message - From: "Stas Bekman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, April 08, 2003 1:50 AM Subject: is anybody using mp2 in production? > I've heard that some people are already using mod_perl 2.0 in production. It'd > be interesting to hear mp2 both success and failure stories. > > p.s. mod_perl 1.99_09, which includes new features and lots of bug fixes, > should be released as soon as the current cvs is stabilized. So testing the > current cvs and reporting any problems (especially build/test ones) would be > helpful to make the new release better. About the same time Apache::Test > should be released on CPAN. > > __ > Stas BekmanJAm_pH --> Just Another mod_per
Not reading $ENV variable
Hi all, I'm seeing a weird thing. Sometimes my script sees nothing in the $ENV{HTTP_REFERER} variable. Im not sure what is causing this. It works some of the time. I do this at the begining of the script...heres the code: my $r = Apache->request; use DBI;# for connecting to the database my $refer_url = $ENV{HTTP_REFERER}; basically the script takes form data and inserts it to a db then returns back to the refering page. Thanks for any ideas Chris
Apache Error of $r->read failed to read
Hi, We have been having some problems where all of a sudden apache will start logging the error of: [error] mod_perl: $r->read failed to read Multiple times (100s in less then 10th of a sec), often it will get to the point where load on the machine goes through the roof and apache has problems responding and it appears to be the number of requests that are happening as limits that shouldn't be reached like DB connections and apache processes are maxing out during non-peak hours. From what we could see it looked like someone outside was sending all kind of linefeeds and whatnot within the URL which was documented in the Apache 45 release which we did update - now we are down to getting the above mod_perl error and shortly after that starts all hell breaks loose. Nowhere in our code do we directly call the "read" method nor can I find anything relating to the error so I'm a little lost on what I can do. Any ideas? Thanks -Chris RH Linux 8 Apache 2.0.45 mod_perl 1.99.05 -8<-- Start Bug Report 8<--1. Problem Description: See Above 2. Used Components and their Configuration: *** using /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/Apache/BuildConfig.pm*** Makefile.PL options: MP_APXS => /usr/sbin/apxs MP_GENERATE_XS => 1 MP_LIBNAME => mod_perl MP_USE_DSO => 1 MP_USE_STATIC => 1 *** The httpd binary was not found *** /usr/bin/perl -VSummary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=linux, osvers=2.4.18-11smp, archname=i386-linux-thread-multi uname='linux daffy.perf.redhat.com 2.4.18-11smp #1 smp thu aug 15 06:41:59 edt 2002 i686 i686 i386 gnulinux ' config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dmyhostname=localhost [EMAIL PROTECTED] -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm', optimize='-O2 -march=i386 -mcpu=i686', cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -I/usr/include/gdbm' ccversion='', gccversion='3.2 20020822 (Red Hat Linux Rawhide 3.2-5)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil libc=/lib/libc-2.2.92.so, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='2.2.92' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Built under linux Compiled at Sep 1 2002 23:56:49 %ENV: PERL_LWP_USE_HTTP_10="1" @INC: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl . 3. This is the core dump trace: (if you get a core dump): [CORE TRACE COMES HERE] This report was generated by -e on Wed May 28 19:16:35 2003 GMT. -8<-- End Bug Report --8<--
Recompiling Apache
Hello Group, I want to add the rewrite module to my apache and it would appear I have to recompile apache to do so.. Does this mean I'll need to redo mod_perl after Apache as well? RH 8 Apache 2.044 mod_perl 1.99.09 Thanks -Chris
Re: mod_perl.pm and Apache 2
OK, I've resolved the mod_perl.pm dependency by reinstalling mod_perl-1.99_08 (from src). But now I get this when trying to install Apache::Cookie Can't locate Apache/MyConfig.pm in @INC (@INC contains: /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib /usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int /usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at Makefile.PL line 54. BEGIN failed--compilation aborted at Makefile.PL line 54. When I try to install Apache::MyConfig I get this: Warning: Cannot install Apache::MyConfig, don't know what it is. Try the command i /Apache::MyConfig/ to find objects with matching identifiers. -chris Chris Majewski <[EMAIL PROTECTED]> writes: > Hi > I'm trying to build RequestTracker (RT), a trouble ticket system which uses > Apache and mod_perl. Apache's site recommends Apache 2, so I've got > that, and I've built mod_perl-1.99 for it. Now here's the problem. RT > requires a bunch of perl modules, among them Apache::Cookie. That > module requires something called mod_perl.pm. So I do an "install > mod_perl" on the MCPAN command line. This asks me for my Apache > source. I answer "/usr/opt/src/httpd-2.0.44". Then I get this: > > Configure mod_perl with /usr/opt/src/httpd-2.0.44 ? [y] > ***** WARNING * > > Apache Version 1.3.0 required, aborting... > > > What now? > chris
mod_perl.pm and Apache 2
Hi I'm trying to build RequestTracker (RT), a trouble ticket system which uses Apache and mod_perl. Apache's site recommends Apache 2, so I've got that, and I've built mod_perl-1.99 for it. Now here's the problem. RT requires a bunch of perl modules, among them Apache::Cookie. That module requires something called mod_perl.pm. So I do an "install mod_perl" on the MCPAN command line. This asks me for my Apache source. I answer "/usr/opt/src/httpd-2.0.44". Then I get this: Configure mod_perl with /usr/opt/src/httpd-2.0.44 ? [y] * WARNING * Apache Version 1.3.0 required, aborting... What now? chris
RE: MP2 - New Install - Make Test Errors - Resolved
Thanks for the fixes Stas, I appear to be up and running now.. Just a FYI for reference, I updated the source via CVS and tried it again. That time around I didn't get the TestConfig error but I got pretty much all the same errors that I got on the first (non-cvs) build where it couldn't find init::first, protocol, echo etc. If you want to see the info on that its here. Report http://tagteam.prevare.com/mp2pr1.txt Error Log http://tagteam.prevare.com/mp2pr1log.txt I tried adding them to the init.pm and got the same results. The last thing I did was kill the entire source directory, made sure I was just a standard user, downloaded the source via CVS again and then did the build, make and make test as that standard user and then SU'ed to root just for "make install" and everything went worked like a charm. Now I can see the only thing I ever want to see in my error log: Apache/2.0.44 (Unix) mod_perl/1.99_09-dev Perl/v5.8.0 configured Sweet! Thanks -Chris >> -Original Message- >> From: Stas Bekman [mailto:[EMAIL PROTECTED] >> Sent: Saturday, March 22, 2003 11:54 PM >> To: Chris Faust >> Cc: Modperl >> Subject: Re: MP2 - New Install - Make Test Errors >> >> >> Chris Faust wrote: >> > Thanks Stas, I tried getting it via CVS and all those other >> problems went >> > away but I have a new one.. >> > >> > "Can't locate Apache/TestConfig.pm" >> > >> > This happens right at the end of the "make" and the module is >> within @INC. >> >> Thanks Chris, this is now fixed in cvs. Please run 'cvs up' and >> try again. >> >> I've missed the problem, since I had an installed Apache/Test. Once I've >> removed it, the problem was right there. >> >> __ >> Stas BekmanJAm_pH --> Just Another mod_perl Hacker >> http://stason.org/ mod_perl Guide ---> http://perl.apache.org >> mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com >> http://modperlbook.org http://apache.org http://ticketmaster.com
RE: MP2 - New Install - Make Test Errors
Thanks Stas, I tried getting it via CVS and all those other problems went away but I have a new one.. "Can't locate Apache/TestConfig.pm" This happens right at the end of the "make" and the module is within @INC. I haven't seen any posts that relate to this problem, any idea? Here is the bug report, I don't see any "error_log" in the CVS version. Thanks -Chris -8<-- Start Bug Report 8<-- 1. Problem Description: During "make" Can't locate Apache/TestConfig.pm in @INC (@INC contains: Apache-Test/lib /home/chris/cvs/modperl-2.0/lib /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at /home/chris/cvs/modperl-2.0/lib/ModPerl/Code.pm line 9. I assume the rest of these errors are the result of "TestConfig" not being found. BEGIN failed--compilation aborted at /home/chris/cvs/modperl-2.0/lib/ModPerl/Code.pm line 9. Compilation failed in require at /home/chris/cvs/modperl-2.0/lib/Apache/Build.pm line 14. BEGIN failed--compilation aborted at /home/chris/cvs/modperl-2.0/lib/Apache/Build.pm line 14. Compilation failed in require at /home/chris/cvs/modperl-2.0/lib/ModPerl/MM.pm line 8. BEGIN failed--compilation aborted at /home/chris/cvs/modperl-2.0/lib/ModPerl/MM.pm line 8. Compilation failed in require at /home/chris/cvs/modperl-2.0/lib/ModPerl/BuildMM.pm line 6. BEGIN failed--compilation aborted at /home/chris/cvs/modperl-2.0/lib/ModPerl/BuildMM.pm line 6. Compilation failed in require. BEGIN failed--compilation aborted. make[1]: *** [glue_pods] Error 2 make[1]: Leaving directory `/home/chris/cvs/modperl-2.0/ModPerl-Registry' make: *** [subdirs] Error 2 ## End of make 2. Used Components and their Configuration: *** using lib/Apache/BuildConfig.pm *** Makefile.PL options: MP_AP_PREFIX=> /usr/local/apache2 MP_GENERATE_XS => 1 MP_INST_APACHE2 => 1 MP_LIBNAME => mod_perl MP_USE_DSO => 1 MP_USE_STATIC => 1 *** /usr/local/apache2/bin/httpd -V Server version: Apache/2.0.44 Server built: Mar 20 2003 11:04:09 Server's Module Magic Number: 20020903:0 Architecture: 32-bit Server compiled with -D APACHE_MPM_DIR="server/mpm/prefork" -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D HTTPD_ROOT="/usr/local/apache2" -D SUEXEC_BIN="/usr/local/apache2/bin/suexec" -D DEFAULT_PIDLOG="logs/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_LOCKFILE="logs/accept.lock" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf" *** /usr/bin/perl -V Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=linux, osvers=2.4.18-11smp, archname=i386-linux-thread-multi uname='linux daffy.perf.redhat.com 2.4.18-11smp #1 smp thu aug 15 06:41:59 edt 2002 i686 i686 i386 gnulinux ' config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dmyhostname=localho st [EMAIL PROTECTED] -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix =/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads -Duseithreads -Duselargefi les -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_sysl og -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversionon ly -Dpager=/usr/bin/less -isr' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FIL E_OFFSET_BITS=64 -I/usr/include/gdbm', optimize='-O2 -march=i386 -mcpu=i686', cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -I/usr/include/gdb m' ccversion='', gccversion='3.2 20020822 (Red Hat Linux Rawhide 3.2-5)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='gcc', ldflags =&
MP2 - New Install - Make Test Errors
I'm installing mod_perl for the 3rd time using pretty much the same config (machine, OS etc) as before but this time around I'm getting a lot of strange errors when I run "make test". Here is a bug report: http://tagteam.prevare.com/mp2bug.txt Here is the Error Log http://tagteam.prevare.com/mp2error.txt Here is a "perl -V" http://tagteam.prevare.com/perlver.txt At first I was getting a host of those errors that were "Cannot Locate TeshHooks/init... , echo etc". I edited t/hooks/TestHooks/init.pm and added: PerlModule TestHooks::init PerlModule TestProtocol::echo PerlModule TestProtocol::echo_filter (Why almost all the "init.pm" errors went away but the one that is showing up is beyond me, the init.pm and protocol modules are within @INCs) As I saw in some other posts, after doing that those errors went away and I was left with what is in the logs above. I also saw some posts where there could be some permissions issues so I killed the whole directory, extracted it all again as a normal user, made the edits to init.pm, su'ed to root and tryed to install again - I got the same results. RH Linux 8 Apache 2.0.44 mod_perl 1.99.08 Perl 5.8.0 Building Via: perl Makefile.PL MP_AP_PREFIX=/usr/local/apache2 \ MP_INST_APACHE2=1 Any ideas? Thanks -Chris
MP2 - New Install - Make Test Errors
(sorry if this hits the list twice, I didn't use my registered email on the first note and I don't think it made it) I'm installing mod_perl for the 3rd time using pretty much the same config (machine, OS etc) as before but this time around I'm getting a lot of strange errors when I run "make test". Here is a bug report: http://tagteam.prevare.com/mp2bug.txt Here is the Error Log http://tagteam.prevare.com/mp2error.txt Here is a "perl -V" http://tagteam.prevare.com/perlver.txt At first I was getting a host of those errors that were "Cannot Locate TeshHooks/init... , echo etc". I edited t/hooks/TestHooks/init.pm and added: PerlModule TestHooks::init PerlModule TestProtocol::echo PerlModule TestProtocol::echo_filter (Why almost all the "init.pm" errors went away but the one that is showing up is beyond me, the init.pm and protocol modules are within @INCs) As I saw in some other posts, after doing that those errors went away and I was left with what is in the logs above. I also saw some posts where there could be some permissions issues so I killed the whole directory, extracted it all again as a normal user, made the edits to init.pm, su'ed to root and tryed to install again - I got the same results. RH Linux 8 Apache 2.0.44 mod_perl 1.99.08 Perl 5.8.0 Building Via: perl Makefile.PL MP_AP_PREFIX=/usr/local/apache2 \ MP_INST_APACHE2=1 Any ideas? Thanks -Chris
RE: Using a Startup.pl
Thanks for the explanation and the details Stas, I'm actually OK with everything in my startup.pl being available to all virtual hosts. After reading the post from Thomas I went back in and removed all the "perlModule" and "perlRequire" lines from the virtual host containers and loaded everything at once outside of the VHosts and it seems to have corrected my problems. Its good to know if there is a need to divide it the ability is there to do so (looks like I was doing it but without creating a new parent interpreter). I am using mod_perl 1.99.08, this is my second dev server and I've found that RH is OK as a OS but I've had MUCH better results leaving it at that and installing Apache, mod_perl and mySql etc. from source and not as part of the RH install or using RPMs.. Congrads to all you guys on mod_perl, I've heard about it and things like fastCGI for what seems like forever but until we got to the point where we were getting 1.8 million hits a day and everything was crawling as it was 99% perl, I never took the time to get into it - after the 300% performance increase seen after converting the entire site I simply cannot live without it and I refuse to do even the smallest projects using anything else. -Chris >> -Original Message- >> From: Stas Bekman [mailto:[EMAIL PROTECTED] >> Sent: Tuesday, March 18, 2003 5:34 PM >> To: Thomas Klausner >> Cc: Modperl >> Subject: Re: Using a Startup.pl >> >> >> Thomas Klausner wrote: >> > Hi! >> > >> > On Tue, Mar 18, 2003 at 01:39:41PM -0500, Chris Faust wrote: >> > >> > >> >>I'm running mod_perl 2 on RedHat with Apache 2.0.44 and I'm >> using NamedBased >> >>Virtual Hosting in apache (so I have a number of virtual hosts >> and apache >> >>directs properly based on hostname). >> >> >> >>I use a startup.pl to load up common things like DBI, CGI, >> HTML::Template >> >>etc.. >> >> >> >>Should I have just a single startup.pl and will that work with >> all virtual >> >>hosts? Or should I have a startup.pl per virtual host. >> > >> > >> > AFAIK, and with mod_perl 1.x, having multiple startup.pl's >> makes no sense as >> > they all get executed during server startup and in the main namespace. >> >> That's correct only for mod_perl 1.0. >> >> For mod_perl 2.0 this depends on whether 'PerlOptions +Parent' >> is set or not. >> If it is each vhost can have their own startup.pl (only that >> vhost will ever >> execute/see the code that run from it). It's documented here: >> http://perl.apache.org/docs/2.0/user/config/config.html#C_Parent_ >> >> (though as someone reported PerlOptions +Parent doesn't work inside the >> container, I haven't had a chance to work on it yet.) >> >> However this is all new code and not very tested yet, so I won't >> be surprised >> if there are problems with it. If you have problems report them >> as explained here: >> http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems >> >> __ >> Stas BekmanJAm_pH --> Just Another mod_perl Hacker >> http://stason.org/ mod_perl Guide ---> http://perl.apache.org >> mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com >> http://modperlbook.org http://apache.org http://ticketmaster.com
RE: Using a Startup.pl
Thanks Thomas, that is what I wanted to know!! -Chris >> -Original Message- >> From: Thomas Klausner [mailto:[EMAIL PROTECTED] >> Sent: Tuesday, March 18, 2003 1:50 PM >> To: Modperl >> Subject: Re: Using a Startup.pl >> >> >> Hi! >> >> On Tue, Mar 18, 2003 at 01:39:41PM -0500, Chris Faust wrote: >> >> > I'm running mod_perl 2 on RedHat with Apache 2.0.44 and I'm >> using NamedBased >> > Virtual Hosting in apache (so I have a number of virtual hosts >> and apache >> > directs properly based on hostname). >> > >> > I use a startup.pl to load up common things like DBI, CGI, >> HTML::Template >> > etc.. >> > >> > Should I have just a single startup.pl and will that work with >> all virtual >> > hosts? Or should I have a startup.pl per virtual host. >> >> AFAIK, and with mod_perl 1.x, having multiple startup.pl's makes >> no sense as >> they all get executed during server startup and in the main namespace. >> >> >> -- >> #!/usr/bin/perl http://domm.zsi.at >> for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}
Using a Startup.pl
Hello All, This may be a stupid question, but I'm not finding any clear documentation to give me a answer. I'm running mod_perl 2 on RedHat with Apache 2.0.44 and I'm using NamedBased Virtual Hosting in apache (so I have a number of virtual hosts and apache directs properly based on hostname). I use a startup.pl to load up common things like DBI, CGI, HTML::Template etc.. Should I have just a single startup.pl and will that work with all virtual hosts? Or should I have a startup.pl per virtual host. Currently I'm using a startup.pl per virtual host and I'm seeing some strange problems, I'm wondering if my problem is there should only be one startup.pl - or does it not matter either way? Thanks -Chris
RE: Apache is exiting....
Hey Paolo, Did you try to add some die statements to see if it made any difference, so something like: use Image::Magick; my $image=Image::Magick->new(size=>'75x75'); $image->Read('null:white'); die &display_error("Read Error Error: Image: null:white $image \n") if ($image); my @x = $image->QueryFontMetrics font=>'@/usr/X11R6/lib/X11/fonts/ttf/Ritalin.ttf',text=>'X', pointsize=>12); die &display_error("ImFont Query Error: @x $image") if ($image); Works for me, then I just have a sub called "display_error" that prints the message and error out in a browser, but you could make that anything you want. -Chris >> -Original Message- >> From: Paolo Campanella [mailto:[EMAIL PROTECTED] >> Sent: Thursday, February 27, 2003 8:43 AM >> To: [EMAIL PROTECTED] >> Subject: Apache is exiting >> >> >> >> Hi all >> >> Here's a stripped-down version of a script I use: >> === >> use Image::Magick; >> my $image=Image::Magick->new(size=>'75x75'); >> $image->Read('null:white'); >> my @x = >> $image->QueryFontMetrics(font=>'@/usr/X11R6/lib/X11/fonts/ttf/Rit >> alin.ttf',text=>'X', pointsize=>12); >> === >> >> If the font can't be found, I get this in my error log: >> === >> Exception 415: UnableToReadFont >> (@/usr/X11R6/lib/X11/fonts/ttf/Ritalin.ttf) at /path/to/script line 584. >> [Thu Feb 27 15:17:07 2003] [alert] Child 8329 returned a Fatal error... >> Apache is exiting! >> === >> >> Even using an Error.pm try/catch block makes no difference. Pretend >> for a moment that you have no specific knowledge of the library which >> causes this problem: is there any black box approach to stopping some >> library's complaints from shutting down my web server? >> >> Thanks >> >> Paolo
Re: mod_perl Developer's Cookbook
On 27 Feb 2003 at 11:35, Gazi, Nasser (London) wrote: > A question about "mod_perl Developer's Cookbook" by Young, Lindner and > Kobes: > > Is this book still relevant and worth buying for mod_perl2 ? (I'm about to > dive into web development using Apache/mod_perl and intend to go straight to > mp2). > > Thanks, > NG The underlying principles remain the same. And I happen to know that Geoff Young is writing some articles (for perl.com?) that highlight the differences between the two systems using examples from the Cookbook. -Chris
How do I convert HTML to PDF
Hi All, I want to take an Invoice that exists as an html doc and convert it to a PDF file to attach to an email. I have been looking at DocSet but this seems better suited for large documents. Any help? Thanks, Chris
Re: Browser doesn't stop loading a page
Martin Moss wrote: Not much to go on I know, but has anybody ever had this problem? When I load one of my webpages the browser never stops loading, e.g. the page loads ok and I can see and interact with it, but the ie spinning globe still keeps spinning and the status bar at the bottom of the page still shows the page is loading something.. The process does seem to run and exit normally in my logs. I'm at a loss as to what is causing it. This only happens on one specific page on my server. Any ideas would be appreciated. IME this means you have an external resource (e.g., image, script, etc.) in the page that's not being loaded because the site is inaccessible or it's overloaded. Generally nothing to do with mod_perl :-) Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
RE: mod_perl 2 apache::session and "or die"
Thanks Perrin, Yes I am using Apache::Registry and you were right, it was just a scoping problem - I can't believe I didn't see it before. Everything is finally working as it should!!! -Chris >> -Original Message- >> From: Perrin Harkins [mailto:[EMAIL PROTECTED] >> Sent: Friday, February 21, 2003 12:02 PM >> To: Chris Faust >> Cc: Modperl >> Subject: Re: mod_perl 2 apache::session and "or die" >> >> >> Chris Faust wrote: >> > I think it is in the locking as if I let things hang long >> enough and then >> > shut down Apache, I get a error of: >> > >> > Can't call method "disconnect" on an undefined value at >> > /usr/lib/perl5/site_perl/5.6.1/Apache/Session/Lock/MySQL.pm >> line 89 during >> > global destruction. >> >> That's a good sign. It is trying to cleanly disconnect from the >> database when you shut down the server. >> >> I think my initial guess was wrong. This is probably just a scoping >> problem in your code. I suspect you are either putting the session >> object in a global or using it in a closure. Try to reduce the section >> of code that uses Apache::Session to a very small example that >> reproduces this problem and post it here. Also, are you using >> Apache::Registry? >> >> - Perrin
RE: mod_perl 2 apache::session and "or die"
Thanks Perrin, I've been trying to use Apache::DB to track down the problem, but I'm not having a lot of luck. I think it is in the locking as if I let things hang long enough and then shut down Apache, I get a error of: Can't call method "disconnect" on an undefined value at /usr/lib/perl5/site_perl/5.6.1/Apache/Session/Lock/MySQL.pm line 89 during global destruction. Which is Apache::Session::Lock:MySQL I'm still no closer as to figuring out why though. -Chris >> -Original Message- >> From: Perrin Harkins [mailto:[EMAIL PROTECTED]] >> Sent: Wednesday, February 19, 2003 11:55 AM >> To: Chris Faust >> Cc: Modperl >> Subject: Re: mod_perl 2 apache::session and "or die" >> >> >> Chris Faust wrote: >> > All works well except when there is any kind of problem in the >> script where >> > the condition will die.. >> [...] >> > When this happens everything to do with that script is >> unresponsive - I know >> > that is a little vague but that is the best way I can describe it. What >> > happens is the error comes up (standard server error) and that >> is the last >> > thing that is logged, if you try to go back and refresh the >> hourglass will >> > go for hours and nothing happens and nothing is ever logged >> >> It sounds like a locking problem to me. I'm guessing that mod_perl 2 is >> not calling the right hooks when it traps a die() to trigger the DESTROY >> method in Apache::Session which releases all locks. You can find out >> exactly what's going on if you run it in the debugger (Apache::DB) or >> throw some debug logging into Apache::Session to find out where it gets >> stuck. This is the beauty of having the source code. >> >> - Perrin >>
mod_perl 2 apache::session and "or die"
I'm having a problem since installing Apache::Session All works well except when there is any kind of problem in the script where the condition will die.. For example: $db->execute() or die... open yadda or die.. $db->prepare() or die... etc. When this happens everything to do with that script is unresponsive - I know that is a little vague but that is the best way I can describe it. What happens is the error comes up (standard server error) and that is the last thing that is logged, if you try to go back and refresh the hourglass will go for hours and nothing happens and nothing is ever logged - if you close all windows and try again then the same thing just happens, it goes forever and nothing happens or is logged. It doesn't seem to matter where the die is, if I'm using another module (for example) HTML::Template and it dies on bad params because I didn't define something some temple var then that is it.. I can't get to that script again until I reload Apache. This only happens when I'm using Apache::Session::MySQL and I'm not doing anything strange with it, I grab the cookie if its there and authenticate them. There is nothing I'm doing in the session that relates to the errors so I don't understand why everything just dies as it does. This happens on my RH7.3/1.3 install and on my RH8/2.0 install. One other thing I should mention, when this happens it only kills the script in that specific location that is defined in the httpd.conf, in otherword something running in /cgi-bin1/ has died and crashed, I can't get to it or do anything with it - during this time everything running in /cgi-bin2/ is running along just fine without a issue (although what is in /cgi-bin2/ isn't using Apache::Session but it is using the same mySql DB). Any ideas? Thanks -Chris
ANNOUNCE: OpenInteract 1.56 released
A new version (1.56) of OpenInteract has been released. OpenInteract is an extensible web application server built on Apache, mod_perl, the Template Toolkit and SPOPS object persistence. This is a fairly minor upgrade. There is a fix to the INI configuration reader, documentation updates to a number of packages, a fix so that the (rare) package repository corruption shouldn't happen, and a few other enhancements and bugfixes. Source: http://prdownloads.sourceforge.net/openinteract/OpenInteract-1.56.tar.gz?download Detailed changes: http://sourceforge.net/project/shownotes.php?group_id=16810&release_id=140942 I'll release it to PAUSE when the main CPAN mirror gets over its recent difficulties. Thanks! Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
RE: Apache::DBI and mod_perl 2
>> Also remember, that you can't test modules that require mod_perl >> to run from >> the command line. You'd have the same result with mod_perl 1.0 >> Thanks, I didn't know that at all as I test all my modules that way and have never had a problem.. Of course most are not mod_perl specific. -Chris
RE: Apache::DBI and mod_perl 2
Awesome!! That must be my problem.. I searched everyplace else, but totally forgot searching the list.. Sorry about that. Thanks Again!! -Chris >> -Original Message- >> From: Nick Tonkin [mailto:[EMAIL PROTECTED]] >> Sent: Friday, February 14, 2003 10:46 AM >> To: Chris Faust >> Cc: Modperl >> Subject: RE: Apache::DBI and mod_perl 2 >> >> >> On Fri, 14 Feb 2003, Chris Faust wrote: >> >> > Maybe that is the problem? >> > >> > I'm using 0.89 which is the newest from CPAN and that shows Jun 18.. >> > Is there a later version available? >> >> You can always search the archives of this list at >> http://marc.theaimsgroup.com/?l=apache-modperl&r=1&w=2 >> >> The message you want is >> http://marc.theaimsgroup.com/?l=apache-modperl&m=104225578207460&w=2 >> >> - nick >> >> >> Nick Tonkin {|8^)> >>
RE: Apache::DBI and mod_perl 2
Maybe that is the problem? I'm using 0.89 which is the newest from CPAN and that shows Jun 18.. Is there a later version available? Thanks -Chris >> -Original Message- >> From: Nick Tonkin [mailto:[EMAIL PROTECTED]] >> Sent: Friday, February 14, 2003 10:22 AM >> To: Chris Faust >> Cc: Modperl >> Subject: Re: Apache::DBI and mod_perl 2 >> >> >> >> >> Do you have the latest Apache::DBI ? Ask made a new one a couple of weeks >> ago to run with mp2. >> >> >> On Fri, 14 Feb 2003, Chris Faust wrote: >> >> > Hi, >> > >> > My problem seems like one that would be well documented, but I >> can't find >> > anything in any of the docs and even goggle groups only had >> one message and >> > the solution didn't relate. >> > >> > Anyway, I've updated to RedHat 8.0 and Apache 2.0.44 with >> Mod_Perl 1.99.08 >> > and if I try to use Apache::DBI I receive the error of: >> > >> > Can't locate Apache/Constants.pm in @INC >> > >> > I've learned in mod_perl 2 that Apache::Constants was replaced by 3 new >> > classes (Apache::Const,APR::Const,Modperl::Const). >> > >> > But what do I do to get Apache::DBI to work? >> > Am I missing something really simple here (I hope)? >> > >> > Thanks >> > -Chris >> > >> > >> > >> >> - nick >> >> >> Nick Tonkin {|8^)> >>
RE: Apache::DBI and mod_perl 2
Hey Helmut, Yes, I'm sure its Apache::DBI - when I try to check for it directly via "perl -MModule::Name", I get the error.. Where is a copy paste from the command line. [chrisf@web1 chrisf]$ perl -MApache::DBI -e 0 Can't locate Apache/Constants.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl .) at /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache.pm line 6. BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Apache.pm line 6. Compilation failed in require at /usr/lib/perl5/site_perl/5.8.0/Apache/DBI.pm line 3. BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.0/Apache/DBI.pm line 3. Compilation failed in require. BEGIN failed--compilation aborted. [chrisf@web1 chrisf]$ I get pretty much the same thing if I try to put it into my statup.pl, scripts or httpd.conf. Thanks -Chris >> -Original Message- >> From: Dr. Helmut Zeilinger [mailto:[EMAIL PROTECTED]] >> Sent: Friday, February 14, 2003 9:26 AM >> To: Chris Faust; Modperl >> Subject: Re: Apache::DBI and mod_perl 2 >> >> >> Hi Chris, >> >> are you shure that is is the Apache::DBI, that needs the >> Apache::Constants >> or is it another module? >> For me Apache::DBI loads without problems (2.044/1.9908/5.8) >> even without >> the >> "use compat();" compatibility layer. >> >> Helmut >> >> >> --On Friday, February 14, 2003 09:00:31 -0500 Chris Faust >> <[EMAIL PROTECTED]> wrote: >> >> > Hi, >> > >> > My problem seems like one that would be well documented, but I >> can't find >> > anything in any of the docs and even goggle groups only had one message >> > and the solution didn't relate. >> > >> > Anyway, I've updated to RedHat 8.0 and Apache 2.0.44 with >> Mod_Perl 1.99.08 >> > and if I try to use Apache::DBI I receive the error of: >> > >> > Can't locate Apache/Constants.pm in @INC >> > >> > I've learned in mod_perl 2 that Apache::Constants was replaced by 3 new >> > classes (Apache::Const,APR::Const,Modperl::Const). >> > >> > But what do I do to get Apache::DBI to work? >> > Am I missing something really simple here (I hope)? >> > >> > Thanks >> > -Chris >> > >> > >> > >>
Apache::DBI and mod_perl 2
Hi, My problem seems like one that would be well documented, but I can't find anything in any of the docs and even goggle groups only had one message and the solution didn't relate. Anyway, I've updated to RedHat 8.0 and Apache 2.0.44 with Mod_Perl 1.99.08 and if I try to use Apache::DBI I receive the error of: Can't locate Apache/Constants.pm in @INC I've learned in mod_perl 2 that Apache::Constants was replaced by 3 new classes (Apache::Const,APR::Const,Modperl::Const). But what do I do to get Apache::DBI to work? Am I missing something really simple here (I hope)? Thanks -Chris
Re: The best place for mod_perl beginners to get started.
--- Geoffrey Young <[EMAIL PROTECTED]> wrote: > and don't forget about the cookbook > >http://www.modperlcookbook.org/ Speaking of that, why is it missing from http://perl.apache.org/? Chris
Memory Usage
Hi All, I've converted my site to mod_perl and everything seems great.. Sometimes it will run for days without an issue and other times the machine will die, normally because of out of memory problems. My question is, should I be doing anything to worry about memory? I mean I would think when there was only X amount of memory left then Apache would know what to do and not use everything that is left (plus some). Maybe I'm doing something else wrong, I'm not sure.. I don't have the machine local to me, but during normal traffic I've seen the memory go down at little as 5 meg and then come back on my SSH connection (normally it would flux between 5-10 meg free up to 100 meg free, there is 1 gig on the box). I know this isn't a lot of info, but I'm not positive what I should even be looking for, I believe mod_perl is all setup correctly, I'm not getting any strange errors from my scripts or in the error_log. We currently have 2 machines setup, one is RH 8 with Apache and mod_perl 2.0 and the other is RH 7.3 with Apache and mod_perl 1.3, both seem to have the same problem although the 2.0 machine seems to have the problem more often. Both at P4's with 1 gig of ram. Any help or direction would be appreciated. Thanks -Chris
[mp2.0] Input Filter virus scan (more info)
Me again, I have been asked to supply more details of what I am trying to achieve with the Input Filter. The following is an attempt to clearly define more requirements. I have an Apache/2.0.43 + mod_perl/1.99_08-dev + Perl/5.8.0 server that hosts simple static html and dynamic perl generated pages. I am unable to modify perl scripts without voiding my warranty. I therefore require a PerlInputFilterHandler to process the Apache request object and then pass it onto the default handler. The PerlInputFilterHandler is to scan the request object with an Anti Virus program (such as Sophos). If a virus is located the request should be blocked and a response displayed on the clients browser. If clean the request will be allowed to pass to the default handler. All this is to happen in the background and without the users' knowledge. I have found a module called "mod_vscan" by Kazutoshi Kubota <[EMAIL PROTECTED]> at http://www.willbe6.org/security/mod_vscan/ But this C code appears to only handle output from the server. My need is to scan incoming data. If anyone has used "mod_vscan" on incoming data or know if the "All-in-One Filter" example located at; http://perl.apache.org/docs/2.0/user/handlers/filters.html#All_in_One_Filter can do this please contact me. Chris. [EMAIL PROTECTED]
[mp2.0] Input Filter virus scan
Hi, newbie here, Can someone please tell me if the "All-in-One Filter" example located at; http://perl.apache.org/docs/2.0/user/handlers/filters.html#All_in_One_Filter can be used by a Anti Virus scan program to clear or block incoming Apache request data streams. Chris... [EMAIL PROTECTED]
[ANNOUNCE] OpenInteract 1.55 released
A new version (1.55) of OpenInteract has been released to CPAN. OpenInteract is an extensible web application server built on Apache, mod_perl, the Template Toolkit and SPOPS object persistence. This is a minor upgrade. A few packages have been updated, you can now subclass the interface generator which makes it easier to substitute your own base template, you can specify a custom temporary library directory, and some other minor changes. Source (also via CPAN): http://prdownloads.sourceforge.net/openinteract/OpenInteract-1.55.tar.gz?download Detailed changes: http://sourceforge.net/project/shownotes.php?group_id=16810&release_id=129206 Thanks! Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
FW: DumpHeader Apache Perl Mod
Config: Apache::DumpHeaders 0.94 http://search.cpan.org/author/ABH/Apache-DumpHeaders-0.94/DumpHeaders.pm OS: Mandrake Linux 9.0 Apache: Apache-AdvancedExtranetServer/1.3.26 (Mandrake Linux/5mdk) mod_perl/1.27 Server Built: Sep 6 2002 19:31:19 mod_perl is functioning correctly as I tested it with the test file that ships with mod_perl: mod_perl-testscript.pl I followed the instructions for building and installing an Apache Perl mod, issuing the command perl -e "DumpHeaders.pm;" works fine. In the "commonhttpd.conf" file, I put the commands: PerlLogHandler Apache::DumpHeaders PerlSetVar DumpHeaders_File test.txt If I didn't wrap them in the IfModule.. Apache wouldn't load correctly. There are several .conf files in this Apache version: commonhttpd.conf httpd.conf httpd-perl.conf The commonhttpd.conf gets included in the main httpd.conf file. Problem: - I don't quite understand how this mod is supposed to work. The instructions say that it should write a file that contains the dump of headers.. but I don't see a file being written anywhere. The archive that Apache::DumpHeaders was in, didn't include any examples or a demo so I really don't know how it's supposed to be used. Being a log handler, I would think that it's something that gets executed for every page (which would be fine). I hope this is the correct place for this type on inquiry. Thanks Chris
DumpHeader Apache Perl Mod
NOTE: I hope this isn't a dupe, not sure if the email address was correct. Config: Apache::DumpHeaders 0.94 http://search.cpan.org/author/ABH/Apache-DumpHeaders-0.94/DumpHeaders.pm OS: Mandrake Linux 9.0 Apache: Apache-AdvancedExtranetServer/1.3.26 (Mandrake Linux/5mdk) mod_perl/1.27 Server Built: Sep 6 2002 19:31:19 mod_perl is functioning correctly as I tested it with the test file that ships with mod_perl: mod_perl-testscript.pl I followed the instructions for building and installing an Apache Perl mod, issuing the command perl -e "DumpHeaders.pm;" works fine. In the "commonhttpd.conf" file, I put the commands: PerlLogHandler Apache::DumpHeaders PerlSetVar DumpHeaders_File test.txt If I didn't wrap them in the IfModule.. Apache wouldn't load correctly. There are several .conf files in this Apache version: commonhttpd.conf httpd.conf httpd-perl.conf The commonhttpd.conf gets included in the main httpd.conf file. Problem: - I don't quite understand how this mod is supposed to work. The instructions say that it should write a file that contains the dump of headers.. but I don't see a file being written anywhere. The archive that Apache::DumpHeaders was in, didn't include any examples or a demo so I really don't know how it's supposed to be used. Being a log handler, I would think that it's something that gets executed for every page (which would be fine). I hope this is the correct place for this type on inquiry. Thanks Chris
DumpHeader Apache Perl Mod
Config: Apache::DumpHeaders 0.94 http://search.cpan.org/author/ABH/Apache-DumpHeaders-0.94/DumpHeaders.pm OS: Mandrake Linux 9.0 Apache: Apache-AdvancedExtranetServer/1.3.26 (Mandrake Linux/5mdk) mod_perl/1.27 Server Built: Sep 6 2002 19:31:19 mod_perl is functioning correctly as I tested it with the test file that ships with mod_perl: mod_perl-testscript.pl I followed the instructions for building and installing an Apache Perl mod, issuing the command perl -e "DumpHeaders.pm;" works fine. In the "commonhttpd.conf" file, I put the commands: PerlLogHandler Apache::DumpHeaders PerlSetVar DumpHeaders_File test.txt If I didn't wrap them in the IfModule.. Apache wouldn't load correctly. There are several .conf files in this Apache version: commonhttpd.conf httpd.conf httpd-perl.conf The commonhttpd.conf gets included in the main httpd.conf file. Problem: - I don't quite understand how this mod is supposed to work. The instructions say that it should write a file that contains the dump of headers.. but I don't see a file being written anywhere. The archive that Apache::DumpHeaders was in, didn't include any examples or a demo so I really don't know how it's supposed to be used. Being a log handler, I would think that it's something that gets executed for every page (which would be fine). I hope this is the correct place for this type on inquiry. Thanks Chris
Re: [RFC] Apache::LDAP
On Sun, 2002-12-01 at 20:32, James G Smith wrote: > ( Actually, the name is chosen to `rhyme' with Apache::DBI. There > are no dependencies on Apache or mod_perl. ) > > NAME > Apache::LDAP - provides persistent LDAP connections Does this overlap with the ResourcePool series of modules? Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
Re: [Win32] perl-5.8 repository
Randy, Thanks for putting up your repository. Two things: 1) DBD-mysql seems to have a dependancy on Data::Dumper, but Data::Dumper isn't found in any of the repositories so won't install properly. 2) Do you have any plans on building mod_perl 1.27 for the Activestate 8xx series? -Chris
Re: [Win32] ActivePerl-5.8 beta released
> I asked Jan Dubois at ActiveState about this, just to verify - > the relevant excerpt of his reply follows ... Luckily I'm on both lists (or at least I got a copy of Jan Dubois reply as well). Thank you for this. >>Perhaps related to this, was this build compiled with VC++ 6? > > Yes. For various reasons, we decided to continue to build > ActivePerl with VC++ 6 SP3. I'm pretty sure that later service > packs should be compatible too as the core Perl code doesn't use > C++ anymore (the PERL_OBJECT stuff contained pointers to member > functions, which changed size in VC++ 6 SP4 and later). > > I've also (just for testing) compiled extension DLLs for > ActivePerl 633 and 802 using the free, non-optimizing VC++ 7 > compiler from the .NET Framework SDK. It worked just fine, but > it will use MSVCR70 instead of MSVCRT for the runtime library, > resulting in 2 different C runtime libraries being loaded. This > is potentially a problem with structured exception handling for > C++, but should work fine for "normal" C extension code too. > >From this and other comments, I gather having two runtime libraries is a Not-So-Good-Thing (tm) I will probably breakdown and add VC++ 6 to my collection of toys. I'm far from an adaquate C programmer. Thank you for all your work supporting us red-headed step children in the Windows world. -Chris
Re: [Win32] ActivePerl-5.8 beta released
First, I hate my mailer. I apologize for the previous totally reduntant post. >> Because of binary incompatibilities with 5.6, there's a >>separate 5.8 repository of ppm packages under >>http://www.activestate.com/ppmpackages/5.8-windows/ >> Such packages should be compatible with the perl-5.8 win32 >> binary we have under >> ftp://theoryx5.uwinnipeg.ca/pub/other/perl-5.8-win32-bin.tar.gz >> if you've been using that. If you believe this to be true, then am I right in assuming that Activestate didn't manage to build the 5.8 beta with VC++ 7? I'd heard rumors that there was an attempt to build a version of Perl using VC++ 7 because Microsoft has a free non-optimizing VC++ compiler they ship with the .NET SDK. I was very excited by this prospect. ::sigh:: -Chris
Re: [Win32] ActivePerl-5.8 beta released
> Of relevance to mod_perl-2 Win32 users, ActivePerl just released > a beta version of their perl-5.8 binary; see >http://www.activestate.com/Products/ActivePerl/ > Because of binary incompatibilities with 5.6, there's a >separate 5.8 repository of ppm packages under >http://www.activestate.com/ppmpackages/5.8-windows/ > Such packages should be compatible with the perl-5.8 win32 > binary we have under > ftp://theoryx5.uwinnipeg.ca/pub/other/perl-5.8-win32-bin.tar.gz > if you've been using that. > > Even though the ActivePerl package is beta, they've tested > it out beforehand and fixed some things compared to the > CPAN perl-5.8 sources; see > ftp://ftp.activestate.com/ActivePerl/src/5.8/ > for the diffs and for the complete sources used. > > If you're using mod_perl-2 on Win32 with perl-5.6.1 and have run > into problems (such as hanging registry scripts), you may want to > try perl-5.8. Over the next few days I'll make up a 5.8 Win32 ppm > repository with mod_perl-2 and some other common packages; I'll > post something later with the details. Unless there's a large > demand for mod_perl-1 stuff, this repository will just include > mod_perl-2 packages. > > -- > best regards, > randy kobes -Chris
RE: use http-equiv to refresh the page
> > I just wanted to mention that the meta tag as well as its http-equiv > > attribute are both official parts of the HTML standard and have been > > for quite some time. > > Yes and no. Well, I disagree with the no. I will explain it again below. > HTML 4.0 has a section on META and http-requiv. In it, it mentions that > \"Some user agents support the use of META to refresh the current page > after a specified number of seconds, with the option of replacing it by a > different URI.\" and proceeds with an example. That sounds more advisory > than part of the standard. But for the sake of argument, let\'s say it\'s part > of the standard, and check what HTML 4.01 has to say. > > HTML 4.01 also has a section on META and http-requiv. However, the only > reference to \"refresh\" is: \"Note. Some user agents support the use of > META to refresh the current page after a specified number of seconds, with > the option of replacing it by a different URI. Authors should __not__ use > this technique to forward users to different pages, as this makes the page > inaccessible to some users. Instead, automatic page forwarding should > be done using server-side redirects.\" > > I\'m guessing this is because http-equiv is designed to hold an HTTP > header, but there is no such thing as an \"Refresh\" header in HTTP. No, there is an HTTP header called Refresh, and it is standard. The meta tag and the http-equiv attribute of the meta tag are also standard. However, some people seem to be confusing HTTP and HTML here for some reason. Refresh is an HTTP standard, while the meta tag is HTML. The http-equiv attribute of the meta tag allows some HTTP headers to be specified in the HTML. While this feature offers little to mod_perl developers who can manipulate the headers themselves anyway, it was historically very helpful to developers for providing accurate HTTP headers such as Expires when they could not otherwise do this. The reason for that warning in the HTML specification is due to what the W3C likely considers a rampant abuse of the Refresh header which was not intended for redirection but only for refreshing the current resource. They are not warning against Refresh alone but rather what they consider a misuse of Refresh. The key phrase is, \"with the option of replacing it by a different URI.\" This is what is frowned upon, not the meta HTML tag nor the Refresh HTTP header. > So http-equiv=\"refresh\" is no longer standard. Of course, this is all > theoretical. In practice, too many people are not easily swayed by a > measily thing such as a standard. Right, and this was my second point in an earlier message. Support for this rogue feature is pretty widespread, though it should not be completely trusted. As one of the other posters pointed out, there are Web clients that do not support the use of a meta tag for redirection, but many (possibly most) do. It is quite common to see the use of a meta tag for redirection accompanied by instructions on the screen and a link for users that are not automatically redirected. By accomodating the users who are not automatically redirected, you can eliminate the possibility of a dead-end. Of course, I hope that mod_perl developers always choose manipulating the real HTTP headers over the use of the http-equiv attribute of the meta tag. Also, it seems possible that there might be much wider support for redirection with the real Refresh HTTP header than for the meta tag equivalent. I know of at least one attempt to test and document support for this specific use: http://www.hixie.ch/tests/evil/mixed/refresh1.http.html Perhaps the results of this test can help a developer determine whether this misuse of the Refresh header is appropriate for a certain situation. Chris
Re: use http-equiv to refresh the page
Perrin Harkins wrote: Chris Shiflett wrote: http://www.w3.org/TR/html4/struct/global.html#h-7.4.4.2 Look a little further down that page: "/*Note.* Some user agents support the use of META <http://www.w3.org/TR/html4/struct/global.html#edef-META> to refresh the current page after a specified number of seconds, with the option of replacing it by a different URI. Authors should *not* use this technique to forward users to different pages, as this makes the page inaccessible to some users. Instead, automatic page forwarding should be done using server-side redirects."/ I might be overzealous about this, but I dislike seeing HTTP-EQUIV meta tags used when actual HTTP headers are available to do the same thing. It's fine if there's a reason for it, but usually people do it because they don't realize they can just send a real header instead.. No, I actually agree with you completely on that last bit and am of the opinion that using the http-equiv attribute is a leftover habit from the early days of Web development when manipulating HTTP headers was not as convenient as it is now. I just wanted to mention that the meta tag as well as its http-equiv attribute are both official parts of the HTML standard and have been for quite some time. Netscape also introduced things like cookies and SSL, but that should in no way discredit the technology. The W3C's stance on refresh is the same for the header as well as the meta tag: they did not originally intend for it to be used to specify a *different* URL as a rudimentary method of redirection. They meant it to be used to refresh the current resource only. However, this "rogue" practice of redirection is quite common with both the header and the meta tag and is very well supported by browsers. In fact, I am not aware of any Web client that supports refresh but also limits the URL to the current resource only. It is also the only option for the "pause, then redirect" behavior the original poster desired that I can think of. Chris
Re: use http-equiv to refresh the page
> > Is using tag a \"bad\" approach? > > Yes. It\'s something that Netscape added to their browser, which others > may or may not add to their browsers. It\'s not part of any HTTP spec > and isn\'t guaranteed to work, even on totally correct web browsers. A meta tag is not something unique to Netscape nor the least bit uncommon. It is supported by all major Web browsers and has been for quite some time. While its use may be discouraged over a protocol-level redirect at times, it is appropriate for some situations and appears to be appropriate for what the original poster is trying to accomplish. As with any other HTML tag, the meta tag does not need to be part of an HTTP specification in order to be valid. Also, it is guaranteed to work on any compliant Web browser. HTML has its own specification, and the latest version describes the meta tag here: http://www.w3.org/TR/html4/struct/global.html#h-7.4.4.2 Sorry for disagreeing like this, but I am always afraid to see people being given incorrect information that might cause them difficulty. I hope this helps clarify. Chris
Re: redirection halts if a message is printed
Sumitro Chowdhury wrote: Case I ( simple redirection ): -- package redirect.pm use Apache::Const -compile => qw(HTTP_MOVED_TEMPORARILY); sub handler ( my $r = shift; $r->content_type('text/html'); $r->headers_out->{'Location'}= "http://new.location";; return HTTP_MOVED_TEMPORARILY; } 1; Result is : browser immediately loads the new page. Case II ( Print a message before redirection ) -- package redirect.pm use Apache::Const -compile => qw(HTTP_MOVED_TEMPORARILY); sub handler ( my $r = shift; $r->content_type('text/html'); print "Redirecting to new site ..."; $r->headers_out->{'Location'}= "http://new.location";; return HTTP_MOVED_TEMPORARILY; } 1; Result is : Instead of opening the new URL, the following is displayed on the browser : Redirecting to new site ... Ok The document has moved here (here is clickable). ... My question is : a)What is the reason for this behaviour ? Why does printing a message halt the redirection ? b)What needs to be done to display a message saying "Redirecting .." and then the browser to auto-display the new URL ? a. When your script outputs something (sending a message as you say), you are telling Apache that you are finished sending the HTTP headers and have begun the content part of the response. Thus, it is too late for the Location header you later want to send. This is a protocol restriction based on the construction of an HTTP message. To avoid this, you have to either send all of your HTTP headers first (my preference), or you need to buffer your output until you are finished sending your headers. b. It sounds like you are wanting the user to visit an intermediate page displaying a "Redirecting ..." message before being forwarded to a final destination. In this case, you probably want to use HTTP's Refresh header or the HTML equivalent: . Both have the same syntax: 3; url=http://example.org/ In this example, the 3 is the number of seconds you want the client to wait prior to sending the next request, which will be for the URL http://example.org/. Chris
Re: Novice - Problem with data encoding
Thats what is wierd. I don't do any escaping. I think it might be embperl doing the escaping because if I do a print of the XML doc string it has no escaping. If I put the string between [+ $content +] then it gets escaped. Thanks for your help, Chris - Original Message - From: "Antti Haapala" <[EMAIL PROTECTED]> To: "Chris Pizzo" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, November 01, 2002 6:35 AM Subject: Re: Novice - Problem with data encoding > > > I have an XML doc that I generated using XML::LibXML that needs to be > > included as a hidden form field in a form post. > > > > The problem is that the browser is encoding the XML doc. > > > > ie. > > > > http://gftd/schemas/data.dtd";> > > > > turns into: > > <?xml version="1.0" encoding="UTF-8"?> > > <DOCTYPE gtfd SYSTEM "http://gftd/schemas/data.dtd">; > > > > which blows up in the parsing. If I edit the result and swap back the < > > and " it works. How can I prevent the encoding of the XML data? > > You have probably escaped the xml snippet twice yourself - check the code > of the page from your browser. If you see the value of your hidden field > as "<?xml...", you have done double escaping. > > Just remove one of the escaping passes and it should work. > > The browser isn't supposed to do any such encoding on its own. If it does > you need to change your browser. You aren't using Netscape 4.0, are you? > > -- > Antti Haapala > >
Novice - Problem with data encoding
Hi, I have an XML doc that I generated using XML::LibXML that needs to be included as a hidden form field in a form post. Code snippet: sub getcXML { use XML::LibXML; my $resp_doc = XML::LibXML::Document->new(); my $root = $resp_doc->createElement('blah'); ... my $content = $resp_doc->toString; return $content } The html is: http://someserver.com/process_xml> The problem is that the browser is encoding the XML doc. ie. http://gftd/schemas/data.dtd";> turns into: <?xml version="1.0" encoding="UTF-8"?> <DOCTYPE gtfd SYSTEM "http://gftd/schemas/data.dtd">; which blows up in the parsing. If I edit the result and swap back the < > and " it works. How can I prevent the encoding of the XML data? Anyone point me in the right direction? Thanks, Chris
Novice - How would I add a hidden form field to a LWP::UserAgent call?
Hi, I'm trying to post data to a server that requires a hidden form field. This is what I'm doing: my $content = "info=somedata"; my $rec_len = length($content); my $send_url = new URI::URL($url); my $hdrsend = new HTTP::Headers('Content-length' => $rec_len); $hdrsend->header('Content-type' => 'text/html'); my $reqest = new HTTP::Request('POST', $send_url, $hdrs, $content); my $uasend = new LWP::UserAgent; my $resp = $uasend-> request($reqest); The response I get back is: Exception encountered.Form post has no value for key "info". Form values are: {} If I create an HTML doc with a form it finds the data. Is there something special I need to do to get a hidden form field? Thanks, Chris
Re: [newbie] How do I send a custom HTTP::Response?
OK, I am getting a request from a server and I need to respond with an XML doc. - Original Message - From: "Perrin Harkins" <[EMAIL PROTECTED]> To: "Chris Pizzo" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, October 23, 2002 12:54 PM Subject: Re: [newbie] How do I send a custom HTTP::Response? > Chris Pizzo wrote: > > The documentation tells me how to create a new response object but how do I > > reply to a request using my custom response? > > HTTP::Response? That's an LWP thing, not a mod_perl thing. Maybe > you're a little confused here? Tell us what you're trying to do. > > - Perrin > >
[newbie] How do I send a custom HTTP::Response?
The documentation tells me how to create a new response object but how do I reply to a request using my custom response? Thanks, Chris
How do I handle an XML document sent as a POST [newbie]
I'm trying to figure out how to get the XML document sent to me in a An HTTP transmission. The example I'm given is: HTTP headers: POST HTTP/1.0 Content-type: text/xml; charset="UTF-8" Content-length: 1862 Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 User-Agent: Java1.1 Host: localhost:8080 Connection: Keep-Alive . . . I have found lots of examples on how to deal with the xml once I have it but I don't understand how to get the xml document from the post? Anyone point me in the right direction? Thanks for your patience, Chris
Re: [OT] Perl vs. PHP..... but where is mod_perl?
On Fri, 2002-10-18 at 17:46, Tobyn Baugher wrote: > As someone fairly new to mod_perl could you make a suggestion of a good > alternative to Apache::Cookie? I was using it just because, like > Apache::Request, it was *there*. The pure-perl CGI::Cookie works fine. Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
subprocess_env wont change variable set with PerlSetEnv
I have a variable that is set with PerlSetEnv in my Apache config. PerlSetEnv SOMEVAR FOO On some occasions my PerlTransHandler changes this variable: $r->subprocess_env('SOMEVAR','BAR'); This used to work fine, and my PerlHandler (HTML::Embperl) would see $ENV{SOMEVAR}=='BAR' However, I have just upgraded to apache 1.3.26, mod_perl 1.27 and added mod_ssl 2.8.10, and this behaviour no longer works. $r->subprocess_env('SOMEVAR','BAR'); *only* works if SOMEVAR has not previously been defined in the server config. Otherwise it remains unchanged. Any ideas as to what is happening?? Many thanks, Chris Allen.
[ANNOUNCE] OpenInteract 1.51 released
A new version (1.51) of OpenInteract has been released to CPAN. OpenInteract is an extensible web application server built on Apache, mod_perl, the Template Toolkit and SPOPS object persistence. This version adds caching for the data generated by content handlers. This is in addition to the caching already provided by the Template Toolkit. Since this is retrofitting a feature planned for the next version into the current one, enabling caching is not a transparent change. But it's not a difficult one either :-) Source (also via CPAN): http://prdownloads.sourceforge.net/openinteract/OpenInteract-1.51.tar.gz?download Detailed changes: http://sourceforge.net/project/shownotes.php?release_id=109677 Thanks! Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
Re: mod_perl statistics on securityspace.com
> hi all... > >just FYI... mod_perl use seems to be dramatically on the rise > again. here'are the statistics for August from security space: > > perl > august: %36.83 > july: %30.79 > change: %19.64 > > PHP > august: %38.59 > july: %40.03 > change: %-3.62 > > https://secure1.securityspace.com/s_survey/data/man.200208/apachemods.html > > --Geoff Check the month before, I believe this is at least the second month in a row this trend has occured. I'm happy someone noticed. -Chris
Re: Filehandles
> Justin Luster wrote: >> The stress tool that I'm using is from Microsoft and is a free >> download. > > That isn't quite what I asked. Which version of mod_perl are you > using? > >> There is a setting in this tool called >> Concurrent Connections (threads). > > Regardless, mod_perl 1.x does not support multiple concurrent users on > Windows. It will serialize those requests. > > - Perrin I think he said mod_perl 2 in his inital post. Which I'm not sure really is all that swift with concurrant requests under threaded mpms (Win32 is limited to threaded mpms) ... least nobody seems 100% happy with the threaded mpm performance of mod_perl 2 yet (Stas? Anybody? How's it looking?) -Chris
Re: Filehandles
Didn't mean to take this off list if I had. Heh. > I'm using Perl 5.6 Unless someone with better knowledge pipes up, to the best of my knoweledge there are threading/concurrancy issues with mod_perl 2 and 5.6.1 ... I know that Randy has said in places that eventually the officiall recomdendation for Win32 Apache/mod_perl 2 will be 5.8 because it's theoretically more thread safe. I've never used either 5.8 (Activestate hasn't moved to it yet) nor mod_perl 2 (isn't finished yet, and I have a hard enough time supporting mod_perl 1) so all of this is based off hersay and rumor. -Chris > ----- Original Message - > From: "Chris" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Thursday, August 29, 2002 1:21 PM > Subject: Re: Filehandles > > >> > Thanks for responding so quickly. >> > >> > flock does work under Windows 2000 and above. >> > >> > The load tester that I'm using works fine with my script outside of >> > mod_perl. My script works inside of mod_perl with only one >> > concurrent user. When multiple concurrent users began hitting the >> > script under mod_perl, using Apache::Registry or Apache::RunPerl all >> > heck breaks loose. It seems that the file locking breaks down. >> > Another thing that is totally bizarre is that stuff is being written >> > to all kinds of files that I'm not writing to. Even my scripts >> > themselves will sometimes have text appended to the end of them. >> > Another problem is that Apache will give me an error message saying >> > that it is trying to write to memory that is locked. >> > >> >> Could this be a threading issue? Are you using 5.6.1 or 5.8 with >> mod_perl 2? I know that mod_perl 2 is far from ready for primetime >> especially under the threaded mpm's (which is what Win32 is forced to >> use). I use XP to develop for a Linux mod_perl 1 architecture so I'm >> raipdly getting out of my depth, but this sounds like the place to >> look. >> >> >> I've never heard of a Win32 specific mod_perl list ... :( >> >> -Chris -Chris
Re: Filehandles
> Thanks for responding so quickly. > > flock does work under Windows 2000 and above. > > The load tester that I'm using works fine with my script outside of > mod_perl. My script works inside of mod_perl with only one concurrent > user. When multiple concurrent users began hitting the script under > mod_perl, using Apache::Registry or Apache::RunPerl all heck breaks > loose. It seems that the file locking breaks down. Another thing that > is totally bizarre is that stuff is being written to all kinds of files > that I'm not writing to. Even my scripts themselves will sometimes have > text appended to the end of them. Another problem is that Apache will > give me an error message saying that it is trying to write to memory > that is locked. > Could this be a threading issue? Are you using 5.6.1 or 5.8 with mod_perl 2? I know that mod_perl 2 is far from ready for primetime especially under the threaded mpm's (which is what Win32 is forced to use). I use XP to develop for a Linux mod_perl 1 architecture so I'm raipdly getting out of my depth, but this sounds like the place to look. I've never heard of a Win32 specific mod_perl list ... :( -Chris
Re: Filehandles
> Personally I would suspect Windows in this case. I don't know about > XP, but Windows 95/98/ME did not have a working flock. If XP is based > on the NT code, it may not have that problem. Even so, I would try > testing that first, or maybe asking about it on Win32 perl mailing > list. XP is based on the NT Kernel, and should have a working flock. I believe In recent versions of 5.6.1 flock() is emulated on the 9x kernel as well. However this doesn't mean mod_perl supports it, but I'm pretty sure (98%?) Activestate and Win32 perl does. I've never flock-ed in my life (never had a need) but I have been tracking Perl and Apache under Win32 for quite a while so take all this with a grain of salt. -Chris
Re: large projects in mod_perl
* Calbazana, Al ([EMAIL PROTECTED]) [020828 09:04]: > I am not sure of what app server products/projects are out there now for > Perl (maybe some were mentioned earlier). The building blocks are > definitely there. I am sure someone has assembled, or is assembling, them > to serve as a turn key app server. I'd like to hear more about projects > that manage session state across a web farm, allow for remote objects, > transaction management, etc... This should be useful: http://perl.apache.org/products/app-server.html Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988
[ANNOUNCE] OpenInteract 1.50 released
A new version (1.50) of OpenInteract has been released to CPAN. OpenInteract is an extensible web application server built on Apache, mod_perl, the Template Toolkit and SPOPS object persistence. This version changes how templates are handled -- they're no longer accessible from the database. Browser-based template editing is back, however, and you can edit templates without having them overwritten with package upgrades. Documentation got a minor (but needed) overhaul. Thanks to Ben Avery for help. Source (also via CPAN): http://prdownloads.sourceforge.net/openinteract/OpenInteract-1.50.tar.gz?download Detailed changes: http://sourceforge.net/project/shownotes.php?release_id=107160 Thanks! Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
Re: Cache::Cache issues
> On Tue, 20 Aug 2002, Chris wrote: > >> my $timeout1 = $Cache->get_object('1')->get_expires_at(); >> my $timeout2 = $Cache->get_object('1')->get_expires_at(); > > ... ETOOMUCHCUTNPASTE. > Ick... My bad there. That explains one problem. Thanks. Still I get the same values for $timeout before for: $Cache->set('1', 'Yes', "5 m"); print $Cache->get_object('1')->get_expires_at(), "\n"; $Cache->get_object('1')->set_expires_at("10 m"); print $Cache->get_object('1')->get_expires_at(); Is this supposed to happen? -Chris
Cache::Cache issues
Hi, I've got a bit of an issue with Cache::Cache, and while I know it's a bit off topic my e-mail to the module maintianer has dissapeared into the nether regions of nowhere. I know that alot of people here use the module, especially since it was the cookbook and Perrin's articles that put me onto the module in the first place. I can't seem to get the time-out on Cache objects to update, I'm not sure if it's a bug in Cache::Cache or a bug in my understanding of Cache:Cache's Cache::Object (much more likely). I've written a small test script below that show's the issue I'm having. Any clue's would be helpful. package TestExpiresAt; use strict; use Cache::MemoryCache; our $Cache = Cache::MemoryCache->new({ 'namespace'=>__PACKAGE__, 'default_expires_in' => 10, }); $Cache->set('1', 'Yes', 1800); $Cache->set('2', 'no'); my $timeout1 = $Cache->get_object('1')->get_expires_at(); my $timeout2 = $Cache->get_object('1')->get_expires_at(); print "$timeout1\n"; # this should be timeout2 + 1790 print "$timeout2\n"; # but it's not even different $Cache->get_object('1')->set_expires_at("10 m"); $timeout1 = $Cache->get_object('1')->get_expires_at(); print "$timeout1\n"; # should be different again from timeout1 above print "$timeout2\n"; # and from timeout 2 1; __END__
Re: Mod_perl Application Development
On Sat, 2002-08-17 at 19:31, Jonathan Lonsdale wrote: > I'm curious to know how people approach application development with > mod_perl in situations where there could be dozens of distinct > screens/interfaces. I'm currently using the HTML::Template system. > > Here's a few approaches I thought of: > > 1. Single monolithic content handler. Could be hard to maintain. > 2. Distinct content handlers each with their own Location directive. Could > be a pain to maintain the server config. > 3. Take a small performance hit and use an Apache::Registry script for each > screen to handle the content phase. Use 'PerlSetupEnv Off', $r and Apache:: > modules and don't bother being backwardly compatible with CGI. There's a separate one that's used in OpenInteract: create a single content handler that uses some sort of lookup table to map requests to handlers. This lookup table can be maintained separately from the apache configuration and can generally be more flexible, allowing for application-level security settings, etc. Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.
OpenInteract 1.41 released
A new version (1.41) of OpenInteract has been released to CPAN. OpenInteract is an extensible web application server built on Apache, mod_perl, the Template Toolkit and SPOPS object persistence. This is a fairly minor upgrade -- a few bugfixes and refactorings, plus the ability to use a centralized repository for your custom templates so they will not get overwritten with package upgrades. As always, the other modifications in this release are listed in the 'Changes' file. Source (also via CPAN): http://prdownloads.sourceforge.net/openinteract/OpenInteract-1.41.tar.gz?download Detailed changes: http://sourceforge.net/project/shownotes.php?release_id=104968 Chris -- Chris Winters ([EMAIL PROTECTED]) Building enterprise-capable snack solutions since 1988.