Re: Website problem
...I get in the error.log the message: "Premature end of script headers". Where can I find the "misconfiguration". Have a look at the error log, the message should be something like: "Premature end of script headers: /path/to/script.cgi" This means that the named script is failing to compile. Try: % perl -wc /path/to/script.cgi This will tell Perl to try to compile the script without actually running it. The '-w' switch will turn on "warnings", which may help to point you at the problem(s). Most likely is a syntax error. For more learning, try: % perldoc perl This will tell you a bit about how to run Perl and also list many good sources of documentation. --- Rodney Broom
Re: template kit.....
On Fri, 28 Jul 2000, Paul J. Lucas wrote: On Fri, 28 Jul 2000, Denton River wrote: Its been a long time since i have done a jobb without using sessions. I would really like to have this feature included in the kit im using and i think alot of developers are with me on this one. What I don't understand is *why*. Why can't you use to independent pieces of software: one for templates and the other for sessions that work perfectly well together (or seperately)? I personally prefer smaller, more easily udnerstandable pieces to large, complex, feature-bloated software. Agreed. It seems to me that someone should write a simple package for tieing in Apache::Session (or similar) in a transparent manner, perhaps using an early handler stage of the request and leaving the session info in $r-pnotes() ?? (via an object/typglob/whatever??) That said, it's late and I'm really not in the appropriate state for making _solid_ contributions ;-) - Paul -- [EMAIL PROTECTED] | Don't go around saying the world owes you a living; http://BareMetal.com/ | the world owes you nothing; it was here first. web hosting since '95 | - Mark Twain
Re: The Template Toolkit (Re: Templating Systems)
"mgraham" [EMAIL PROTECTED] writes: Andy Wardley wrote: * The Template Toolkit is *ONLY* a template system. This is a Good Thing. It processes text (HTML, Latex, POD, etc). You can use it under Apache/mod_perl, in stand-alone CGI scripts, or in other environments entirely unrelated to HTML or the web. This is also a Good Thing. Form state-maintenance and validation is a grey area. I'd love to have a TT module that was capable of maintaining form state, and validating user input. ...and better still having an intimate relationship with an underlying database schema :-) -- Dave Hodgkinson, http://www.hodgkinson.org Editor-in-chief, The Highway Star http://www.deep-purple.com Apache, mod_perl, MySQL, Sybase hired gun for, well, hire -
Re: Feature sets [was Re: Templating System]
Ken Williams [EMAIL PROTECTED] writes: [EMAIL PROTECTED] (Frank D. Cringle) wrote: unconstructive grumble This sounds dreadfully microsoftian. Trashcan: check; Bouncing paperclip: check. Well yeah, if you choose features that nobody cares about, then nobody will care whether the package supports them. But they should care. They should choose the package that does not support irrelevant features, since (given similar quality of implementation) it will be smaller, more efficient and more reliable. Personally I think it would be really nice to have a comparison between modules, and I think its chief purpose would NOT be to indicate which systems are *better* than others, but what the intent of various modules are. It would enable someone at a glance to know whether something fills the I-am-your-entire-WWW-world niche, or is just a simple templater. That's fine. What I am objecting to is the (mis-)use of the term "Templating system". A template is a passive sheet of metal or plastic with holes in it. It does not include levers and gears and motors. -- Frank Cringle, [EMAIL PROTECTED] voice: (+49 2304) 467101; fax: 943357
Re: Templating system
But you have to recompile the Perl code, which normaly takes more time, then compiling the template to the Perl code. I don't think that this will gain very much speed. (Maybe in case of TT this is more important, because it has to first translate his own language to Perl code, while other only need to extract the Perl code) Yes, that's it. The parse from templates to Perl is the slowest part of the cycle, so we aim to only ever do it once. In a persistant server, the template is cached as a reference to an anonymous sub-routine. We also write it out to disk so that you can restart the server and then simply require() the template, rather than re-parsing it. The TT parser uses Perl regexen and an LALR state machine. It is exceptionally fast (in comparison to the big-regex-hack that Text::Metatext used) but not as fast as letting Perl require() and parse the file. I'm working on a C/YACC version of the parser (as opposed to Perl/YAPP) which should be significantly faster still. A
Re: Templating system
On Thu, 27 Jul 2000, Paul J. Lucas wrote: On Thu, 27 Jul 2000, Matt Sergeant wrote: http://www.best.com/~pjl/software/html_tree/ Aside from the GPL, it does looks nice. What's wrong with the GPL? It's open-source and free of cost. What more do you want? the ability to use and modify it freely, like you can do with Perl, Apache and FreeBSD. - ask -- ask bjoern hansen - http://www.netcetera.dk/~ask/ more than 70M impressions per day, http://valueclick.com
Re: [ANNOUNCE] Apache::Dispatch
On Fri, 28 Jul 2000, Geoffrey Young wrote: hi Matt... I can't access my normal email from home, so forgive the non-quoting of your message... :) the way I set it up, when running in DispatchMode = Safe (the default, which I didn't mention in the docs), you wouldn't be able to call /File/Find/find without explitily allowing File or File::Find in DispatchAllow. I think this addresses the namespace issue - if someone wants to open up File::Find, or whatever, that badly, they can always do it anyway, I suppose. OK, I think that covers the namespace issue - although I don't see a use for a non-safe mode! [basically the way I saw it working was you specified a namespace prefix for each Location, so you'd have DispatchPrefix MyApp, and http://server/location/Foo would call MyApp::Foo-handler, assuming that /location is the entry in Location for the above config line] But maybe we're missing eachother on this? Or you have something in mind that I don't? I'll admit, I'm far from a web security expert, and this does need to be quite secure to be a benefit to anyone... as for method restrictions, I can't remember if it was talked about - I'll have to go over the archives again. however, having to specify Foo::Bar-method for each method you want to use seems like overkill to me, almost as limiting as having to add all those location tags. Thats not what I meant. If you just force a method prefix, the same way I suggest above using a namespace prefix, and default to cmd_ or something, then its much easier to design a complex app in a class where you have web-space functions (those beginning with cmd_) and non-web space functions (i.e. private functions that implement parts of your application, where you don't want people directly calling the method). Without that, it would be trivial for someone to call new() or something, which might not be intended (and might have side effects). I suppose that setting DispatchMethod = Handler (the default) along with Safe mode would offer a good amount of protection against blunders, allowing only Foo::Bar-handler. I guess I was just trying to offer a fair amount of flexibility, but with flexibility comes the ability to kill your server. of course, a regular CGI script can do that too if you're not careful. :) Thats too restrictive - that way you have to have one class per URL - not a nice way to work. I don't really think that, in general, imposing method restrictions is necessary, for there isn't really a way to pass any arguments to the method anyway, right? don't all mod_perl handlers get the request object as the only argument (unless prototyped as $$)? Just because you can't pass arguments, doesn't mean bad stuff can happen... Imagine you write a sub clear_cache {...}, that empties some sort of cache. It doesn't take any arguments, Apache::Dispatch passes in a request object as the first param, but its ignored by the function, and the 733t h4x0r has cleared your cache. (not a terribly dangerous example, but hopefully you get the picture). -- Matt/ Fastnet Software Ltd. High Performance Web Specialists Providing mod_perl, XML, Sybase and Oracle solutions Email for training and consultancy availability. http://sergeant.org | AxKit: http://axkit.org
Re: Is there a module for getting / setting a Session-ID
jeff wrote: The mod_perl eagle book has a good section on saving state information using session ids. And it's not necessarily mod_perl based. Thanks Jeff. I've some code based on parts of the state section - speifically the ideas of URL mungling. Greg -- Jeff Saenz [EMAIL PROTECTED]
was Re: template kit..... - now session handling
Gerald Richter wrote: I sure think that this template discussion is intresting, forms autofill is one thing but another thing that i think would be neat is if the kit could do session handling, like the Apache::ASP. Can embperl or mason do this fancy stuff. Embperl can do session handling. It uses Apache::Session for storage and cares about the rest for you. You simply put the values for the user session in the hash %udat and they will be automaticly restored when the same user does the next request. Currently Embperl uses Cookies to store a session id witht in the browser. For Embperl 2.0 I plan to support also URL rewriting. I posted about a generic URL mangeler / cookie session handler a few days ago. Allthough this is not rocket science - I've writen a URI transhandler that will put the session id into pnotes, and if cookies are off will do a redirect to itself with a munged URL (www.foo.com/id_here/original_bit_here). A quick uri rewrite and bob's one of your parents sister. The only major issue is that I cannot appear to use posted values as they appear to get lost in the redirect (Clues wanted !). It appears that a few other people would want a session handler that can do this transparent and then they can use Apache::Session to do the rest. Can I recommend you write a simple, standalone module that everyone can use and not just an embperl solution - I'd be willing to help (or write it) if people send me their wants / ideas, and then flame my code when I think its ready! Greg Gerald - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 -
Re: template kit.....
Tom Brown wrote: On Fri, 28 Jul 2000, Paul J. Lucas wrote: On Fri, 28 Jul 2000, Denton River wrote: Its been a long time since i have done a jobb without using sessions. I would really like to have this feature included in the kit im using and i think alot of developers are with me on this one. What I don't understand is *why*. Why can't you use to independent pieces of software: one for templates and the other for sessions that work perfectly well together (or seperately)? I personally prefer smaller, more easily udnerstandable pieces to large, complex, feature-bloated software. Agreed. It seems to me that someone should write a simple package for tieing in Apache::Session (or similar) in a transparent manner, perhaps using an early handler stage of the request and leaving the session info in $r-pnotes() ?? (via an object/typglob/whatever??) That said, it's late and I'm really not in the appropriate state for making _solid_ contributions ;-) As per my other posts I think that this would be handy - and as others have mention if we could make something that is generic then people use it in small projects where they mostly roll their own, or other may include it with a TT or embperl system, like Apache::Session is supported via Embperl. I've a simple / ugly module that does the above as a URI transhandler - it is basically some code from the excellent apache modules book with some extra cookie checking. Mine also checks the cookie to see if is valid (i.e DB lookup) It: Checks the URI to see if session management is "on" - returns declined if not. Either puts the cookie value of a cookie called session into pnotes, and sets pnotes cookie_on to true. Or does a rewrite to check cookies - with a new session id.(this bits still being tested!) If this fails it looks for a session id in the URL (www.foo.com/session_id/everything else) - like the example in the apache modules book. - if a session is found it places this in pnotes, and sets pnotes cookie_on to false. If no session id in the URL it then makes one and does a redirect to that. If any sees any major issue with this then please drop me a line - I can see so far: 1. Does a lot of redirects if cookies are off first time round. 2. Session ID may get sent with the URL in a HTTP_REFERER by a browser - if you have links off your site. 3. Posted values get lost in the redirect - this is probably solvable. 4. I have added code to get the args and redirect those as well - so get request do not lose their args. If people want to send me wish lists I'll see if I can include them and then write some docs (so far its in the tradition of real programmers don't document - I'm hoping to be a real programmer ;-) and post it back here. Greg - Paul -- [EMAIL PROTECTED] | Don't go around saying the world owes you a living; http://BareMetal.com/ | the world owes you nothing; it was here first. web hosting since '95 | - Mark Twain
RE: was Re: template kit..... - now session handling
Hi Greg, Can I recommend you write a simple, standalone module that everyone can use and not just an embperl solution - I'd be willing to help (or write it) if people send me their wants / ideas, and then flame my code when I think its ready! I would be happy if there is an standalone module that handles uri translation and cookie checking and so on. I always like more to use existing solution, then reinventing the wheel (that's one reason why I use Apache::Session in Embperl). Embperl has some special needs, because it makes the session handling totaly transparent to the programmer (he has just to put his values in a hash), but if you create such a module (or extent the already existing one), I would be happy to take a look at it and make it work with Embperl. Gerald P.S. Could you resend me your module, because I have missed it on the list - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 -
RE: Templating system
The TT parser uses Perl regexen and an LALR state machine. Embperl's parser have used from the startup only C code, maybe that's the reason why the time this takes (compared to the rest of the request) never was an issue for me... Gerald - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 -
Re: was Re: template kit..... - now session handling
Gerald Richter wrote: Hi Greg, Can I recommend you write a simple, standalone module that everyone can use and not just an embperl solution - I'd be willing to help (or write it) if people send me their wants / ideas, and then flame my code when I think its ready! I would be happy if there is an standalone module that handles uri translation and cookie checking and so on. I always like more to use existing solution, then reinventing the wheel (that's one reason why I use Apache::Session in Embperl). As far as I am aware (please someone prove me wrong!) the does not appear to be such a module. Embperl has some special needs, because it makes the session handling totaly transparent to the programmer (he has just to put his values in a hash), but if you create such a module (or extent the already existing one), I would be happy to take a look at it and make it work with Embperl. I would be more than happy to rewrite what I have based on what you / others want. My module needs alot of tydying to be anything like the standard of the code found here, mine also includes session checking code (DB lookups). Can you and any others please post ideas of what you/they want ? Some people have already done such a module so if they can chirp up with thier wish lists then that would be great. So far I have something that: a) Checks the URI (simple regex) to see if its a URI that needs "Sessioning" b) Checks for cookies first c) puts data into pnotes (name anyone ? (I used UID, SID and COOKIES_ON)) or we could use sub env variables d) then checks for a session id in a URI. e) redirects to session id uri if non present. Gerald P.S. Could you resend me your module, because I have missed it on the list You did not miss anything I never sent anything - too embarassed! Please send me ideas / thoughs and I'll have a go. Greg - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 -
RE: was Re: template kit..... - now session handling
Hi Greg, As far as I am aware (please someone prove me wrong!) the does not appear to be such a module. I meant the module your are about to write :-) Please send me ideas / thoughs and I'll have a go. Embperl currently goes the way that it sets up a tied hash at load time (so it only has to be done once) and monitor wherever somebody is writing to this hash. Only in the case that a element of the hash is modified, Embperl generates a session id (actually Apache::Session does it) and sends the cookie to the browser. Therefore I don't have to configure anything to use session management (of course you can configure several parameteress, like cookie domain etc.), because if the page stores some data in the hash, session management is enabled in all other cases it isn't used. That make session management as transparanet as possible for the programmer. When a new request starts, Embperl checks if there is a session id send in a cookie from the browser and tells Apache::Session to restore the data in the session hash. This shema may not work, with session id in the url, because you need to do the redirect before the page is executed. Because Embperl anyways parses the page, it would be no overhead to rewrite all hrefs (and other urls) on the fly. I have not thought very much about, what is the best way to go here. This should give you a short impression what Embperl does, now we have to think about how we can bring this together with a general module. Gerald - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 -
Re: Is there a module for getting / setting a Session-ID
I have fully implemented URL munging and Cookie support, but SERIOUS troubles start to arise when you start adding the notion of secure sessions. I have done it, but it isn't pretty. Basically, there are three types of pages. Normal, Secure, and Secure (but you don't need a Secure Url Munging). And, on top of that, I have emilinated session hijacking (with a Back Button Breaking method). It was a hassle, but I liked the idea that my site supported Cookies and URL Munging, and also made it more secure than the major etailers. Unfortunately (?) my design is very tucked away inside my overall site, and my copious spare time allotment hasn't come in this summer.
Re: was Re: template kit..... - now session handling
Today, Greg Cope [EMAIL PROTECTED] frothed and...: one of your parents sister. The only major issue is that I cannot appear to use posted values as they appear to get lost in the redirect (Clues wanted !). Redirecting a POST request? Yup, expediency often requires violating the HTTP spec. Though your requests are probably hanging cause they want to read STDIN again, this should probably get patched -- haven't looked at the mod_perl source voodoo on this issue (Doug?). Meantime, see if this remedies: $r-method('GET'); $r-headers_in-unset('Content-length'); $r-header_out(Location = 'http://.bletch.com'); -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen [EMAIL PROTECTED] / AIM: iankallen / Fax: (415) 354-3326
Apache::PerlVINC makes Apache segfault
Hi all, (debian potato) apache-ssl : 1.3.9.13-2 modperl : 1.21.2309-1 perl : 5.005 Apache::PerlVINC : 0.01 compiled by myself As recommended in the guide, i'm trying to use Apache::PerlVINC since I have 3 virtualhosts, and the same sets of modules for all three (same namespace), in three separate directories (one production, two developpments). So I have in httpd.conf PerlModule Apache::PerlVINC PerlINC /opt/anciens/membres PerlVersionINC On PerlFixupHandler Apache::PerlVINC But as soon as I put these 4 lines, apache doesn't run anymore. An strace at start-up shows at the end : stat("/usr/local/lib/site_perl/i386-linux/auto/Apache/PerlVINC/DESTROY.al", 0xb93c) = -1 ENOENT (No such file or directory) open("/opt/anciens/membres/auto/Apache/PerlVINC/DESTROY.al", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/perl5/5.005/i386-linux/auto/Apache/PerlVINC/DESTROY.al", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/perl5/5.005/auto/Apache/PerlVINC/DESTROY.al", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/local/lib/site_perl/i386-linux/auto/Apache/PerlVINC/DESTROY.al", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/local/lib/site_perl/auto/Apache/PerlVINC/DESTROY.al", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/perl5/auto/Apache/PerlVINC/DESTROY.al", O_RDONLY) = -1 ENOENT (No such file or directory) open("./auto/Apache/PerlVINC/DESTROY.al", O_RDONLY) = -1 ENOENT (No such file or directory) open("/etc/apache-ssl//auto/Apache/PerlVINC/DESTROY.al", O_RDONLY) = -1 ENOENT (No such file or directory) open("/etc/apache-ssl/lib/perl/auto/Apache/PerlVINC/DESTROY.al", O_RDONLY) = -1 ENOENT (No such file or directory) rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 munmap(0x403c4000, 22832) = 0 munmap(0x403ca000, 57308) = 0 munmap(0x403d8000, 27572) = 0 munmap(0x403df000, 9864)= 0 munmap(0x403e4000, 55824) = 0 munmap(0x403f2000, 9064)= 0 --- SIGSEGV (Erreur de segmentation) --- +++ killed by SIGSEGV +++ It seems not to be happy not to found DESTROY.al, but after that i'm lost. What am I doing wrong ? How can I correct ? Is there another possibility to achieve the same goal ? (besides running different copies of Apache binded on different ports) If that's make a difference i'm also using Apache::StatINC Thanks in advance for your time and your answers. PS: modperl just rocks, kudos to everyone ! -- Patrick. Because if life has a meaning, we should already know it.
Re: was Re: template kit..... - now session handling
Gerald Richter wrote: Hi Greg, As far as I am aware (please someone prove me wrong!) the does not appear to be such a module. I meant the module your are about to write :-) Please send me ideas / thoughs and I'll have a go. Embperl currently goes the way that it sets up a tied hash at load time (so it only has to be done once) and monitor wherever somebody is writing to this hash. Only in the case that a element of the hash is modified, Embperl generates a session id (actually Apache::Session does it) and sends the cookie to the browser. Therefore I don't have to configure anything to use session management (of course you can configure several parameteress, like cookie domain etc.), because if the page stores some data in the hash, session management is enabled in all other cases it isn't used. That make session management as transparanet as possible for the programmer. When a new request starts, Embperl checks if there is a session id send in a cookie So therefore would it not be easy to modify your code to check for a pnotes entry called session and cookies ? If session is set then use that. If cookie is set (ie 1) then assume cookies are on! else if you have a session and cookies are off then rewrite your urls to include the session ID ? from the browser and tells Apache::Session to restore the data in the session hash. This shema may not work, with session id in the url, because you need to do the redirect before the page is executed. Because Embperl anyways parses the page, it would be no overhead to rewrite all hrefs (and other urls) on the fly. I have not thought very much about, what is the best way to go here. Ok - remeber that the URI transhandler stage is before nearly all the others - hence a redirect should work. If the session ID is in the uri I rewrite the uri to exclude it thus: www.foo.com/123234345356/index.pl would get rewritten to: www.foo.com/index.pl and 123234345356 would get put into a pnotes entry called session and cookie_on would be set to O! If the redirect needs to happen then the emb perl page would never be executed until after the redirect as the embperl handler is after the transhandler stage - or have I got emb perl completely wrong ? This should give you a short impression what Embperl does, now we have to think about how we can bring this together with a general module. Unless you can see nothing wrong with the above I should be able to put something basic together over the next few days ... documentation may be a bit lacking mind ... Is the pnotes issue OK ? or should we use an Environment Variable to transfere the data between handlers ? What other issue do you have ? Greg Gerald - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 -
How to use warnings in Apache::ASP?
Is there a way to make it so that all Apache::ASP scripts on my site have "use warnings;" on by default (something analogous to PerlSetVar Strict 1 and use strict;)? Or do I just have to put "use warnings;" in every file? I searched the nodeworks.com/asp site (keyword warning/warnings) as well as the modperl mailing list archive (keyword "warning ASP" and "warnings ASP") but could not find anything. -Philip Mak ([EMAIL PROTECTED])
Apache::Session : DBI-Too many connections
Hi , I am using Perl 5.6.0 whith MySql 3.22.32 , Apache 1.3.12 , modperl 1.24 . On our Production Server , Apache error logs are showing sometimes : [Thu Jun 8 14:53:34 2000] [error] DBI-connect failed: Too many connections at /usr/local/lib/perl5/site_perl/5.6.0/Apache/Session/ DBIStore.pm line 117 (in cleanup) DBI-connect failed: Too many connections at /usr/local/lib/perl5/site_perl/5.6.0/Apache/Session/DBIStore.pm li ne 117 Does Anybody knows how solve this ? THanks, Fred __ Sur WebMailS.com, mon adresse de courrier électronique gratuite. Service multilingue, sûr, et permanent. http://www.webmails.com/
Apache::ASP, Session Management and the Fun
Hello, I am having a lot of fun with Apache::ASP and the session management with it and I really recommend any body who hasn't used it to try it, Just for FUN. I have a question here, has any body stored sessions in mysql with Apache::ASP. what is the pros and cons of doing that and How . Any Examples?? Regards Issam
Re: Templating system
On Sat, 29 Jul 2000, Leslie Mikesell wrote: According to Gerald Richter: The TT parser uses Perl regexen and an LALR state machine. Embperl's parser have used from the startup only C code, maybe that's the reason why the time this takes (compared to the rest of the request) never was an issue for me... Is there any way for Embperl to get access to other apache modules (like the C++ versions of the xerces xml parser or xalan xslt processor)? It would be nice to be able to reuse the same code in or out of embperl. Only by writing XS (or swig) code. Please feel free to do so :-) -- Matt/ Fastnet Software Ltd. High Performance Web Specialists Providing mod_perl, XML, Sybase and Oracle solutions Email for training and consultancy availability. http://sergeant.org | AxKit: http://axkit.org
general question regarding sessions
I came to a web application development(modperl) in a middle way. The existing session management is basically save pairs of info(user:xxx...) into a /tmp file named clientip-random#-random#-timestamp, and use a similar format cookie to find corresponding session in /tmp to do authentication. meanwhile some new pair of info could be appended to session file to speed up same request or record the last request. I know this is *obviously* dumb and Apache::Session can handle all this. But sometimes you know, things are obvious but you just can't convience others easily... the existing method works and how can I make a strong argument that other ways are much better? Thanks, Jeff
Re: template kit.....
Ofcourse i can use different pieces of software,, But that was not my point I *want* to have the session management in the same kit becouse it´s convinient. I have to tell my team what software to use and maby even teach them how to use it, I find it alot easier to do this with one kit. Best regards Denton River --- "Paul J. Lucas" [EMAIL PROTECTED] wrote: On Fri, 28 Jul 2000, Denton River wrote: Its been a long time since i have done a jobb without using sessions. I would really like to have this feature included in the kit im using and i think alot of developers are with me on this one. What I don't understand is *why*. Why can't you use to independent pieces of software: one for templates and the other for sessions that work perfectly well together (or seperately)? I personally prefer smaller, more easily udnerstandable pieces to large, complex, feature-bloated software. - Paul __ Do You Yahoo!? Kick off your party with Yahoo! Invites. http://invites.yahoo.com/
Overriding print in cgi scripts
Hello, We have a large code base printing header, body and footers to the STDOUT from the cgi scripts. Since all these are print statements, we have to go to extreme measures to make sure we donot print the content more than once. To clean things up (or at least start at it), we want to be able to trap the output of print to a local buffer and then selectively flush or junk based on the logic (for eg, if we decide to redirect at the end of the script, then we want to junk the buffer). I am looking for a quick solution which would allow me to override the CORE::print function and simply write to a buffer (a perl scalar). Once I am done with the processing, I can write out the buffer or junk it. Is it possible to do this? What should I be careful of? THanks, Chetan
require bug?
I noticed that the following bit of code does not work properly: require 'test.pl'; chdir '..'; require 'test.pl'; Even though the second require is trying to load a different file, perl thinks that it is the same file and therefore doesn't require it again (I had to use the 'do' command instead). Is this a bug, or is it supposed to work like that? -Philip Mak ([EMAIL PROTECTED])
Re: How to use warnings in Apache::ASP?
Philip Mak wrote: Is there a way to make it so that all Apache::ASP scripts on my site have "use warnings;" on by default (something analogous to PerlSetVar Strict 1 and use strict;)? Or do I just have to put "use warnings;" in every file? I searched the nodeworks.com/asp site (keyword warning/warnings) as well as the modperl mailing list archive (keyword "warning ASP" and "warnings ASP") but could not find anything. What does it do? Never heard of it, same as -w? Does putting it into your global.asa do the trick? Its the same namespace as all of your scripts unless you use UniquePackages setting. I'm thinking about a Script_OnCompile or Script_OnParse event, maybe you could add it to all of your perl at that time? -- Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Apache::Session : DBI-Too many connections
Mysql accepts a maximum of 100 connections. This probably means you have MaxClients set at a number larger than this. If you are serving all of your files, including static html and graphics, through one mod_perl enabled apache, run the top command and prepare to pick your jaw off the floor. mod_perl processes are huge and you probably don't need to be running 150 of them. Read http://perl.apache.org/guide/strategy.html and http://perl.apache.org/guide/performance.html if you haven't already. Otherwise it may be that you have things other than mod_perl connecting to MySql in which case you just need to increase its max_connections parameter to a bigger number. - Original Message - From: Frédéric Schwien To: [EMAIL PROTECTED] Sent: Saturday, July 29, 2000 10:31 AM Subject: Apache::Session : DBI-Too many connections Hi , I am using Perl 5.6.0 whith MySql 3.22.32 , Apache 1.3.12 , modperl 1.24 . On our Production Server , Apache error logs are showing sometimes : [Thu Jun 8 14:53:34 2000] [error] DBI-connect failed: Too many connections at /usr/local/lib/perl5/site_perl/5.6.0/Apache/Session/ DBIStore.pm line 117 (in cleanup) DBI-connect failed: Too many connections at /usr/local/lib/perl5/site_perl/5.6.0/Apache/Session/DBIStore.pm li ne 117 Does Anybody knows how solve this ? THanks, Fred __ Sur WebMailS.com, mon adresse de courrier électronique gratuite. Service multilingue, sûr, et permanent. http://www.webmails.com/
Re: was Re: template kit..... - now session handling
Greg Gerald, I wanted to bring an important issue that came up with Apache::ASP, how will you deal with search engines indexing the session-ids in the URL? In Apache::ASP, this is handled a couple of ways, first the session-id is stored as a query string param, not in the path to give a hint at its dynamic nature for smarter search engines that respect this, but more important, there is detection that if the incoming session is not active, a new session id will be assigned to the end user. This will prevent users that come from a search engine to all have the same session id. I don't know how this latter might be dealt with in this case except by perhaps some runtime checking with Apache::Session for existence, and then a redirect at that time to a new URL with the right session-id? The Apache::ASP query string SessionQueryParse implementation makes changing the id without redirection possible, but at the expense of runtime buffer URL parsing for those without cookies. Also note that a developer should be made aware of the security implications associated with off site HTTP_REFERER logging of one's session id, so that a developer can work around this accordingly. In Apache::ASP, I just am careful to warn about this issue in the docs and give a appropriate workaround: http://www.nodeworks.com/asp/sessions.html Its a nice feature to get right when its finally working. Enjoy! --Joshua Greg Cope wrote: Gerald Richter wrote: Hi Greg, As far as I am aware (please someone prove me wrong!) the does not appear to be such a module. I meant the module your are about to write :-) Please send me ideas / thoughs and I'll have a go. Embperl currently goes the way that it sets up a tied hash at load time (so it only has to be done once) and monitor wherever somebody is writing to this hash. Only in the case that a element of the hash is modified, Embperl generates a session id (actually Apache::Session does it) and sends the cookie to the browser. Therefore I don't have to configure anything to use session management (of course you can configure several parameteress, like cookie domain etc.), because if the page stores some data in the hash, session management is enabled in all other cases it isn't used. That make session management as transparanet as possible for the programmer. When a new request starts, Embperl checks if there is a session id send in a cookie So therefore would it not be easy to modify your code to check for a pnotes entry called session and cookies ? If session is set then use that. If cookie is set (ie 1) then assume cookies are on! else if you have a session and cookies are off then rewrite your urls to include the session ID ? from the browser and tells Apache::Session to restore the data in the session hash. This shema may not work, with session id in the url, because you need to do the redirect before the page is executed. Because Embperl anyways parses the page, it would be no overhead to rewrite all hrefs (and other urls) on the fly. I have not thought very much about, what is the best way to go here. Ok - remeber that the URI transhandler stage is before nearly all the others - hence a redirect should work. If the session ID is in the uri I rewrite the uri to exclude it thus: www.foo.com/123234345356/index.pl would get rewritten to: www.foo.com/index.pl and 123234345356 would get put into a pnotes entry called session and cookie_on would be set to O! If the redirect needs to happen then the emb perl page would never be executed until after the redirect as the embperl handler is after the transhandler stage - or have I got emb perl completely wrong ? This should give you a short impression what Embperl does, now we have to think about how we can bring this together with a general module. Unless you can see nothing wrong with the above I should be able to put something basic together over the next few days ... documentation may be a bit lacking mind ... Is the pnotes issue OK ? or should we use an Environment Variable to transfere the data between handlers ? What other issue do you have ? Greg Gerald - Gerald Richterecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151 WWW:http://www.ecos.de Fax: +49 6133 925152 -
Re: Feature sets [was Re: Templating System]
On Fri, 28 Jul 2000, Drew Taylor wrote: After all this discussion, what would benefit me most in choosing my next template system would be a concise central repository of the features benefits for the major template systems (TT, Apache::ASP, Embperl, Mason, HTML::Template come to mind first). I've been planning to do that, but I'm too busy to work on it right now. Maybe I can add some things to what you come up with. - Perrin
Re: Templating system
On Fri, 28 Jul 2000, Drew Taylor wrote: Andy Wardley wrote: And the REALLY, REALLY smart ones (i.e. TT2) can write the Perl code to disk for persistance of compiled templates. That way, the templates never need to be re-compiled (i.e. from TT syntax to Perl code) unless you change them. They can simply be loaded via Perl's require(). What about having a shared memory cache ala HTML::Template? A disk cache is great, but I have RAM to spare at the moment. Any plans for a shared in-memory cache? (Someone had pointed out that TT does have in memory caching, but it is only per-process.) You can't actually share the compiled subs (except through copy-on-write by loading them in startup.pl), and sharing the generated perl code in memory rather than on disk is probably not that worth the extra work (or memory). The key here is that the loading of the perl code from disk into memory is only done once per process, so the value in optimizing this step is very small. - Perrin
Re: The Template Toolkit (Re: Templating Systems)
Dmitry Beransky wrote: At 09:58 AM 7/24/00, mgraham wrote: For instance, I would like a backend web application to be able to learn about form fields from the template tags: [% input type='text' name='email' required=1 validate_as='email_address' %] That's where the XForm may come quite handy (http://www.w3.org/MarkUp/Forms/). The specification is still been worked on, but it has some parts that can already be used on the back end. I can see it (me thinks) fit quite nicely into Apache::ASP XML processor. I thought about coding it up, but never got the time. If you could tell me more about this sometime, like where you are going with this, and how this might be brought into the server to ease developer use that would be great. Its still takes a bit to get my head around XML ways of looking at things. What I do see from second glance that there is at least the possibility for a XSLT stylesheet to be developed that would take care of an XML form consisting of both the xform data and the regular form for processing. But still it seems that there might be some part of the XML form generation that could be handled by the server. Perhaps what would facilitate this model would be to render the $Request-Form() data into the XML somewhere so that XSLT processor could then pick it up? Does this standard cover the way in which the developer might then work with the data on the server? I'm wondering if in ASP the developer would still use $Request-Form() for final data storage with whatever database backend or XML that needs interfacing with. I didn't quite get in the example of how the XML file might get updated. -- Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: How to use warnings in Apache::ASP?
Philip Mak wrote: I just tried doing the global.asa thing, but I realized another problem. Recently, I installed a new version of perl on my system (upgraded 5.00503 to 5.6). Something went wrong though; Apache::ASP is still using the old version of perl. If I run /usr/bin/perl, /usr/local/bin/perl, or a CGI script, the $] (version) variable evaluates to 5.6. But inside ASP scripts, the version is 5.00503 (use warnings doesn't work in 5.00503). This is because Apache::ASP uses that same perl that mod_perl does. Just recompile your mod_perl with your new perl, and the problem will go away! Would you happen to know how to find out the pathname of the perl executable that Apache::ASP is using? I found a file called /usr/bin/perl5.00503, but relinking that to perl 5.6 had no effect. I would imagine that looking at @INC would give you a hit as to which perl you are using since the perl lib directories tend to have build numbers locations that are related. Also, does ASP have a directive for turning on -w? No. Enjoy the upgrade! -- Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
RE: The Template Toolkit (Re: Templating Systems)
XForm sounds just like something I need actually, can any of the XSLT tools transform it? In perl, of course, XML::XSLT, Sablotron (which doesn't compile on FreeBSD btw, feh!)? Yesterday, Dmitry Beransky [EMAIL PROTECTED] frothed and gesticulated...: That's where the XForm may come quite handy (http://www.w3.org/MarkUp/Forms/). The specification is still been worked on, but it has some parts that can already be used on the back end. I can see it (me thinks) fit quite nicely into Apache::ASP XML processor. I thought about coding it up, but never got the time. -- Salon Internet http://www.salon.com/ Manager, Software and Systems "Livin' La Vida Unix!" Ian Kallen [EMAIL PROTECTED] / AIM: iankallen / Fax: (415) 354-3326