Re: URI::URL - problem in LWP 5.53_95 with mod_perl
___cliff rayman___ wrote: > i did not use CPAN.pm to install software on this particular > machine. my mod_perl builds are always by hand. > > i did understand exactly why this happened. i should have made > that more clear in my first e-mail. i made the patch that i did, so > i would not have the same problem with any other software. You are correct. I interviewed the sysadmin that called me for help with this building mod_perl, and he fessed up to FTP'ing into CPAN and just grabbing the "latest version" - i.e. the 5.53_95 tarball. He didn't use CPAN.pm after all. I couldn't get CPAN.pm to fetch the dev tarball either. I just figured he was too new to Perl and Solaris (a former MCSE) to grab a tarball and install. Turns out, he was too new. He just didn't know about CPAN.pm! Anyway, I missed your (Cliff's) one-line patch to LWP::UserAgent.pm and thought it was the more extensive earlier patch. My vote is for Cliff's patch to just 'use URI::URL;' in LWP::UserAgent.pm. If you don't feel like patching, remember to export PERL_HTTP_URI_CLASS=URI::URL instead. Mike808/ > Stas Bekman wrote: > > What version of CPAN.pm are you using? CPAN.pm never picks distros with > > '_' in the version part. I've just performed checking I've got > > 5.53.tar.gz. Then you shouldn't be having the missing URI::URL problem in mod_perl. Or has the "real" 5.53 been fubar'd since April or so, and nobody noticed until now? Mike808/ -- perl -le "$_='7284254074:0930970:H4012816';tr[0->][ BOPEN!SMUT];print"
Need help with Apache::AuthDBI
Hi, I am having problem getting Apache::AuthDBI working. It seems like its allowing user access anywaysie I have tried it with valid user and invalid username, valid password and invalid password and in all cases it lets you inhere is some supporting data I have the following Apache and mod_perl version... [Sun Aug 26 19:56:44 2001] [notice] Apache/1.3.12 (Unix) (Red Hat/Linux) mod_ssl/2.6.6 OpenSSL/0.9.5a mod_perl/1.24 configured -- resuming normal operations I also have the following virtual host definition in my httpd.conf. Note I'm simply requiring a startup.pl file. Hi, I am having problem getting Apache::AuthDBI working. It seems like its allowing user access anywaysie I have tried it with valid user and invalid username, valid password and invalid password and in all cases it lets you inhere is some supporting data I have the following Apache and mod_perl version... [Sun Aug 26 19:56:44 2001] [notice] Apache/1.3.12 (Unix) (Red Hat/Linux) mod_ssl/2.6.6 OpenSSL/0.9.5a mod_perl/1.24 configured -- resuming normal operations I also have the following virtual host definition in my httpd.conf. Note I'm simply requiring a startup.pl file. ServerName www.joe.com ServerAdmin [EMAIL PROTECTED] DocumentRoot /web/joe ErrorLog /etc/httpd/logs/joe/error_log TransferLog /etc/httpd/logs/joe/access_log PerlRequire /web/joe/mod_perl/startup.pl Options Indexes Includes FollowSymLinks ExecCGI AddHandler cgi-script .cgi AllowOverride All ScriptAlias /cgi-bin/ "/web/joe/cgi-bin/" I also have a statup.pl file that reads #!/usr/bin/perl use Apache::DBI; use Apache::AuthDBI; use Carp; warn("in startup"); $Apache::DBI::DEBUG = 2; $Apache::AuthDBI::DEBUG = 2; And finally I have a .htaccess that reads Hi, I am having problem getting Apache::AuthDBI working. It seems like its allowing user access anywaysie I have tried it with valid user and invalid username, valid password and invalid password and in all cases it lets you inhere is some supporting data I have the following Apache and mod_perl version... [Sun Aug 26 19:56:44 2001] [notice] Apache/1.3.12 (Unix) (Red Hat/Linux) mod_ssl/2.6.6 OpenSSL/0.9.5a mod_perl/1.24 configured -- resuming normal operations I also have the following virtual host definition in my httpd.conf. Note I'm simply requiring a startup.pl file. ServerName www.joe.com ServerAdmin [EMAIL PROTECTED] DocumentRoot /web/joe ErrorLog /etc/httpd/logs/joe/error_log TransferLog /etc/httpd/logs/joe/access_log PerlRequire /web/joe/mod_perl/startup.pl Options Indexes Includes FollowSymLinks ExecCGI AddHandler cgi-script .cgi AllowOverride All ScriptAlias /cgi-bin/ "/web/joe/cgi-bin/" I also have a statup.pl file that reads #!/usr/bin/perl use Apache::DBI; use Apache::AuthDBI; use Carp; warn("in startup"); $Apache::DBI::DEBUG = 2; $Apache::AuthDBI::DEBUG = 2; And finally I have a .htaccess that reads AuthName DBI AuthType Basic PerlAuthenHandler Apache::AuthDBI::authen PerlAuthzHandler Apache::AuthDBI::authz PerlSetVar Auth_DBI_data_source "dbi:informix:joe@docware" PerlSetVar Auth_DBI_username PerlSetVar Auth_DBI_password PerlSetVar Auth_DBI_pwd_table users PerlSetVar Auth_DBI_uid_field user_name PerlSetVar Auth_DBI_grp_whereclause "and user_passwd = $ENV{REMOTE_PASSWD}" PerlSetVar Auth_DBI_pwd_field user_passwd PerlSetVar Auth_DBI_grp_field user_name PerlSetVar Auth_DBI_encrypted off PerlSetVar Auth_DBI_uidcasesensitive off PerlSetVar Auth_DBI_authoritative on require valid-user And the error log shows 31496 Apache::AuthDBI::authen passwd not found in cache == 31496 Apache::AuthDBI::authz request type = >initial main< 31496 Apache::AuthDBI::authz user sent = >medi< 31496 Apache::AuthDBI::authz requirements: valid-user=>1< user=>< group=>< 31496 Apache::AuthDBI::authz user_result = OK: valid-user 31496 Apache::AuthDBI::authz return OK I have followed step by step instructions of Apache::AuthDBI and I can not get this thing to workperhaps I'm overlooking something >From my understanding of Authentication and Authorization, it looks like in spite of Auth_DBI_authoritative being set, the authorization (or authentication) is not doing its job of rejectting and returning an OK Can someone help please... -- - Medi Montaseri [EMAIL PROTECTED] Unix Distributed Systems EngineerHTTP://www.CyberShell.com CyberShell Engineering -
ANNOUNCEMENT: HTML::Template::Expr 0.01
CHANGES First Release! DESCRIPTION This module provides an extension to HTML::Template which allows expressions in the template syntax. This is purely an addition - all the normal HTML::Template options, syntax and behaviors will still work. Expression support includes comparisons, math operations, string operations and a mechanism to allow you add your own functions at runtime. AVAILABILITY This module is available on SourceForge. Download it at: http://prdownloads.sourceforge.net/html-template/HTML-Template-Expr-0.01.tar.gz The module is also available on CPAN. You can get it using CPAN.pm or go to: http://www.cpan.org/authors/id/S/SA/SAMTREGAR/ CONTACT INFO You can join the HTML::Template mailing-list by sending a blank message to [EMAIL PROTECTED]
ANNOUNCEMENT: HTML::Template 2.4
HTML::Template - a Perl module to use HTML Templates CHANGES 2.4 - Bug Fix: case_sensitive option broke loops (Peter Leonard) - Bug Fix: code-ref params now work with IF and UNLESS DESCRIPTION This module attempts make using HTML templates simple and natural. It extends standard HTML with a few new HTML-esque tags - , , , , and . The file written with HTML and these new tags is called a template. It is usually saved separate from your script - possibly even created by someone else! Using this module you fill in the values for the variables, loops and branches declared in the template. This allows you to seperate design - the HTML - from the data, which you generate in the Perl script. A Japanese translation of the documentation is available at: http://member.nifty.ne.jp/hippo2000/perltips/html/template.htm This module is licenced under the GPL. See the LICENCE section of the README. AVAILABILITY This module is available on SourceForge. Download it at: http://prdownloads.sourceforge.net/html-template/HTML-Template-2.4.tar.gz The module is also available on CPAN. You can get it using CPAN.pm or go to: http://www.cpan.org/authors/id/S/SA/SAMTREGAR/ MOTIVATION It is true that there are a number of packages out there to do HTML templates. On the one hand you have things like HTML::Embperl which allows you to freely mix Perl with HTML. On the other hand lie home-grown variable substitution solutions. Hopefully the module can find a place between the two. One advantage of this module over a full HTML::Embperl-esque solution is that it enforces an important divide - design and programming. By limiting the programmer to just using simple variables and loops in the HTML, the template remains accessible to designers and other non-perl people. The use of HTML-esque syntax goes further to make the format understandable to others. In the future this similarity could be used to extend existing HTML editors/analyzers to support this syntax. An advantage of this module over home-grown tag-replacement schemes is the support for loops. In my work I am often called on to produce tables of data in html. Producing them using simplistic HTML templates results in CGIs containing lots of HTML since the HTML itself could not represent loops. The introduction of loop statements in the HTML simplifies this situation considerably. The designer can layout a single row and the programmer can fill it in as many times as necessary - all they must agree on is the parameter names. For all that, I think the best thing about this module is that it does just one thing and it does it quickly and carefully. It doesn't try to replace Perl and HTML, it just augments them to interact a little better. And it's pretty fast. DOCUMENTATION The documentation is in Template.pm in the form of POD format perldocs. Even the above text might be out of date, so be sure to check the perldocs for the straight truth. CONTACT INFO This module was written by Sam Tregar ([EMAIL PROTECTED]) for Vanguard Media (http://www.vm.com). You can join the HTML::Template mailing-list by sending a blank message to [EMAIL PROTECTED]
Need help with Apache::AuthDBI
Hi, I am having problem getting Apache::AuthDBI working. It seems like its allowing user access anywaysie I have tried it with valid user and invalid username, valid password and invalid password and in all cases it lets you inhere is some supporting data I have the following Apache and mod_perl version... [Sun Aug 26 19:56:44 2001] [notice] Apache/1.3.12 (Unix) (Red Hat/Linux) mod_ssl/2.6.6 OpenSSL/0.9.5a mod_perl/1.24 configured -- resuming normal operations I also have the following virtual host definition in my httpd.conf. Note I'm simply requiring a startup.pl file. ServerName www.joe.com ServerAdmin [EMAIL PROTECTED] DocumentRoot /web/joe ErrorLog /etc/httpd/logs/joe/error_log TransferLog /etc/httpd/logs/joe/access_log PerlRequire /web/joe/mod_perl/startup.pl Options Indexes Includes FollowSymLinks ExecCGI AddHandler cgi-script .cgi AllowOverride All ScriptAlias /cgi-bin/ "/web/joe/cgi-bin/" I also have a statup.pl file that reads #!/usr/bin/perl use Apache::DBI; use Apache::AuthDBI; use Carp; warn("in startup"); $Apache::DBI::DEBUG = 2; $Apache::AuthDBI::DEBUG = 2; And finally I have a .htaccess that reads AuthName DBI AuthType Basic PerlAuthenHandler Apache::AuthDBI::authen PerlAuthzHandler Apache::AuthDBI::authz PerlSetVar Auth_DBI_data_source "dbi:informix:joe@docware" PerlSetVar Auth_DBI_username PerlSetVar Auth_DBI_password PerlSetVar Auth_DBI_pwd_table users PerlSetVar Auth_DBI_uid_field user_name PerlSetVar Auth_DBI_grp_whereclause "and user_passwd = $ENV{REMOTE_PASSWD}" PerlSetVar Auth_DBI_pwd_field user_passwd PerlSetVar Auth_DBI_grp_field user_name PerlSetVar Auth_DBI_encrypted off PerlSetVar Auth_DBI_uidcasesensitive off PerlSetVar Auth_DBI_authoritative on require valid-user And the error log shows 31496 Apache::AuthDBI::authen passwd not found in cache == 31496 Apache::AuthDBI::authz request type = >initial main< 31496 Apache::AuthDBI::authz user sent = >medi< 31496 Apache::AuthDBI::authz requirements: valid-user=>1< user=>< group=>< 31496 Apache::AuthDBI::authz user_result = OK: valid-user 31496 Apache::AuthDBI::authz return OK I have followed step by step instructions of Apache::AuthDBI and I can not get this thing to workperhaps I'm overlooking something From my understanding of Authentication and Authorization, it looks like in spite of Auth_DBI_authoritative being set, the authorization (or authentication) is not doing its job of rejectting and returning an OK Can someone help please... -- === Medi Montaseri, [EMAIL PROTECTED], 408-450-7114 Prepass Inc, IT/Operations, Software Eng. ===
Perl & Javascript Q
Hi, I am creating a perl script that creates an HTML document. And then on the javascript side, it calls the script thru . The idea is for users to copy and paste this one line of javascript into there index page and "Yeah" an html page loads. But right now it prints out nothing. At the end of my perl script is "print document.writeln(' html doc here ');"; . I don't know what I missing to get this to work.A couple of newsfeeds use this idea to deliver news headlines in partner sites.I am trying to do the same thing, but with a customized html page. Any thoughts ? Thanks so much, LT __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
Re: URI::URL - problem in LWP 5.53_95 with mod_perl
i did not use CPAN.pm to install software on this particular machine. my mod_perl builds are always by hand. i did understand exactly why this happened. i should have made that more clear in my first e-mail. i made the patch that i did, so i would not have the same problem with any other software. Stas Bekman wrote: > On Sat, 25 Aug 101 [EMAIL PROTECTED] wrote: > > [snip] > > > He's right, and this is exactly what's happened in mod_perl. > > It's a bug *caused* by recent changes in LWP, and not a bug in LWP, per se. > > >From Gisle Aas' directory in CPAN, you can see: > > > > 04/10/01 06:15PM157,267 libwww-perl-5.53.tar.gz > > 05/05/01 08:57AM172,925 libwww-perl-5.53_94.tar.gz > > 08/06/01 07:46PM174,613 libwww-perl-5.53_95.tar.gz > > > > >From the "official" website, http://www.linpro.no/lwp, he says the > > lastest version is 5.53 from 4/10/01. However, if you use the CPAN module, > > you will pickup the 5.53_95 version instead. This is the version (and > > maybe 5.53_94 as well, but I haven't checked) that makes mod_perl break. > > Or maybe some interim versions of the CPAN module are downloading > > this development version of the module, I'm not sure. > > What version of CPAN.pm are you using? CPAN.pm never picks distros with > '_' in the version part. I've just performed checking I've got > 5.53.tar.gz. > > -- ___cliff [EMAIL PROTECTED]http://www.genwax.com/
Re: httpd.conf - caching
[EMAIL PROTECTED] (allan) wrote: >im experiencing some heavy modoule-caching annoyance i guess. if i run the >simple hello.pm (see below) and make a very small change - the change >might take effect immidiately in the browser but more frequently it will >show a cached version of the page. The guide is your friend: http://perl.apache.org/guide/porting.html#Reloading_Modules_and_Required_F Looks like most of the stuff on that page might make good reading for you, based on your background. For overview purposes, the primary resources for help are the docs, the guide, and this list. Then there's the Eagle book, and a couple books still in the pipeline... ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Re: httpd.conf - caching
On Mon, 27 Aug 2001 [EMAIL PROTECTED] wrote: > > Do you know why you are running mod_perl with your apache? > > to be honest, not entirely :-) Aha. > > > The "modoule-caching annoyance" you speak of is the basic reason for the > > existence of mod_perl ... the idea is that the perl code in your module > > only gets compiled once rather than every time a user requests the URI. > > true, but if it *never* gets recompiled there are reasons to worry. Well, when I say "only gets compiled once" I mean once per child process. You can control how many requests each child handles before it biffs (thus forcing the parent to spawn a new child who will recompile the code) in the httpd.conf file. - nick
RE: open downloaded file
> -Original Message- > From: Thomas Bach [mailto:[EMAIL PROTECTED]] > Sent: Monday, August 27, 2001 8:45 AM > To: [EMAIL PROTECTED] > Subject: open downloaded file > > > hi list > > i've a handler which controlls access to dowonloadable files. > The proble i > have is now, that IE (project designed only for this browser) > prints one or > twoo times the same "File download"-window where you can > choose between > open or save if you choose open. If you choose save all is going well. > > i had to force a download, because of some pdf-problems (on > some systems, > the acrobat reader-plugin doesn't print the content - in the > server-logs > was all ok.) I've noticed on my version of MSIE that it does not handle PDFs in any form without an Accept-Ranges header. I tried looking for bug reports, but I couldn't find any, so I figured it was just me... > so that's why there's 'application/octet-stream' and > "Content-Disposition" => "attachment;" try $r->headers_out->set("Content-Disposition" => "inline; filename=$filename"); really, for the If-Modified-Since header and byteserving in general you ought to use the supplied mod_perl methods $r->meets_conditions and $r->set_byterange/each_byterange... try something like this instead for static files... # set the the headers $r->headers_out->set('Accept-Ranges' => 'bytes'); $r->headers_out->set("Content-Disposition" => "inline; filename=$filename"); $r->set_content_length(-s $r->finfo); # set the MIME type based on the document extension $r->content_type(MIME::Types::by_suffix($filename)->[0]); # determine if the request is a range request my $range_request = $r->set_byterange; # yea or nea if ((my $status = $r->meets_conditions) == OK) { $r->send_http_header; } else { return $status; } # handle a range request properly if ($range_request) { while( my($offset, $length) = $r->each_byterange) { seek $fh, $offset, 0; $r->send_fd($fh, $length); } } else { $r->send_fd($fh); } HTH --Geoff
open downloaded file
hi list i've a handler which controlls access to dowonloadable files. The proble i have is now, that IE (project designed only for this browser) prints one or twoo times the same "File download"-window where you can choose between open or save if you choose open. If you choose save all is going well. i had to force a download, because of some pdf-problems (on some systems, the acrobat reader-plugin doesn't print the content - in the server-logs was all ok.) so that's why there's 'application/octet-stream' and "Content-Disposition" => "attachment;" Perhaps this could be an ie-problem, but since I've to solve it with mod_perl i thougt that one of you could know a solution ... if (exists($requestvars{'If-Modified-Since'})) { if (&changed) { $r->content_type($contenttypes{$datype}); if ($contenttypes{$datype} eq 'application/octet-stream') { $r->header_out("Content-Disposition" => "attachment;"); }; $r->status(HTTP_NOT_MODIFIED); $r->send_http_header(); return OK; }; }; $r->content_type($contenttypes{$datype}); $r->update_mtime($data[0]); $r->set_last_modified(); if ($contenttypes{$datype} eq 'application/octet-stream') { $r->header_out("Content-Disposition" => "attachment;"); }; $r->send_http_header(); return OK if $r->header_only; $r->send_fd($file); return OK; . . . any ideas ? what I'm doing wrong? Thanks in advance!! Thomas Bach <><><><> think karo .. www.bkaro.net
Re: httpd.conf - caching
nick thanks for the reply, and pointers - i guess i have completely lost overview thru the installation mist om mac osX. most of my questions were indeed more apache than mod_perl. > Do you know why you are running mod_perl with your apache? to be honest, not entirely :-) > The "modoule-caching annoyance" you speak of is the basic reason for the > existence of mod_perl ... the idea is that the perl code in your module > only gets compiled once rather than every time a user requests the URI. true, but if it *never* gets recompiled there are reasons to worry. > There are quite a lot of talk about global variables, actually. It's a > pretty big deal with this stuff. You need to go to the mod_perl guide, > and > spend _SEVERAL HOURS_ reading it and playing with your installation. If > you devote the necessary time to educating yourself, you'll figure most > of it out, and you can bring your tough questions to this list. well to me this is a tough situation and i have spend _SEVERAL HOURS_ reading it. anyway thanks again - i figure my real problem is, as you mention yourself, in understanding apache before mod_perl. allan
build problem on Solaris (fwd)
Zhong Quan, please re-read http://perl.apache.org/guide/help.html#Contacting_me, you should post questions to the list and not directly to me. Let's see if anybody using Solaris knows about this problem. -- Forwarded message -- Date: Mon, 27 Aug 2001 17:19:00 +0800 From: "Mao, Zhong Quan (James)" <[EMAIL PROTECTED]> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> Cc: "Mao, Zhong Quan (James)" <[EMAIL PROTECTED]> Subject: mod_perl guide corrections. Thank you for your very good web site and document for mod_perl. But when I install it,some errors occured. The following is the error message: ** A test compilation with your Makefile configuration ** failed. The below error output from the compilation ** test will give you an idea what is failing. Note that ** Apache requires an ANSI C Compiler, such as gcc. Error Output for sanity check cd ..; gcc -DSOLARIS2=260 -DMOD_PERL -DUSE_PERL_SSI -DUSE_EXPAT -I./lib/expat-lite -DNO_DL_NEEDED `perl -MExtUtils::Embed -e ccopts` -I. -I/opt/exp/perl/lib/5.00503/sun4-solaris/CORE-o helpers/dummy helpers/dummy.c `perl -MExtUtils::Embed -e ldopts` -lsocket -lnsl /opt/exp/perl/lib/5.00503/sun4-solaris/auto/DynaLoader/DynaLoader.a -L/opt/exp/perl/lib/5.00503/sun4-solaris/CORE -lperl -lsocket -lnsl -ldl -lm -lc -lcrypt Undefined first referenced symbol in file _delete /usr/lib/libgen.so.1 _insert /usr/lib/libgen.so.1 ld: fatal: Symbol referencing errors. No output written to helpers/dummy *** Error code 1 make: Fatal error: Command failed for target `dummy' = End of Error Report = Aborting! Can you tell me what's the problem? Thanks! James mao
mod_perl memory consumption
BlankI wrote a program that converts 5 gigs of emails stored in mysql to phisical messages on disk (resulting in approximately 10 gigs). The program consumes way to much memory although I've wrote it in a very clean way (use strict, no globals, use of udef $var; to help free memory). I start it telneting to :80 and through time process takes from 15 megs to more than 100 megs and only about 20% of messages are converted so far. The program uses vpopmail.pm and should run approximately one day. Maybe it would be faster if I used Apache::FakeRequest or something similar eleminating use of mod_perl (plain cgi) ? I'm using HTML::Mason. Why is the memory consumption so high ? According to my calculations it should take less than 100 kilobytes. Regards, Mire -- perl -Mstrict -e 'print pack("h*", "d69627560496e616d656e236f6d6"),"\n"' OPTIMISED FOR HUMAN OPTICAL NERVE BEST VIEWED WITH A MONITOR