Re: Feature sets [was Re: Templating System]
On 3 Aug 2000, (Randal L. Schwartz) wrote: "Drew" == Drew Taylor [EMAIL PROTECTED] writes: Drew I suppose I could... I was planning on having a nice checklist of Drew features/systems that would be a pain to do in a fixed width font. An Drew HTML table would make my life MUCH easier there. Is there something in Drew POD that makes tables easier? Why don't you write it as XML, then use Template::Toolkit and the DOM interface to generate what you want. Or XML::Simple with TT... Anyway, I've got a Pod::DocBookXML here somewhere if you want it. That would allow all authoring in POD, with =for docbook sections doing the tables. (of course you could do that with HTML too). -- 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: Feature sets [was Re: Templating System]
On Thu, 3 Aug 2000, Gunther Birznieks wrote: At 05:10 PM 8/3/00 -0700, Perrin Harkins wrote: On Thu, 3 Aug 2000, Drew Taylor wrote: Having recently discovered the joy of CVS, I look forward to it. Awfully nice to able to roll back to a previous version - although (knock on wood!) I haven't had to use it yet. I can help if you get stuck. One book I would highly recommend on CVS is Open Source Development with CVS by Karl Franz Fogel. I found it to be not only highly informative but an incredibly fun read as well. Each of the semi-dry CVS chapters is followed up by a fun anecdotal chapter about open source development processes and how and why they work (esp focusing if possible on how CVS helps that process). I've also found it to be a better "advanced" reference than any of the CVS documentation I have. Somehow it just "feels" indexed better. I own no stock in Coriolis Books by the way. :) And its available free online: http://cvsbook.red-bean.com/ -- 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
[Apache::ASP] .htaccess permission denied in examples
I've tried installing Apache:ASP on my personal web server, but I can't get any of the ASP files to work. Also, I can't seem to view the .htaccess file from the eg directory that came with the installation. I'm running Apache 1.3.12, mod_perl 1.24, and apache::asp 2.01. I think the reason the asp files won't work has something to do with the permissions on the .htaccess file. Can anyone help me? I feel so silly having to ask something that seems so easy. I get this error on clicking the .htaccess link on the example page. ___ Forbidden You don't have permission to access /asp/eg/.htaccess on this server. Apache/1.3.12 Server at kk208.ocsstud.gu.edu.au Port 80 ___ Here's the permissions on the eg directory: ___ total 64 drwxr-xr-x2 brad brad 1024 Aug 1 20:24 . drwxr-xr-x4 brad brad 1024 Aug 1 19:54 .. -rw-r--r--1 brad brad 135 Jul 23 09:00 .asp -rw-r--r--1 brad brad 100 Jul 23 09:00 .bhtaccess -rw-r--r--1 brad brad 1760 Aug 1 20:08 .htaccess -rw-r--r--1 brad brad 344 Jul 23 09:00 DemoASP.pm -rw-r--r--1 brad brad 685 Aug 1 20:17 application.asp -rw-r--r--1 brad brad 762 Jul 23 09:00 binary_write.htm -rw-r--r--1 brad brad 1806 Jul 23 09:00 cgi.htm -rw-r--r--1 brad brad 545 Jul 23 09:00 counting.htm -rw-r--r--1 brad brad 60 Jul 23 09:00 default.htm -rw-r--r--1 brad brad 1573 Jul 23 09:00 dynamic_includes.htm -rw-r--r--1 brad brad 436 Jul 23 09:00 error_document.htm -rw-r--r--1 brad brad 1818 Jul 23 09:00 file_upload.asp -rw-r--r--1 brad brad 100 Jul 23 09:00 footer.inc -rw-r--r--1 brad brad 569 Jul 23 09:00 form.asp -rw-r--r--1 brad brad 4461 Jul 23 09:00 global.asa -rw-r--r--1 brad brad 2202 Jul 23 09:00 global_asa_demo.asp -rw-r--r--1 brad brad 3108 Jul 23 09:00 header.inc -rw-r--r--1 brad brad 418 Jul 23 09:00 include.htm -rw-r--r--1 brad brad 60 Jul 23 09:00 index.htm -rw-r--r--1 brad brad 1262 Jul 23 09:00 index.html -rw-r--r--1 brad brad 1148 Jul 23 09:00 register_cleanup.asp -rw-r--r--1 brad brad 2702 Jul 23 09:00 response.asp -rw-r--r--1 brad brad 87 Jul 23 09:00 row.inc -rw-r--r--1 brad brad 873 Jul 23 09:00 server.htm -rw-r--r--1 brad brad 782 Jul 23 09:00 server_variables.htm -rw-r--r--1 brad brad 1388 Jul 23 09:00 session.asp -rw-r--r--1 brad brad 1346 Jul 23 09:00 session_query_parse.asp -rw-r--r--1 brad brad 60 Aug 1 20:13 source.asp -rw-r--r--1 brad brad 1284 Jul 23 09:00 source.inc -rw-r--r--1 brad brad 835 Jul 23 09:00 ssi_filter.ssi -rw-r--r--1 brad brad 1199 Jul 23 09:00 syntax_error.htm -rw-r--r--1 brad brad 104 Jul 23 09:00 table.inc -rw-r--r--1 brad brad 692 Jul 23 09:00 template.xsl -rw-r--r--1 brad brad 2326 Jul 23 09:00 test.gif -rw-r--r--1 brad brad 105 Jul 23 09:00 transfer.htm -rw-r--r--1 brad brad 2832 Jul 23 09:00 xml_subs.asp -rw-r--r--1 brad brad 933 Jul 23 09:00 xslt.xml - Thanks in advance, Brad - Bachelor of Engineering in Software Engineering, Griffith University
Re: Feature sets [was Re: Templating System]
At 08:03 AM 8/4/00 +0100, Matt Sergeant wrote: On Thu, 3 Aug 2000, Gunther Birznieks wrote: At 05:10 PM 8/3/00 -0700, Perrin Harkins wrote: On Thu, 3 Aug 2000, Drew Taylor wrote: Having recently discovered the joy of CVS, I look forward to it. Awfully nice to able to roll back to a previous version - although (knock on wood!) I haven't had to use it yet. I can help if you get stuck. One book I would highly recommend on CVS is Open Source Development with CVS by Karl Franz Fogel. I found it to be not only highly informative but an incredibly fun read as well. Each of the semi-dry CVS chapters is followed up by a fun anecdotal chapter about open source development processes and how and why they work (esp focusing if possible on how CVS helps that process). I've also found it to be a better "advanced" reference than any of the CVS documentation I have. Somehow it just "feels" indexed better. I own no stock in Coriolis Books by the way. :) And its available free online: http://cvsbook.red-bean.com/ Not all chapters are free. Just the CVS related ones (the other ones kind of make the whole subject more pleasurable to read about YMMV). -- 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 __ Gunther Birznieks ([EMAIL PROTECTED]) eXtropia - The Web Technology Company http://www.extropia.com/
Re: logging out
I used Net::LDAP, a pure Perl implementation, against a Novell eDirectory LDAP server. You can find it at CPAN or at http://sourceforge.net/project/?group_id=5050 I coded the authen_cred method to authenicate against LDAP and then store the username in the session hash. The authen_ses_key method then recovers the username from the session hash. I created a custom require method to check group membership so I can include something like this in httpd.conf : require LDAPGroup cn=administrators,ou=groups,o=wl I want to extend it to check for container membership too but I don't need that just now. I could send you the code if it would be of interest. Simon Wilcox Intranet Development Manager From Drew Taylor [EMAIL PROTECTED] Date 23:18:04 3 August 2000 To: Simon Wilcox/BASE/WilliamsLea@WilliamsLea cc: [EMAIL PROTECTED] Fax to: Subject: Re: logging out [EMAIL PROTECTED] wrote: I recommend Apache::AuthCookie. This has worked really well for me, and allows me to use an HTML form which is much nicer for my users than the default dialog box. FWIW - I sub-classed AuthCookie to authenticate against an LDAP directory (using Net::LDAP) but you can use a RDBMS just as easily. I have used Apache::AuthCookie also and liked it. What module did you use to authenticate against the LDAP server? We are setting one up here for internal use and I am still trying to find the best (read easiest) way to authenticate against it. -- Drew Taylor Vialogix Communications, Inc. 501 N. College Street Charlotte, NC 28202 704 370 0550 http://www.vialogix.com/
Re: [Apache::ASP] .htaccess permission denied in examples
Make sure that your asp/eg directory is under your htdocs and that you have "AllowOverride All" configured for that directory in your *.conf files, probably a Directory setting. As long as your files are read all permissions you won't have a problem with the web server having access to the files for display. --Joshua Brad Dick wrote: I've tried installing Apache:ASP on my personal web server, but I can't get any of the ASP files to work. Also, I can't seem to view the .htaccess file from the eg directory that came with the installation. I'm running Apache 1.3.12, mod_perl 1.24, and apache::asp 2.01. I think the reason the asp files won't work has something to do with the permissions on the .htaccess file. Can anyone help me? I feel so silly having to ask something that seems so easy. I get this error on clicking the .htaccess link on the example page. ___ Forbidden You don't have permission to access /asp/eg/.htaccess on this server. Apache/1.3.12 Server at kk208.ocsstud.gu.edu.au Port 80 ___ Here's the permissions on the eg directory: ___ total 64 drwxr-xr-x2 brad brad 1024 Aug 1 20:24 . drwxr-xr-x4 brad brad 1024 Aug 1 19:54 .. -rw-r--r--1 brad brad 135 Jul 23 09:00 .asp -rw-r--r--1 brad brad 100 Jul 23 09:00 .bhtaccess -rw-r--r--1 brad brad 1760 Aug 1 20:08 .htaccess -rw-r--r--1 brad brad 344 Jul 23 09:00 DemoASP.pm -rw-r--r--1 brad brad 685 Aug 1 20:17 application.asp -rw-r--r--1 brad brad 762 Jul 23 09:00 binary_write.htm -rw-r--r--1 brad brad 1806 Jul 23 09:00 cgi.htm -rw-r--r--1 brad brad 545 Jul 23 09:00 counting.htm -rw-r--r--1 brad brad 60 Jul 23 09:00 default.htm -rw-r--r--1 brad brad 1573 Jul 23 09:00 dynamic_includes.htm -rw-r--r--1 brad brad 436 Jul 23 09:00 error_document.htm -rw-r--r--1 brad brad 1818 Jul 23 09:00 file_upload.asp -rw-r--r--1 brad brad 100 Jul 23 09:00 footer.inc -rw-r--r--1 brad brad 569 Jul 23 09:00 form.asp -rw-r--r--1 brad brad 4461 Jul 23 09:00 global.asa -rw-r--r--1 brad brad 2202 Jul 23 09:00 global_asa_demo.asp -rw-r--r--1 brad brad 3108 Jul 23 09:00 header.inc -rw-r--r--1 brad brad 418 Jul 23 09:00 include.htm -rw-r--r--1 brad brad 60 Jul 23 09:00 index.htm -rw-r--r--1 brad brad 1262 Jul 23 09:00 index.html -rw-r--r--1 brad brad 1148 Jul 23 09:00 register_cleanup.asp -rw-r--r--1 brad brad 2702 Jul 23 09:00 response.asp -rw-r--r--1 brad brad 87 Jul 23 09:00 row.inc -rw-r--r--1 brad brad 873 Jul 23 09:00 server.htm -rw-r--r--1 brad brad 782 Jul 23 09:00 server_variables.htm -rw-r--r--1 brad brad 1388 Jul 23 09:00 session.asp -rw-r--r--1 brad brad 1346 Jul 23 09:00 session_query_parse.asp -rw-r--r--1 brad brad 60 Aug 1 20:13 source.asp -rw-r--r--1 brad brad 1284 Jul 23 09:00 source.inc -rw-r--r--1 brad brad 835 Jul 23 09:00 ssi_filter.ssi -rw-r--r--1 brad brad 1199 Jul 23 09:00 syntax_error.htm -rw-r--r--1 brad brad 104 Jul 23 09:00 table.inc -rw-r--r--1 brad brad 692 Jul 23 09:00 template.xsl -rw-r--r--1 brad brad 2326 Jul 23 09:00 test.gif -rw-r--r--1 brad brad 105 Jul 23 09:00 transfer.htm -rw-r--r--1 brad brad 2832 Jul 23 09:00 xml_subs.asp -rw-r--r--1 brad brad 933 Jul 23 09:00 xslt.xml
Re: [Apache::asp] Secure execution of scripts by users
Andrew Tucker wrote: A simple (well, maybe not exactly) question: is there a way to allow normal users to run their custom ASP scripts without endangering too much system's security (such as apache suexec or php's safe mode, or even cgiwrap..)? Thanks in advance, If the CGI method of running ASP ever finally worked completely, you could try that. The cgi/asp script is the place to start with that in mind. It doesn't process POST input last I left off with it. The other way you can more safely have separate users run Apache::ASP, as with mod_perl in general, is to have per user web servers running on high ports, and have a mod_proxy front end forwarding requests back to each. This will require more RAM admin headaches to host each user, but will give them the benefits of mod_perl ASP! -- Joshua
Re: XForms ASP
Dmitry Beransky wrote: ... recognizable tokens (as in ''.'form'). Unfortunately, I cannot use XML or XSLT processing, as you recommend, because the content of the tags often is HTML. This brings me to another question. Is (would) it possible to do recursive recursive XML processing (similar to XSLT) with ASP? Here's an example: html head xform id="formID" ... /xform /head body ... asp:form id="formID" First name: asp:input id="firstName"/ Last name: asp:input id="lastName"/ /asp:form /body /html What I need to do is to process the asp:form element, transform the tag itself into appropriate html and then recursively process its content, so that I could get to the asp:input tags. If its HTML you need, you could substitute a call to HTML::Parser instead with a XMLSub asp:form to look for the input tags. You could also do this all at once at the Script_OnFlush event to parse both the xform and form at runtime. If you wanted just a XMLSubsMatch approach, you will have to work backwards, because inner tags are evaluated first as sub routines. If you need the input data when you evaluate the asp:form, then you could try using script globals to capture data for you, like in each input tag you could set something in $Inputs{$id} = $data and then reference %Inputs in your asp:form ... that's pretty backwards, and is a limitation with a pure XMLSubs approach to a problem like this. Best of luck, and I am very interested in what you end up with. -- Joshua
Re: how to check for ssl.
I've got a section of our site where I want to force the user to connect via ssl. Inside of mod_perl, is there a parameter I can grab to see whether the connection is ssl or not? Or a way to get the port number? If there isnt a special reason otherwise, why not just put a redirect in http.conf, eg VirtualHost _default_:80 . Redirect /secure https://www.mysite.com/secure /VirtualHost Then any attempts to access something under http://www.mysite.com/secure will get a redirect to same page but using https.
How to unsubscribe from this list please ?
thanks balan
Re: Feature sets [was Re: Templating System]
I hope that you write the doc is POD :) I suppose I could... I was planning on having a nice checklist of features/systems that would be a pain to do in a fixed width font. An HTML table would make my life MUCH easier there. Is there something in POD that makes tables easier? Write the text in POD, and put the checklist data in with some neutral format. Then we can use a customized pod2html converter on it to generate a pretty table. XML would be a nice way to store the raw data. This might end up being kind of big for an in-line, so we could do something like "=table data_file.xml" and keep it in a separate file. (Or is it better to use "=for html" and put the rest inside that, so that it still passes syntax checks for standard POD?) I believe XML is a way too heavy for docs writing. Why one will want to get a messy source code, when you can get away with a minimalistic POD. Just look at the Guide's source code and look at the generated PDF -- isn't it great? I love POD. And if you want more than POD provides, it takes secs to add the new functionality. Stas, do you have code available for the guide generator? That might come in handy. The guide building code was completely rewritten lately. Now it uses HTML templates (+css) to customize the look and feel, so if you want to roll your own documentation project you don't have to touch the code anymore. The html2ps translator is bundled in distribution, so there is no installation overhead, just grab the package from CPAN: cpan install mod_perl_guide If there will be enough interest, I'll release the package as a standalone in the future. As for POD, I've already extended the POD in POD2HTML (which was buggy anyway). For example, I've added new directives for embedding images, linking to files and more... I don't afraid to extend the POD since I can easily convert all my extended pod files back into the standard POD format. So if you want a syntax for tables, this should be easy to add, like: =table args =tr args =td args ... =/td =/tr =/table Drew, if this all sounds like too much trouble for the first draft and you already started in HTML, I'd say just finish that up and we'll distill it into POD later. (html2pod?) Not a good idea :) _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://perl.org http://stason.org/TULARC http://singlesheaven.com http://perlmonth.com http://sourcegarden.org
Re: How to unsubscribe from this list please ?
http://perl.apache.org/#maillists thanks balan _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://perl.org http://stason.org/TULARC http://singlesheaven.com http://perlmonth.com http://sourcegarden.org
Re: Package Lexicals and PerlModule
mgraham ([EMAIL PROTECTED]) said something to this effect: With the above I expect to be able to call the following in some handler: Foo::load_var() ...and $PACKAGE_LEXICAL should still be 'wubba'. ...Except that by calling Foo:load_var() you are setting $PACKAGE_LEXICAL to undef (by passing in an empty list via ()), rather than retrieving it. You should do something like: package Foo; { # Block scope this stuff just to ensure that no other subroutine besides # var can modify $PACKAGE_LEXICAL. my $PACKAGE_LEXICAL; sub var { return (@_) ? $PACKAGE_LEXICAL = shift : $PACKAGE_LEXICAL; } } # More of package Foo here... 1; This will set $PACKAGE_LEXICAL if you pass something in, and return it, or just return it otherwise. Each child will have its own $PACKAGE_LEXICAL. (darren) -- All things are possible, except for skiing through a revolving door.
Re: Feature sets [was Re: Templating System]
Gunther Birznieks ([EMAIL PROTECTED]) said something to this effect: One book I would highly recommend on CVS is Open Source Development with CVS by Karl Franz Fogel. I found it to be not only highly informative but an incredibly fun read as well. Each of the semi-dry CVS chapters is followed up by a fun anecdotal chapter about open source development processes and how and why they work (esp focusing if possible on how CVS helps that process). I've also found it to be a better "advanced" reference than any of the CVS documentation I have. Somehow it just "feels" indexed better. I own no stock in Coriolis Books by the way. :) Most of this book is available from http://cvsbook.red-bean.com/ (all except chapters 1,3,5, and 7), for those of you who aren't familiar is CVS. The site contains the book in HTML, Info, Texinfo, and Postscript format, and you can get the working copy vis anonymous CVS, also. (darren) -- Tell a man that there are 400 Billion stars and he'll believe you. Tell him that a bench has wet paint and he has to touch it.
Re: Feature sets [was Re: Templating System]
On Fri, 4 Aug 2000, Stas Bekman wrote: I hope that you write the doc is POD :) I suppose I could... I was planning on having a nice checklist of features/systems that would be a pain to do in a fixed width font. An HTML table would make my life MUCH easier there. Is there something in POD that makes tables easier? Write the text in POD, and put the checklist data in with some neutral format. Then we can use a customized pod2html converter on it to generate a pretty table. XML would be a nice way to store the raw data. This might end up being kind of big for an in-line, so we could do something like "=table data_file.xml" and keep it in a separate file. (Or is it better to use "=for html" and put the rest inside that, so that it still passes syntax checks for standard POD?) I believe XML is a way too heavy for docs writing. Why one will want to get a messy source code, when you can get away with a minimalistic POD. Just look at the Guide's source code and look at the generated PDF -- isn't it great? I love POD. And if you want more than POD provides, it takes secs to add the new functionality. People are migrating to XML because there are good editors coming onto the market (though sadly none for Linux yet, but I'm getting close to persuading Arbotext to port Adept to Linux...). The editors hide the complexity and you never need to see the source code. But its there if you need it (unlike Word, for example). As for POD, I've already extended the POD in POD2HTML (which was buggy anyway). For example, I've added new directives for embedding images, linking to files and more... I don't afraid to extend the POD since I can easily convert all my extended pod files back into the standard POD format. So if you want a syntax for tables, this should be easy to add, like: =table args =tr args =td args ... =/td =/tr =/table Ugh... I believe SDF has better support for tables, without resorting to nastiness like that. I think if you like POD, you'll love SDF, Stas. http://www.mincom.com/mtr/sdf/ -- 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: logging out
Angel R. Rivera ([EMAIL PROTECTED]) said something to this effect: I authenticate against a database but need to carry more information than just their name so if I have read the readme at CPAN correctely, this just may do the trick. Thanks to all who have written me. -ar depending on how you're handling the session information you may be able to just delete it in an appropriate action (/...etcetc/logout.html or whatever). In my case I'm using Apache::Session so deleting the session means the next time the user accesses a page they're assigned a new session which starts at ground zero. If that is too heavy weight for you (sometimes all you need is one or two bits of info and they're relatively static), you can put that info into pnotes immediately after you authenticate. That makes it available for the duration of the request, with a minimum of fuss. (darren) -- He who would trade liberty for safety deserves neither.
libapreq (Apache::Request) unhappiness
Jim Winstead back on June 26 finished debugging a patch to libapreq (that's Apache::Request) that avoids the problem of the mod_perl process eating up all the memory required for an upload (and then some!) and not giving it back. http://forum.swarthmore.edu/epigone/modperl/thahwhahyu/2626150219.A9842@ trainedmonkey.com Joe Schaefer then rewrote this to avoid some unnecessary malloc()s, http://forum.swarthmore.edu/epigone/modperl/rorprilswe/m3ya3m513y.fsf@mumonk an.sunstarsys.com which David Mitchell then patched to make more portable. http://forum.swarthmore.edu/epigone/modperl/rorprilswe/27051203.NAA20171 @tiree.fdgroup.co.uk Why this history lesson? Well, Joe and David's version, I've just discovered, fails to correctly deal with large POSTs that are not file uploads. In particular, I just wrote a lengthy (3 hours!) email in my webmail system, and when it got to the recipiant only the first and last bits were there :-( I've replicated this behaviour with a number of large POSTs, and the problem always occurs (under Linux 2.2+latest stable mod_perl and Apache). The good news is that Jim's version doesn't have this problem. Are there any volunteers to fix Joe and David's more efficient version? (Sorry, I'm no C guru...) -- Jeremy Howard [EMAIL PROTECTED]
Re: Templating Feature sets
Stas Bekman wrote: I believe XML is a way too heavy for docs writing. Why one will want to get a messy source code, when you can get away with a minimalistic POD. Just look at the Guide's source code and look at the generated PDF -- isn't it great? I love POD. And if you want more than POD provides, it takes secs to add the new functionality. XML is probably a tad overboard but how about XHTML or at least looking for a POD = XHTML for the future? -- __ Mr. Erich L. Markert [EMAIL PROTECTED] Computer Learning Center TEL (914)422-4328 Pace University 1 Martine Ave White Plains, New York 10606-1932 Those who do not understand Unix are condemned to reinvent it, poorly. -- Henry Spencer
Re: [doc writing] (was Re: Feature sets [was Re: Templating System])
On Fri, 4 Aug 2000, Stas Bekman wrote: People are migrating to XML because there are good editors coming onto the market (though sadly none for Linux yet, but I'm getting close to persuading Arbotext to port Adept to Linux...). The editors hide the complexity and you never need to see the source code. But its there if you need it (unlike Word, for example). Well, this is a whole different story :) Once there will be such an editor, things will be much better. Well the tools are now pretty nice for Windows. But you forget about the benefits of the source code editing, which is diff and tools working with it. Surely enough big editors support their own diff formats and tools, but they aren't possessed by many people. And with POD everybody has a text editor :) As with XML :) Ugh... I believe SDF has better support for tables, without resorting to nastiness like that. I think if you like POD, you'll love SDF, Stas. http://www.mincom.com/mtr/sdf/ Thanks for the link, Matt. I've seen this technology a while ago. The reason that I didn't use it, is that it's a much bigger superset of syntax that I need. If all I miss is a tables formatting, I'd rather add this support than go for a complete format change. I wonder if it would be easy to rip the table support out of SDF and use that, rather than change completely to SDF. I find table support to be POD's only real severe weakness. -- 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: Templating Feature sets
On Fri, 4 Aug 2000, Erich L. Markert wrote: Stas Bekman wrote: I believe XML is a way too heavy for docs writing. Why one will want to get a messy source code, when you can get away with a minimalistic POD. Just look at the Guide's source code and look at the generated PDF -- isn't it great? I love POD. And if you want more than POD provides, it takes secs to add the new functionality. XML is probably a tad overboard but how about XHTML or at least looking for a POD = XHTML for the future? The problem is that POD is actually more semantically rich than HTML (or XHTML). And you don't want to lose that semantic information (POD is really nice for grepping just the code segments, for example). -- 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: libapreq (Apache::Request) unhappiness
"Jeremy Howard" [EMAIL PROTECTED] writes: Jim Winstead back on June 26 finished debugging a patch to libapreq (that's Apache::Request) that avoids the problem of the mod_perl process eating up all the memory required for an upload (and then some!) and not giving it back. http://forum.swarthmore.edu/epigone/modperl/thahwhahyu/2626150219.A9842@ trainedmonkey.com Joe Schaefer then rewrote this to avoid some unnecessary malloc()s, http://forum.swarthmore.edu/epigone/modperl/rorprilswe/m3ya3m513y.fsf@mumonk an.sunstarsys.com which David Mitchell then patched to make more portable. http://forum.swarthmore.edu/epigone/modperl/rorprilswe/27051203.NAA20171 @tiree.fdgroup.co.uk Why this history lesson? ... That's not how things went. AFAIK, Jim's group scrapped the old multipart_buffer.c code and started fresh. The patch I submitted just modified the existing code in order to get the memory usage under control. David just pointed out that GNU's 'memmem' function, which is used in my patch (but not in Jim's) is not available many OS's, so he kindly submitted his own. Well, Joe and David's version, I've just discovered, fails to correctly deal with large POSTs that are not file uploads. In particular, I just wrote a lengthy (3 hours!) email in my webmail system, and when it got to the recipiant only the first and last bits were there :-( I'd be glad to look into it. Could you send the html form that's causing trouble, and the post data as well? Also, are you using David's memmem patch? I've replicated this behaviour with a number of large POSTs, and the problem always occurs (under Linux 2.2+latest stable mod_perl and Apache). The good news is that Jim's version doesn't have this problem. Are there any volunteers to fix Joe and David's more efficient version? (Sorry, I'm no C guru...) If Jim's version is working for you, great. As for 'efficiency', I don't know how the memory usage compares between Jim's patch and mine, but I can say that I spent one weekend making the patch. I think Jim's group put in considerably more time. -- Joe Schaefer [EMAIL PROTECTED] \ / SunStar Systems \ / Inc. - -- sunstarsys.com / \ 954.733.9151/ \
Re: logging out
[EMAIL PROTECTED] wrote: I used Net::LDAP, a pure Perl implementation, against a Novell eDirectory LDAP server. You can find it at CPAN or at http://sourceforge.net/project/?group_id=5050 I coded the authen_cred method to authenicate against LDAP and then store the username in the session hash. The authen_ses_key method then recovers the username from the session hash. I remember writing those methods long ago... :-) I created a custom require method to check group membership so I can include something like this in httpd.conf : require LDAPGroup cn=administrators,ou=groups,o=wl I want to extend it to check for container membership too but I don't need that just now. I could send you the code if it would be of interest. That would be great if you don't mind. At least then I would have a starting point. My biggest decision right now is whether to use something like mod_auth_ldap compiled into Apache or to use Apache::AuthCookie with LDAP authentication like you used. Does anyone have experience with either situation? -- Drew Taylor Vialogix Communications, Inc. 501 N. College Street Charlotte, NC 28202 704 370 0550 http://www.vialogix.com/
Re: Feature sets [was Re: Templating System]
Stas Bekman wrote: I believe XML is a way too heavy for docs writing. Why one will want to get a messy source code, when you can get away with a minimalistic POD. Just look at the Guide's source code and look at the generated PDF -- isn't it great? I love POD. And if you want more than POD provides, it takes secs to add the new functionality. I agree. XML has a nice "cool" factor, but I want to make this guide as simple as possible. As for POD, I've already extended the POD in POD2HTML (which was buggy anyway). For example, I've added new directives for embedding images, linking to files and more... I don't afraid to extend the POD since I can easily convert all my extended pod files back into the standard POD format. So if you want a syntax for tables, this should be easy to add, like: =table args =tr args =td args ... =/td =/tr =/table That might be a useful extension. How do you do tables now? "=for html"? -- Drew Taylor Vialogix Communications, Inc. 501 N. College Street Charlotte, NC 28202 704 370 0550 http://www.vialogix.com/
Re: libapreq (Apache::Request) unhappiness
I think problem lies around line 378 in multipart_buffer.c: old_len = blen; is definitely wrong. It should read old_len += blen; Here's (yet another) quick patch that includes this fix. --- libapreq-0.31/c/multipart_buffer.c Fri Aug 4 10:32:35 2000 +++ libapreq-0.31-new/c/multipart_buffer.c Fri Aug 4 10:30:49 2000 @@ -375,7 +375,7 @@ retval = retval ? my_join(self-subp, retval, old_len, data, blen) : ap_pstrndup(self-subp, data, blen); - old_len = blen; + old_len += blen; } /* can't clear subp here w/o destroying retval */ @@ -407,3 +407,5 @@ return self; } I've also cleaned up a few minor malloc problems in apache_request.c and mod_perl. I'll make those patches available soon. -- Joe Schaefer [EMAIL PROTECTED] \ / SunStar Systems \ / Inc. - -- sunstarsys.com / \ 954.733.9151/ \
APACHE::ASP install problem
Hi, [sorry for posting this again but i wasnt subscribed when i 1st posted it and couldnt c any reponses, couldnt find an archive either :/] i have an installation problem, im using apache 1.3.12 and linux kernl 2.2.16-3 and have the mod_perl installed. The 'httpd -l' lists the mod_perl as being installed. Bu when i do 'perl Makefile.PL' in the Apache-ASP source tree i get the following errors : [root@dilitium Apache-ASP-2.03]# perl Makefile.PL Checking for the prerequisite modules... ... found Apache ! ... found Carp ! ... found Data::Dumper ! ... found Fcntl ! !!! you need the module: HTTP::Date WHY: Provides mapping between Perl time() and HTTP dates ... found MD5 ! !!! you need the module: MLDBM WHY: This is used for reading and writing multi-level hashes on disk ... found SDBM_File !
Re: Why do variables not reinitialize when script changed?
Stas Bekman wrote: I think you confuse, something. When the script is recompiled all the variables belonging to the package decalared by Apache::Registry or similar are getting reset. If you require/use() some modules that declare packages and have global variables -- these won't be reset unless reloaded or initialized in your code. OK, we've lost my original question here, but what I was saying was this: I have a script that is in Apache::Registry. (It's showing up in "Compiled Registry Scripts" in perl-status). The global variables are *not* getting set on recompilation. Are you saying they should? *You* have straightened me out, on the other hand. So, lessee, BEGIN { somevar=somevalue; } ought to work for a variable I want reinitialized at compilation only... Not if you are talking about the scripts running under Apache::Registry and friends, please read the guide. http://perl.apache.org/guide/porting.html#BEGIN_blocks Stas, what are you talking about? Your own guide says: "BEGIN blocks in Apache::Registry scripts will be executed, as above plus: ... An additional time, once per child process, each time the script file changes on disk. " I.e., at compilation. And that is what I'm seeing, and it's the behavior I want. I think you are confused about what I am saying. Probably working too much on the template guide... :-)
[ANNOUNCE] Apache::Dispatch-0.03
The URL http://morpheus.laserlink.net/~gyoung/modules/Apache-Dispatch-0.03.tar.gz has entered CPAN as file: $CPAN/authors/id/G/GE/GEOFF/Apache-Dispatch-0.03.tar.gz size: 5735 bytes md5: 91eacb0aeff8e751ebc8c7156426fbfb Changes: 0.03 8.4.2000 - complete API and internal rewrite o added DispatchExtras and DispatchPrefix directive o removed per-server configurations o added new pre_dispatch, post_dispatch, error_dispatch and dispatch_index method tie-ins - updated documentation - more kudos to Matt Sergeant for invaluable insight README: NAME Apache::Dispatch - call PerlHandlers with the ease of CGI scripts SYNOPSIS httpd.conf: PerlModule Apache::Dispatch PerlModule Bar Location /Foo SetHandler perl-script PerlHandler Apache::Dispatch DispatchPrefix Bar DispatchExtras Pre Post Error /Location DESCRIPTION Apache::Dispatch translates $r-uri into a class and method and runs it as a PerlHandler. Basically, this allows you to call PerlHandlers as you would CGI scripts - directly from the browser - without having to load your httpd.conf with a slurry of Location tags. =head1 EXAMPLE in httpd.conf PerlModule Apache::Dispatch PerlModule Bar Location /Foo SetHandler perl-script PerlHandler Apache::Dispatch DispatchPrefix Bar /Location in browser: http://localhost/Foo/baz the results are the same as if your httpd.conf looked like: Location /Foo SetHandler perl-script PerlHandler Bar::dispatch_baz /Location but with the additional security of protecting the class name from the browser and keeping the method name from being called directly. Because any class under the Bar:: hierarchy can be called, one Location directive is be able to handle all the methods of Bar, Bar::Baz, etc... CONFIGURATION DIRECTIVES DispatchPrefix The base class to be substituted for the $r-location part of the uri. Applies on a per-location basis only. DispatchExtras A list of extra processing to enable per-request. They may be applied on a per-server or per-location basis. If the main handler is not a valid method call, the request is declined prior to the execution of any of the extra methods. Pre - eval()s Foo-pre_dispatch() prior to dispatching the uri uri. The $@ of the eval is not checked in any way. Post - eval()s Foo-post_dispatch() prior to dispatching the uri. The $@ of the eval is not checked. Error - If the main handler returns other than OK then Foo-error_dispatch() is called and return status of it is returned instead. Without this feature, the return status of your handler is returned. SPECIAL CODING GUIDELINES Apache::Dispatch uses object oriented calls behind the scenes. This means that you either need to account for your handler to be called as a method handler, such as sub dispatch_bar { my $class = shift; # your class my $r = shift; } or get the Apache request object yourself via sub dispatch_bar { my $r = Apache-request; } This also has the interesting side effect which would allow you to define, say, a base error_dispatch() method in Foo which is then inherited by Foo::Bar, but overriden in Foo::Bar::Baz. NOTES In addition to the special methods pre_dispatch(), post_dispatch(), and error_dispatch(), if you define dispatch_index() it will be called by /Foo or /Foo/. /Foo/index is always directly callable, but /Foo will only translate to /Foo/index at the highest level - that is, when just the location is specified. Meaning /Foo/Baz/index will call Bar::Baz-dispatch_index, but /Foo/Baz will try to call Bar-Baz(). There is no require()ing or use()ing of the packages or methods prior to their use as a PerlHandler. This means that if you try to dispatch a method without a PerlModule directive or use() entry in your startup.pl you probably will not meet with much success. This adds a bit of security and reminds us we should be pre-loading that code in the parent process anyway... If the uri can be dispatched but contains anything other than [a-zA-Z0-9_/-] Apache::Dispatch declines to handle the request. Like everything in perl, the package names are case sensitive. Verbose debugging is enabled by setting $Apache::Dispatch::DEBUG=1. Very verbose debugging is enabled at 2. To turn off all debug information set your apache LogLevel directive above info level. This is alpha software, and as such has not been tested on multiple platforms or environments for security, stability or other concerns. It requires PERL_DIRECTIVE_HANDLERS=1, PERL_METHOD_HANDLERS=1, PERL_LOG_API=1, PERL_HANDLER=1, and maybe other hooks to function properly. FEATURES/BUGS No known bugs or unexpected features at this time... SEE ALSO perl(1), mod_perl(1), Apache(3) AUTHOR Geoffrey Young
RE: Package Lexicals and PerlModule
darren chamberlain wrote: ...Except that by calling Foo:load_var() you are setting $PACKAGE_LEXICAL to undef (by passing in an empty list via ()), rather than retrieving it. Well, actually, I was checking to see if it was set first: sub load_var { my $param = shift; $PACKAGE_LEXICAL = $param if $param; } Your example does essentially the same thing, but is interesting because it puts the sub and the lexical variable in a nested block scope, and as you say: Each child will have its own $PACKAGE_LEXICAL. That's a neat trick! However, for my purposes, I don't want each child to have a separate $PACKAGE_LEXICAL. I want to set the variable with the parent process (actually from setup.pl) and I want children to be able to call the sub without any parameters. And I want the variable to be visible to subs in the same package, but not to code outside the package. It's kind of like a class variable without objects. Maybe it would be clearer with two subs: package Foo; my $PACKAGE_LEXICAL; sub set_var { $PACKAGE_LEXICAL = shift; } sub do_stuff { # do something with $PACKAGE_LEXICAL; } I want to be able to call Foo::set_var('wubba') from startup.pl, and then call Foo::do_stuff() from some child process. The weird thing is, this works as I expect when I put "PerlModule Foo" in httpd.conf, but not when I put "use Foo;" in startup.pl. Does everybody else use PerlModule to pull in their modules, or startup.pl? Michael
Re: APACHE::ASP install problem
Use CPAN to install HTTP::Date and MLDBM, or better yet, install Bundle::Apache::ASP. There is a note in the install error output on how to use CPAN that you didn't include below. I would follow its instructions. --Joshua Pamela O'Shea wrote: Hi, [sorry for posting this again but i wasnt subscribed when i 1st posted it and couldnt c any reponses, couldnt find an archive either :/] i have an installation problem, im using apache 1.3.12 and linux kernl 2.2.16-3 and have the mod_perl installed. The 'httpd -l' lists the mod_perl as being installed. Bu when i do 'perl Makefile.PL' in the Apache-ASP source tree i get the following errors : [root@dilitium Apache-ASP-2.03]# perl Makefile.PL Checking for the prerequisite modules... ... found Apache ! ... found Carp ! ... found Data::Dumper ! ... found Fcntl ! !!! you need the module: HTTP::Date WHY: Provides mapping between Perl time() and HTTP dates ... found MD5 ! !!! you need the module: MLDBM WHY: This is used for reading and writing multi-level hashes on disk ... found SDBM_File !
Re: Why do variables not reinitialize when script changed?
On Fri, 4 Aug 2000, Keith G. Murphy wrote: Stas Bekman wrote: I think you confuse, something. When the script is recompiled all the variables belonging to the package decalared by Apache::Registry or similar are getting reset. If you require/use() some modules that declare packages and have global variables -- these won't be reset unless reloaded or initialized in your code. OK, we've lost my original question here, but what I was saying was this: I have a script that is in Apache::Registry. (It's showing up in "Compiled Registry Scripts" in perl-status). The global variables are *not* getting set on recompilation. Are you saying they should? In your original email you've said that the variables don't get reset on recompilation. The variables are set when you set them, either every time in the script when this executed, or in the BEGIN block once as you have mentioned below (under Apache::Registry). *You* have straightened me out, on the other hand. So, lessee, BEGIN { somevar=somevalue; } ought to work for a variable I want reinitialized at compilation only... Not if you are talking about the scripts running under Apache::Registry and friends, please read the guide. http://perl.apache.org/guide/porting.html#BEGIN_blocks Stas, what are you talking about? Your own guide says: "BEGIN blocks in Apache::Registry scripts will be executed, as above plus: ... An additional time, once per child process, each time the script file changes on disk. " I.e., at compilation. And that is what I'm seeing, and it's the behavior I want. I think you are confused about what I am saying. Probably working too much on the template guide... :-) Brrgghhh, I guess we were talking about different things I thought you were trying to initialize in the code. Apparently I misread your quote. Sorry about that. Never mind, BEGIN { somevar=somevalue; } does what you want, great!!! _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://perl.org http://stason.org/TULARC http://singlesheaven.com http://perlmonth.com http://sourcegarden.org
Seg Fault (11)
Using Raven's (www.covalent.com) build, I want to use mod_perl as a DSO -- no errors during build: Apache/1.3.12 (Unix) secured_by_Raven/1.5.1 mod_perl/1.24 PHP/4.0.1pl2 However, trying to use mod_perl's DSO causes Seg Fault (11) Any thoughts, comments, or ideas would be most appreciated :) TIA; -Sneex- :] - FCCJ * 501 W State St * Jacksonville, Fl 32202 * 904/632-3089 -
APACHE::ASP install problem ?
Hi, i have an installation problem, im using apache 1.3.12 and have the mod_perl installed. The 'httpd -l' lists the mod_perl as being installed. Bu when i do 'perl Makefile.PL' in the Apache-ASP source tree i get the following errors : [root@dilitium Apache-ASP-2.03]# perl Makefile.PL Checking for the prerequisite modules... ... found Apache ! ... found Carp ! ... found Data::Dumper ! ... found Fcntl ! !!! you need the module: HTTP::Date WHY: Provides mapping between Perl time() and HTTP dates ... found MD5 ! !!! you need the module: MLDBM WHY: This is used for reading and writing multi-level hashes on disk ... found SDBM_File ! , where can i find the HTTP::Date and the MLDBM modules ??, or is this a sympton of a mod_perl problem ? thanks in advance, Regards, Pamela
error from modper ??
Hi, Does some one know this error come from modperl or embperl [3182]ERR: 12: Line 1: File 3182]ERR: 12: Line 1: File /usr/www/clients/microjoin/dynamicupdate/htdocs/admin/text/ open error: Is a directoryApache/1.3.12 (Unix) mod_perl/1.23 HTML::Embperl 1.3b3 [Fri Aug 4 09:14:18 2000] I had a small emperl script in /usr/www/clients/microjoin/dynamicupdate/htdocs/admin/text/ directory. when I run the script, sometime It run fine , sometime I got the above error. Thanks
Re: error from modper ??
Try restarting apache. I get problems like this too, where sometimes some stuff will happen, and sometimes it won't. The only way I know of is to restart apache. If anyone else knows a better way, I would like to know! I know that mod_perl compiles a copy of your script, and keeps it in memory. But it does it per httpd process. So, if you don't restart your web server to clear the memory, and copy of the wrong script is still in memory. However, if you happen to get an httpd process that has never seen that script before, it will compile your updated one, and keep it in memory. I believe that this is how it works, I would apprectiate any corrections, and any more info on the subject!! On Fri, 04 Aug 2000, you wrote: %_ Hi, Does some one know this error come from modperl or embperl [3182]ERR: 12: Line 1: File 3182]ERR: 12: Line 1: File /usr/www/clients/microjoin/dynamicupdate/htdocs/admin/text/ open error: Is a directory Apache/1.3.12 (Unix) mod_perl/1.23 HTML::Embperl 1.3b3 [Fri Aug 4 09:14:18 2000] I had a small emperl script in /usr/www/clients/microjoin/dynamicupdate/htdocs/admin/text/ directory. when I run the script, sometime It run fine , sometime I got the above error. Thanks Content-Type: text/html; name="unnamed" Content-Transfer-Encoding: quoted-printable Content-Description: -- .oOAARONOo.
Re: Package Lexicals and PerlModule
On Fri, 4 Aug 2000, darren chamberlain wrote: Sharing a variable among children is difficult; you need to use IPC::Sharable or something similar. Not if it's read-only after the fork, which this one appears to be. You can load it with a value at startup and it will be shared. - Perrin
Re: Package Lexicals and PerlModule
On Sun, 30 Jul 2000, mgraham wrote: Under mod_perl, I find inconsistent behaviour. It works fine when a module is loaded via the PerlModule directive in httpd.conf. However when a module is loaded via startup.pl, the package lexicals "forget" their values between calls. [...] The strange thing is that this works when Foo is required in httpd.conf via a "PerlModule Foo" directive. But when Foo is pulled in via a "use Foo" in startup.pl, $PACKAGE_LEXICAL does not keep it's value. This sounds like a bad interaction with PerlFreshRestart and closure variables. Does it work if you turn off PerlFreshRestart? Can you live with that? By the way, PerlFreshRestart is not supposed to be on by default, but using mod_perl compiled as DSO causes similar behavior in recent versions (1.22 on). - Perrin
Re: how to check for ssl.
There is more then one section that needs to be secure and its not quite as blank and white as folder /secure needs to be secure. for example. folder /ecom/checkout needs to be secure. folder /ecom/showcart doesn't Scott On 4 Aug 2000, at 10:16, David Mitchell wrote: VirtualHost _default_:80 . Redirect /secure https://www.mysite.com/secure /VirtualHost
[ot] Re: how to check for ssl.
On Fri, 4 Aug 2000 [EMAIL PROTECTED] wrote: There is more then one section that needs to be secure and its not quite as blank and white as folder /secure needs to be secure. for example. folder /ecom/checkout needs to be secure. folder /ecom/showcart doesn't it is really starting to sound like the site design itself could use a revamp. i believe the hopping back and forth between http/https is going to generate a lot of silly warning on the user's browser, as well. why not just set the up for https as soon as they need it and then leave them there? Scott On 4 Aug 2000, at 10:16, David Mitchell wrote: VirtualHost _default_:80 . Redirect /secure https://www.mysite.com/secure /VirtualHost -- Blue Lang Unix Systems Admin QSP, Inc., 3200 Atlantic Ave, Ste 100, Raleigh, NC, 27604 Home: 919 835 1540 Work: 919 875 6994 Fax: 919 872 4015
RE: Package Lexicals and PerlModule
Perrin Harkins wrote: This sounds like a bad interaction with PerlFreshRestart and closure variables. Does it work if you turn off PerlFreshRestart? Can you live with that? Yes! It works with PerlFreshRestart Off. I think you're right - it probably has something to do with the timing of when various bits get compiled and executed. By the way, PerlFreshRestart is not supposed to be on by default, but using mod_perl compiled as DSO causes similar behavior in recent versions (1.22 on). I had it turned on for some reason. Why should PerlFreshRestart be on, anyway? Ostensibly, it's so you can make sure that your modules can survive a soft restart, but can't you also gather that from 'apachectl graceful'? Michael
Re: .htacess security
On Thu, 3 Aug 2000, Ken Williams wrote: [EMAIL PROTECTED] (Rob Giseburt) wrote: Are .htaccess files secure? I don't want users to be able to use perl.../perl sections or any other mod_perl constructs (setting scripts to run via the Registry, for example) in .htaccess files. However, I need ..htaccess files turned on so users can password protect directories site-wide (so I can't shut .htaccess files off completely.) I assume you need Perl sections in your main httpd.conf? If not, you can just shut it off altogether. Alternatively, you might want to shut it off and use a templating system to generate your httpd.conf file(s) so they don't have Perl sections in them. One extra question: Can I turn on mod_perl SSI and have normal SSI calls at the same time? In other words, can I have one page (file.pshtml maybe) parsed by perl-extended SSI and another (file.shtml) be parsed by normal (without perl, mod_ssi?) SSI? I'm not sure (I think probably not), but you can get the same effect if you use Apache::SSI for some pages and regular mod_ssi for the others. It also depends on what you mean by "mod_perl SSI". If Rob is talking about Ken's Apache::SSI handler, that's one thing, but compiling PERL_SSI=1 to add #perl extentions to "regular" mod_include is another. Setting up Apache::SSI to handle some files and mod_include to handle others is not a problem. But is it possible to selectively allow #perl in only some mod_include files? If you're worried about people using Perl sections in .htaccess files, you're going to have to worry about !--#perl sub="whatever" -- in SSI files too.
RE: Package Lexicals and PerlModule
On Fri, 4 Aug 2000, mgraham wrote: Why should PerlFreshRestart be on, anyway? Ostensibly, it's so you can make sure that your modules can survive a soft restart, but can't you also gather that from 'apachectl graceful'? With PerlFreshRestart turned off, a graceful restart will not reload changed code. You have to do a full stop/start to pick up changes. - Perrin
Re: Seg Fault (11)
On Fri, 4 Aug 2000, Bill Jones wrote: Using Raven's (www.covalent.com) build, I want to use mod_perl as a DSO -- no errors during build: Apache/1.3.12 (Unix) secured_by_Raven/1.5.1 mod_perl/1.24 PHP/4.0.1pl2 However, trying to use mod_perl's DSO causes Seg Fault (11) Any thoughts, comments, or ideas would be most appreciated :) TIA; -Sneex- :] - FCCJ * 501 W State St * Jacksonville, Fl 32202 * 904/632-3089 - mod_perl and php4 dont mix well together, there has been a few posts about this in the past. try running it through gdb to get a stack backtrace. that might provide some more clues. -- Dave Moore Web Application Developer mailto:[EMAIL PROTECTED] ePALS Classroom Exchange http://www.epals.com/ Connecting more than 1.9 million students and teachers in 182 countries!
Template caches
I briefly asked about this in a previous post, but I wanted to follow up. I'm curious but not very experienced, so any comments would be welcome... I have a home-built template cache system that is limited by size. I was logging failed cache hits (and thus reloading a template from disk) and was surprised at how often it was happening. So... I like the ideas of converting templates to subroutines and then caching those on disk. I really like the idea of then bringing those into the server and compiling them and keeping a cache of those compiled subroutines in memory. Having the templates in the cache seems like a big win, so one would want to keep as many templates in the cache as possible. This in-memory cache must be limited and controlled to some degree I would expect, especially since they cannot be shared across mod_perl server children to save memory. Now, let say for once we do have a limited amount of memory, and we have a very large number of templates, and the templates are very large and mostly plain old text. In other words, the compiled templates are basically big print statements with only a small part being variable interpolation. Since the templates are large, I could imagine a situation where the compiled template cache is thrashed, or at least the templates don't live in the cache very long. As someone who used to program on machines with 8K, all that plain old text in non-shared memory bugs me a bit. Maybe this is already being done, but I was wondering if separating the templates into text and code segments might allow more templates (template code, that is) to be placed in the running server's cache at any given time would make any sense. It would be slower to generate a page, of course, but that might be offset by a greater cache hit-rate and less reloading compiling of templates. And the text segments could be shared by all server processes by using IPC::Sharable -- or maybe it would be fast enough to let the OS file system buffer the commonly used templates, or use a database to load the text segments. So my question is only would such a system make sense, or is memory so inexpensive and templates normally so small that there wouldn't be any benefit? Bill Moseley mailto:[EMAIL PROTECTED]
RE: Package Lexicals and PerlModule
"PH" == Perrin Harkins [EMAIL PROTECTED] writes: PH On Fri, 4 Aug 2000, mgraham wrote: Why should PerlFreshRestart be on, anyway? Ostensibly, it's so you can make sure that your modules can survive a soft restart, but can't you also gather that from 'apachectl graceful'? PH With PerlFreshRestart turned off, a graceful restart will not reload PH changed code. You have to do a full stop/start to pick up changes. Unless you are using mod_perl as a DSO in which case PerlFreshRestart is irrelevent -- it is always freshly started. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D.Khera Communications, Inc. Internet: [EMAIL PROTECTED] Rockville, MD +1-301-545-6996 GPG MIME spoken herehttp://www.khera.org/~vivek/
Re: Template caches
On Fri, 4 Aug 2000, Bill Moseley wrote: Now, let say for once we do have a limited amount of memory, and we have a very large number of templates, and the templates are very large and mostly plain old text. In other words, the compiled templates are basically big print statements with only a small part being variable interpolation. Since the templates are large, I could imagine a situation where the compiled template cache is thrashed, or at least the templates don't live in the cache very long. Mason tries to address this by checking for the amount of text in a template and turning large plain text sections into subroutine calls that read the text from disk. I think this is a good solution that other systems would do well to emulate. (Of course you can adjust what counts as "a large amount of text" according to your available free RAM.) Mason also has a very nice size-limiting scheme for the cache, using an least-frequently-used + aging algorithm for its removal policy. And the text segments could be shared by all server processes by using IPC::Sharable -- or maybe it would be fast enough to let the OS file system buffer the commonly used templates, or use a database to load the text segments. Just let the filesystem do it. It's much simpler and it lets the OS handle things that the OS is good at. - Perrin
Re: Template caches
On Fri, 4 Aug 2000, Bill Moseley wrote: Now, let say for once we do have a limited amount of memory, and we have a very large number of templates, and the templates are very large and mostly plain old text. In other words, the compiled templates are basically big print statements with only a small part being variable interpolation. Since the templates are large, I could imagine a situation where the compiled template cache is thrashed, or at least the templates don't live in the cache very long. There are two situations I can realistically see this being a problem: 1. You haven't bought enough memory for your server considering your data set and other issues. 2. You are an ISP running one of these template systems, with multiple virtual hosts. I actually don't have any solutions to this, and its exactly the reason I want to bring Mason and AxKit together, because AxKit sure does use a lot of memory. The only real benefit is where you've got static files in the cache. You can effectively stop the server (clearing the cache) and restart it and deliver from the cache. Provided nothing changes the templates will never be loaded again. -- 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: ignore header_only()?
"NT" == Nathan Torkington [EMAIL PROTECTED] writes: NT I see some programmers don't check header_only(). Are there NT bad things in store if you don't? Or will Apache or the browser NT simply ignore the body that gets created? My experience is apache just tosses the body for you. The programmer check is mainly an optimization from where I sit. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D.Khera Communications, Inc. Internet: [EMAIL PROTECTED] Rockville, MD +1-301-545-6996 GPG MIME spoken herehttp://www.khera.org/~vivek/
Re: ignore header_only()?
Thanks for the speedy response. You've now emboldened me to ask my second question: sometimes I see people not calling send_http_header() and yet their HTML still comes through. Does mod_perl sometimes automatically call this for you? Nat
Re: ignore header_only()?
On Fri, Aug 04, 2000 at 04:22:29PM -0600, Nathan Torkington wrote: Thanks for the speedy response. You've now emboldened me to ask my second question: sometimes I see people not calling send_http_header() and yet their HTML still comes through. Does mod_perl sometimes automatically call this for you? Yep, its a configurable option. http://perl.apache.org/guide/config.html: [..] PerlSendHeader On PerlSendHeader On tells the server to send an HTTP header to the browser on every script invocation. You will want to turn this off for nph (non-parsed-headers) scripts. The PerlSendHeader On setting invokes ap_send_http_header() after parsing your script headers. It is only meant for CGI emulation, and to send the HTTP header it's always better either to use $q-header from the CGI.pm module or to use $r-send_http_header using the Apache Perl API. [..] Ajit
Re: how to check for ssl.
For some reason (probably my error), $r-get_server_port() always returns 80 although my mod_perl backend only listen to 8080 and 8443 (I use Listen directives). I'm using (sockaddr_in($r-connection-local_addr))[0] to get the port instead. Though it works, I must load one more module (Socket), which I would like to avoid if possible... Any idea about my mistake ? My conf: apache-1.3.12 + mod_ssl-2.3.4 = apache-1.3.12 + mod_perl-1.24 on linux-2.2.14 Jean-Denis Girard http://www.esoft.pf ___cliff rayman___ a écrit : $port=$r-get_server_port(); [EMAIL PROTECTED] wrote: Ok, so what is the PORT variable and how do i access it? Scott On 3 Aug 2000, at 22:08, Stas Bekman wrote: Not really, you can spoof both: http://thingy.kcilink.com/modperlguide/config/Knowing_the_proxy_pass_e d_Connec.html -- ___cliff [EMAIL PROTECTED]http://www.genwax.com/
Re: how to check for ssl.
try these and see what they return: $r-server-port(); $r-parsed_uri-port(); -- ___cliff [EMAIL PROTECTED]http://www.genwax.com/ Jean-Denis Girard wrote: For some reason (probably my error), $r-get_server_port() always returns 80 although my mod_perl backend only listen to 8080 and 8443 (I use Listen directives). I'm using (sockaddr_in($r-connection-local_addr))[0] to get the port instead. Though it works, I must load one more module (Socket), which I would like to avoid if possible... Any idea about my mistake ? My conf: apache-1.3.12 + mod_ssl-2.3.4 = apache-1.3.12 + mod_perl-1.24 on linux-2.2.14 Jean-Denis Girard http://www.esoft.pf ___cliff rayman___ a écrit : $port=$r-get_server_port(); [EMAIL PROTECTED] wrote: Ok, so what is the PORT variable and how do i access it? Scott On 3 Aug 2000, at 22:08, Stas Bekman wrote: Not really, you can spoof both: http://thingy.kcilink.com/modperlguide/config/Knowing_the_proxy_pass_e d_Connec.html -- ___cliff [EMAIL PROTECTED]http://www.genwax.com/
Problem with mod_perl and CGI script with Netscape
Greetings, A couple of days ago, I installed mod_perl to speed up a CGI program I use to generate HTML pages for my web site http://www.mostgraveconcern.com . The CGI script is a perl script that ran fine before mod_perl, and now runs fine with Internet Explorer, but Netscape Navigator insists on downloading the page instead of executing it on the server and rendering the output. The CGI script is called with an HTML anchor tag such as: A HREF="qengine.cgi?frames=OFFmode=TOPICterms=Government"Government/A My httpd.conf file has the entry: Directory /usr/local/www/html/quotes Files ~ "\.cgi$" Options ExecCGI Includes SetHandler perl-script PerlHandler Apache::Registry PerlSendHeader Off /Files AllowOverride None Options Indexes ExecCGI Includes Order allow,deny Allow from all /Directory I embeded the Files section inside the Directory because I have other cgi scripts in other directories that are compiled programs. When I try 'PerlSendHeader On', Internet Explorer chokes on SSI tags after '!--#exec cgi=" ', displaying the name of the SSI script, e.g., 'css.cgi"', while Netscape simply prints out the document (HTML tags and all) without rendering it. I searched the mailing list archives, but couldn't find anything about this. I also printed out a lot of mod_perl documentation, but I've got about 800 pages to go through... If someone has run into this before, I'd really appreciate hearing from you! TIA, --Dan -- Dan O'Connor On Matters of Most Grave Concern http://www.mostgraveconcern.com FreeBSD Cheat Sheets http://www.mostgraveconcern.com/freebsd/
Re: ignore header_only()?
Ken Fox said: Sorry to be a pain, but I still haven't heard anything back about my proposal: Ken Fox wrote: I was using $request-sent_header and found out that it's not terribly useful if PerlSendHeader is off -- sent_header always returns 1. I changed mod_perl_sent_header so that it returns 0, 1 or 2: 0 - headers have not been sent (PerlSendHeader on) 1 - headers have not been sent (PerlSendHeader off) 2 - headers have already been sent Is this the right list for change proposals? Should I re-submit my patch? You could try: The dev list is for discussions about the development of the core mod_perl modules. Subscription information. a.. subscribe to the list: [EMAIL PROTECTED] b.. unsubscribe from the list: [EMAIL PROTECTED] c.. get help with the list: [EMAIL PROTECTED] Doug popped his head up a few weeks ago to say he's in read-only mode at the moment. I don't know why--maybe he's busy with v2 at the moment. If you don't have any luck on the dev list you could try mailing him directly, I guess. -- Jeremy Howard [EMAIL PROTECTED]