Re: Class data & preloading modules
> * initialize everything in the parent Apache, just make sure to create > new DBI connections in the children. That's what I would do. It increases the amount of shared memory. Disconnect the DBI connection when you're done with it. Apache::DBI doesn't cache connections during startup, so this shouldn't be a problem. - Perrin
Re: array's first element is empty
> Not sure if this is mod_perl related, but i hope someone can help me > anyway. When i do DBI queries from mod_perl handler and put all returned > results in array then array's first element is empty, I wonder why? I > don't like to shift off first element every time i return the result. > Has anyone seen this before and what could cause this? Unless you see different behavior when running under CGI, this is not a mod_perl question. I suggest you ask it on http://perlmonks.org/ and post a code sample with your question. - Perrin
Re: Problem with asp module and apache on win98
[[ repost from Apache::ASP list ]] Giorgio D'Anna wrote: > > before I got another error too: > "flock() unimplemented on this platform at /apache/lib/perl/ > MLDBM/Sync.pm line xxx" > but I commented out some lines in sync.pm and so I fixed that. > Anyway, since I have read on the documentation that it is possible to > "disable use of flock() on Win95/98 where it is unimplemented" > I'd want to know how I can do this (instead of commenting out). > Install a fresh MLDBM::Sync, and then add this to your httpd.conf file: *CORE::GLOBAL::flock = sub { 1 }; This is to define a flock to effectively nothing, which will be fine on win98 for now since mod_perl is serialized on this platform. I believe this will only work with perl 5.6, but when working things out with someone else recently, this seems to do the trick. If you plan any network communications on win32 apache/mod_perl via perl I would also recommend that you set MaxThreadsPerChild to 1 which will get rid of odd socket problems. --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Upgrade Perl to 5.6.1and mod_perl still see 5.6.0
On Fri, 23 Nov 2001, Hans Poo wrote: > I've just installed a redhat 7.2 machine. > > I the installed Apache::ASP using CPAN, and ended upgrading to perl 5.6.1. > > After restarting httpd. i noticed that mod_perl is still int he old libraries. Did you rebuild mod_perl? If not, it's still the 5.6.0 version fo the interpreter. -- Brett http://www.chapelperilous.net/ Alden's Laws: (1) Giving away baby clothes and furniture is the major cause of pregnancy. (2) Always be backlit. (3) Sit down whenever possible.
Re: Can you help?
Gill wrote: > I hope you can help... > > I have untarred the mod_perl file. > I run ./configure --add-module=/mod_perl.c http://perl.apache.org/guide/install.html _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://ticketmaster.com http://apacheweek.com http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: [OT] A couple of dubious network problems...
Dave Hodgkinson wrote: > 1. On a RH6.0 (yes, ick) box without persistent DBI connections, the > server side of the DBD::mysql connection was successfully closed > (netstat shows nothing), but the client side shows a TIME_WAIT state, > which hangs around for 30 seconds or so before > disappearing. Obviously, using Apache::DBI makes this go away, but > it's disturbing nonetheless. Does this ring any bells? Dunno about number 2, but 1 is perfectly normal. TIME_WAIT is a condition the OS puts a closed socket into to prevent another app from using the socket, just in case the peer host has any more packets to send to that port. The host that closes the socket will put the old socket into TIME_WAIT. BSD IP stack implementations keep sockets in time_wait for about 30 seconds, others go up to 2 minutes. The duration is called 2MSL (2 * max_segment_lifetime). Don't worry about it and dont mess with it (unless you're consuming 64000+ sockets per 30 seconds, in which case you have other problems to deal with ;-) ~mark
Re: [OT] Re: search.cpan.org
On Tue, 27 Nov 2001, Bill Moseley wrote: > At 12:55 PM 11/27/01 -0800, Nick Tonkin wrote: > > > >Because it does a full text search of all the contents of the DB. > > Perhaps, but it's just overloaded. I think the load, and network connection, is the main reason; the search itself, if you were connected locally at a time when the machine isn't so busy, is pretty quick. > I'm sure he's working on it, but anyone want of offer Graham free hosting? > A few mirrors would be nice, too. They (Graham and Elaine) are aware that it can be slow at times, and have set up at least one mirror site to help spread the load. best regards, randy kobes
Re: Upgrade Perl to 5.6.1and mod_perl still see 5.6.0
> I the installed Apache::ASP using CPAN, and ended upgrading to perl 5.6.1. > > After restarting httpd. i noticed that mod_perl is still int he old libraries. Recompile mod_perl. - Perrin
Re: Deleting a cookie
El Mar 27 Nov 2001 10:21, Jon Robison escribió: > I have created a login system using the wonderful Ticket system from the > Eagle book. I have modified TicketAccess so that after authentication, > it reviews the arguments in the query string and does push_handler, the > handler being chosen based on the args. > > My only problem is that I want to provide the users with a logout button > which will delete the cookie from thier browser, yet I cannot find how!. > I have reviewed every module on my system with 'Cookie' in the name > (Apache::Cookie, CGI::Cookie, etc.) and nowhere does it tell how to do > this. There is a small mention of changing the expiration to < 0, but > apparently I am doing it wrong (possible confusing point is the use of > an 'expires' value in the cookie itself, seperate, I think, from the > 'expires' attribute on the cookie?) > > I know it is a lot to ask, but I am relatively new to this part of > mod_perl (pushing handlers, etc.), so if anyone can look at this and > replace my BLOCKED comments with a couple of helpfull lines, I would > greatly appreciate it! > > Thanks in advance - > > Jonathon Robison > > > Below is my modified TicketAccess, as well as the Logout module I am > re-directing to for logout action: > = > package FES::Apache::TicketAccess; > > use strict; > use Apache::Constants qw(:common); > use FES::Apache::TicketTool (); > > sub handler { > my $r = shift; > my %input = $r->args; > # for checking input items > my $ticketTool = FES::Apache::TicketTool->new($r); > my($result, $msg) = $ticketTool->verify_ticket($r); > unless ($result) { > $r->log_reason($msg, $r->filename); > my $cookie = $ticketTool->make_return_address($r); > $r->err_headers_out->add('Set-Cookie' => $cookie); > return FORBIDDEN; > } > ## Here is where we need to insert a push_handler insert. I won't need > ## the requested uri from the $r, since the $r goes along for the ride > in## push_handler > > my $action = defined $input{'act'} ? $input{'act'} : 'view'; > > print STDERR "action is defined as $action\n"; ## DEBUGGING > > if ($action eq 'logout') { > $r->push_handlers('PerlHandler' => 'FES::Control::Logout'); > return OK; > } elsif ($action eq 'view') { > $r->push_handlers('PerlHandler' => 'FES::Control::View'); > return OK; > } else { > $r->push_handlers('PerlHandler' => 'FES::Control::View'); > return OK; > } >## ARE THOSE THE CORRECT THINGS TO 'RETURN' FOR THESE CASES? > > } > > 1; > == > > And the Logout.pm: > > = > package FES::Control::Logout; > > use strict; > use Apache; > use Apache::Constants qw(:common); > use FES::Common::Common qw( header footer); > use CGI qw/:standard/; > use CGI::Cookie; > > sub handler { > my $r = shift; > my $q = new CGI; > my $ticket = _get_ticket('r' => $r); > > ## HERE IS WHERE I NEED TO 1.) DELETE USER'S TICKET COOKIE AND > ## 2.) REDIRECT THEM TO "/FES" (w/o bringing old > $r),(WHERE THEY SHOULD GET > ## A NEW LOGIN SCREEN BECAUSE COOKIE IS > GONE.) > > } > > sub _get_ticket { > my $args = { > 'r' => undef, > @_ > }; > my $r = $args->{'r'}; > my %cookies = CGI::Cookie->parse($r->header_in('Cookie')); > # TESTING > my %ticket = $cookies{'Ticket'}->value; # TESTING > return \%ticket; > } > > 1; > = Set it again with an expiration time of 'now', i actually use it with CGI.pm You can send it with a custom invalid value, like 'invalidated', and take apropriate actions. Hans Poo
Problem with asp module and apache on win98
Hi, I have installed apache server on windows98 with modperl and apache::asp module, but I can't make it working. I have put this in httpd.conf: SetHandler perl-script PerlHandler Apache::ASP PerlSetVar Global C:/Windows/temp PerlSetVar CookiePath / PerlSetVar AllowSessionState 1 PerlSetVar SessionTimeout 20 PerlSetVar Debug 2 PerlSetVar BufferingOn 1 PerlSetVar StatINC 1 PerlSetVar SessionSerialize 0 PerlSetVar SoftRedirect 0 PerlSetVar NoState 0 PerlSetVar StateDir ./.state PerlSetVar StateManager 10 When I try to run in my browser an ASP page I get an internal error (500) and this is the error.log: [Mon Nov 26 03:39:00 2001] [error] Can't call method "FETCH" on an undefined value at /apache/lib/perl/MLDBM/Sync.pm line 86. MLDBM::Sync::AUTOLOAD('MLDBM::Sync=HASH(0x114a1f8)', 'application') called at D:/Perl/site/lib/Apache/ASP.pm line 5221 Apache::ASP::State::FETCH('Apache::ASP::State=HASH(0x114b36c)', 'application') called at D:/Perl/site/lib/Apache/ASP.pm line 4954 Apache::ASP::State::new('Apache::ASP=HASH(0x114bf48)', 'application', 'server') called at D:/Perl/site/lib/Apache/ASP.pm line 5208 Apache::ASP::State::TIEHASH('Apache::ASP::State', 'Apache::ASP=HASH(0x114bf48)', 'application', 'server') called at D:/Perl/site/lib/Apache/ASP.pm line 4530 Apache::ASP::Application::new('Apache::ASP=HASH(0x114bf48)') called at D:/Perl/site/lib/Apache/ASP.pm line 563 Apache::ASP::new('Apache::ASP', 'Apache=SCALAR(0x140e638)') called at D:/Perl/site/lib/Apache/ASP.pm line 148 Apache::ASP::handler('Apache=SCALAR(0x140e638)') called at nul line 0 eval {...} called at nul line 0 Could anyone help me? Thanks in advance. -- G.d'A. P.S.: before I got another error too: "flock() unimplemented on this platform at /apache/lib/perl/ MLDBM/Sync.pm line xxx" but I commented out some lines in sync.pm and so I fixed that. Anyway, since I have read on the documentation that it is possible to "disable use of flock() on Win95/98 where it is unimplemented" I'd want to know how I can do this (instead of commenting out).
Re: [modperl-site design challenge] Thomas Klausner (domm)
on 26.11.01 17:14, John Saylor at [EMAIL PROTECTED] wrote: > Hi > > ( 01.11.25 22:37 +0100 ) Thomas Klausner: >> You can look at my idea of the the new modperl-site design here: >> http://domm.zsi.at/modperl-site-domm/ > Nice work! Is it all right to talk details? In my opinion something like: .content { line-height: 130%; } ... can improve readability quite a lot. mathias
[OT] A couple of weird network problems...
I was at a client site last week and we saw two Apache/mod_perl related network problems: 1. On one particular handler, a $r->print() looks good and yet it's truncated my the time it gets to the browser. This is on Linux and Solaris, Apache 1.3.14 and early 1.2x mod_perl. Does this ring any bells? 2. On an Apache that's using DBI (_not_ Apache::DBI) and frequently making connections and closing them, the MySQL end appears to close out properly, but the client side ends up with loads of connections in TIME_WAIT and eventually we run out of sockets. This is on Linux. IS this expected? Obviously making connections persistent is a Good Thing, but is a TIME_WAIT expected? Not strictly mod_perl related, but if anyone has a clue, I'd appreciate it! Ta, Dave -- David Hodgkinson, Wizard for Hirehttp://www.davehodgkinson.com Editor-in-chief, The Highway Star http://www.deep-purple.com Deep Purple Family Tree news http://www.slashrock.com Interim Technical Director, Web Architecture Consultant for hire
[OT] A couple of weird network problems...
I was at a client site last week and we saw two Apache/mod_perl related network problems: 1. On one particular handler, a $r->print() looks good and yet it's truncated my the time it gets to the browser. This is on Linux and Solaris, Apache 1.3.14 and early 1.2x mod_perl. Does this ring any bells? 2. On an Apache that's using DBI (_not_ Apache::DBI) and frequently making connections and closing them, the MySQL end appears to close out properly, but the client side ends up with loads of connections in TIME_WAIT and eventually we run out of sockets. This is on Linux. IS this expected? Obviously making connections persistent is a Good Thing, but is a TIME_WAIT expected? Not strictly mod_perl related, but if anyone has a clue, I'd appreciate it! Ta, Dave
Upgrade Perl to 5.6.1and mod_perl still see 5.6.0
I've just installed a redhat 7.2 machine. I the installed Apache::ASP using CPAN, and ended upgrading to perl 5.6.1. After restarting httpd. i noticed that mod_perl is still int he old libraries. The test are: 1.- @INC seems fine in the system: # perl -e 'print join "\n", @INC' /usr/local/lib/perl5/5.6.1/i686-linux /usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/site_perl/5.6.1/i686-linux /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl 2.- But mod_perl is still on the old @INC # /etc/rc.d/init.d/httpd start Iniciando httpd: Syntax error on line 1448 of /etc/httpd/conf/httpd.conf: Can't locate Apache/ASP.pm in @INC (@INC contains: /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl . /etc/httpd/ /etc/httpd/lib/perl) at (eval 3) line 3. [FALLÓ] # Hans Poo
[OT] A couple of dubious network problems...
Chaps, Can I pick the wisdom of the hive here please? I witnessed a couple of mod_perl related network problems yesterday which are kind of mod_perl related: 1. On a RH6.0 (yes, ick) box without persistent DBI connections, the server side of the DBD::mysql connection was successfully closed (netstat shows nothing), but the client side shows a TIME_WAIT state, which hangs around for 30 seconds or so before disappearing. Obviously, using Apache::DBI makes this go away, but it's disturbing nonetheless. Does this ring any bells? 2. On both RH6 (in the office) and Solaris (at the co-lo) with a middling-recent Apache and mod_perl, some pages were getting truncated when sent to the browser. This happens on a variety of browsers and a variety of pages. Once it happens on a particular combination of page and browser it's reproducible. Now, the page is definitely being completely sent to $r-print(), but it's not making it to the browser (or at least that's what tcpdump shows). Again, any bells ringing? Thanks, Dave
Help with AuthDBI, getting stuck :-/
Hi guys, I'm totally stuck with this, and I'm desperate to get a working solution. I have a Tru64 Unix machine, running mod_perl-1.26, Apache 1.3.22 and I've installed the ApacheDBI-0.88 and DBI-1.18 stuff. I am connecting to an Oracle database on another host, running 8.1.6 client libs on the web host. Oracle's sqlplus works perfectly fine to test the DB connection. I've got the following in my httpd.conf SetEnv ORACLE_BASE "/usr/local/oracle" SetEnv ORACLE_HOME "/usr/local/oracle/product/8.1.6" PassEnv ORACLE_BASE PassEnv ORACLE_HOME SetEnv ORAENV_ASK NO SetEnv LD_LIBRARY_PATH "/usr/local/lib:/usr/local/oracle/product/8.1.6/lib" SetEnv ORACLE_SID ACNTS PerlModule Apache::AuthDBI PerlRequire /usr/local/WWW/apache-1.3.22/conf/startup.pl I then have this in the .htaccess file of the folder I'm trying to protect: AuthName "DBI Login" AuthType Basic PerlAuthenHandler Apache::AuthDBI::authen PerlSetVar Auth_DBI_data_source dbi:Oracle:ACNTS PerlSetVar Auth_DBI_username acnts_user PerlSetVar Auth_DBI_password acnts_password # DBI->connect($data_source, $username, $password) PerlSetVar Auth_DBI_pwd_table stud_security PerlSetVar Auth_DBI_uid_field username PerlSetVar Auth_DBI_pwd_field sys.pass_dec(password) #SELECT pwd_field FROM pwd_table WHERE uid_field=$user #PerlSetVar Auth_DBI_encrypted off #PerlSetVar Auth_DBI_authoritative on #PerlSetVar Auth_DBI_nopasswd off require valid-user I have the following in my startup.pl file #!/usr/local/bin/perl -w # to load this file when the server starts, add this to httpd.conf: # PerlRequire /path/to/startup.pl # make sure we are in a sane environment. $ENV{GATEWAY_INTERFACE} =~ /^CGI-Perl/ or die "GATEWAY_INTERFACE not Perl!"; use Apache::Registry; use Apache::Status; use Apache::DBI; use Apache::AuthDBI; use strict; # optional configuration for Apache::DBI.pm: # choose debug output: 0 = off, 1 = quiet, 2 = chatty $Apache::DBI::DEBUG = 2; # configure all connections which should be established during server startup. # keep in mind, that if the connect does not succeeed, your server won't start # until the connect times out (database dependent) ! # you may use a DSN with attribute settings specified within Apache::DBI->connect_on_init("dbi:Oracle(AutoCommit=>1):ACNTS", "acntsdba", "acntsdba"); # configure the ping behavior of the persistent database connections # you may NOT not use a DSN with attribute settings specified within # $timeout = 0 -> always ping the database connection (default) # $timeout < 0 -> never ping the database connection # $timeout > 0 -> ping the database connection only if the last access # was more than timeout seconds before my $timeout = 0 ; Apache::DBI->setPingTimeOut("dbi:Oracle:ACNTS", $timeout); # optional configuration for Apache::AuthDBI.pm: # choose debug output: 0 = off, 1 = quiet, 2 = chatty $Apache::AuthDBI::DEBUG = 2; # set lifetime in seconds for the entries in the cache Apache::AuthDBI->setCacheTime(60); # set minimum time in seconds between two runs of the handler which cleans the cache Apache::AuthDBI->setCleanupTime(-1); # use shared memory of given size for the cache #Apache::AuthDBI->initIPC(5); 1; As you can see, this is pretty much textbook configuration from all the man/help/perldoc's I've been able to dig up... Here is a trace from the error.log file: == 5960 Apache::AuthDBI::authen request type = >initial main< REQUEST: GET /PastExams/AssocLogo.gif HTTP/1.1 Accept: */* Accept-Encoding: gzip, deflate Accept-Language: en-au Authorization: Basic dGVzdDp0ZXN0dXNl Connection: Keep-Alive Host: association-test.cqu.edu.au If-Modified-Since: Mon, 30 Apr 2001 04:45:19 GMT If-None-Match: "1d394-1d7d-3aeceddf" Referer: http://association-test.cqu.edu.au/PastExams/ User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) HTTP/1.1 (null) 5960 Apache::AuthDBI::authen get_basic_auth_pw: res = >0<, password sent = >testuse< 5960 Apache::AuthDBI::authen user sent = >test< 5960 Apache::AuthDBI::authen Config{ pwdcasesensitive } = on 5960 Apache::AuthDBI::authen Config{ pwd_whereclause } = 5960 Apache::AuthDBI::authen Config{ placeholder } = off 5960 Apache::AuthDBI::authen Config{ log_field} = 5960 Apache::AuthDBI::authen Config{ uid_field} = username 5960 Apache::AuthDBI::authen Config{ authoritative} = on 5960 Apache::AuthDBI::authen Config{ data_source } = dbi:Oracle:ACNTS 5960 Apache::AuthDBI::authen Config{ grp_field} = 5960 Apache::AuthDBI::authen Config{ encrypted} = on 5960 Apache::AuthDBI::authen Config{ pwd_field} = sys.pass_dec(password) 5960 Apache::AuthDBI::authen Config{ nopasswd } = off 5960 Apache::AuthDBI::authen Config{ grp_table} = 5960 Apache::AuthDBI::authen Config{ pwd_table} = stud_security 5960 Apache::AuthDBI::authen Config{ password } = acnts_password 596
Can you help?
I hope you can help... I have untarred the mod_perl file. I run ./configure --add-module=/mod_perl.c All goes well. Message says third party module copied. I then do a "make" of apache, and I get this: rm -f libextra.a ar cr libextra.a perl.o ar: perl.o: No such file or directory make[4]: *** [libextra.a] Error 1 make[3]: *** [all] Error 1 make[2]: *** [subdirs] Error 1 make[2]: Leaving directory `/home/apache/apache_1.3.22/src' make[1]: *** [build-std] Error 2 make[1]: Leaving directory `/home/apache/apache_1.3.22' make: *** [build] Error 2 I have also tried --activate-module= Bill
Re: DSO Issues
If we're collecting a list of things that don't work in a DSO build, add perl subs (via ). At least, they didn't work as of January of this year. On Tue, 27 Nov 2001, John Chia wrote: > On 27 November 2001 15:17 (-0500), Vivek Khera wrote: > > The *only* issue I encounter is a massive memory leak upon SIGHUP or > > SIGUSR to apache. > > Hm. I only get memory leaks if PerlFreshRestart is enabled and I SIGHUP > it. > > -- Steve Reppucci [EMAIL PROTECTED] | Logical Choice Software http://logsoft.com/ | =-=-=-=-=-=-=-=-=-=- My God! What have I done? -=-=-=-=-=-=-=-=-=-=
Re: DSO Issues
On 27 November 2001 15:17 (-0500), Vivek Khera wrote: > The *only* issue I encounter is a massive memory leak upon SIGHUP or > SIGUSR to apache. Hm. I only get memory leaks if PerlFreshRestart is enabled and I SIGHUP it. -- john chia <[EMAIL PROTECTED]> starnix inc. tollfree: 1-87-pro-linuxthornhill, ontario, canada http://www.starnix.com professional linux services & products
Re: [OT] Re: search.cpan.org
At 09:02 PM 11/27/01 +, Mark Maunder wrote: >I'm using it on our site and searching fulltext >indexes on three fields (including a large text field) in under 3 seconds on over >70,000 records on a p550 with 490 megs of ram. > > Hi Mark, Some day if you are bored, try indexing with swish-e (the development version). http://swish-e.org The big problem with it right now is it doesn't do incremental indexing. One of the developers is trying to get that working with in a few weeks. But for most small sets of files it's not an issue since indexing is so fast. My favorite feature is it can run an external program, such as a perl mbox or html parser or perl spider, or DBI program or whatever to get the source to index. Use it with Cache::Cache and mod_perl and it's nice and fast from page to page of results. Here's indexing only 24,000 files: > ./swish-e -c u -i /usr/doc Indexing Data Source: "File-System" Indexing "/usr/doc" 270279 unique words indexed. 4 properties sorted. 23840 files indexed. 177638538 total bytes. Elapsed time: 00:03:50 CPU time: 00:03:16 Indexing done! Here's searching: > ./swish-e -w install -m 1 # SWISH format: 2.1-dev-24 # Search words: install # Number of hits: 2202 # Search time: 0.006 seconds # Run time: 0.011 seconds A phrase: > ./swish-e -w '"public license"' -m 1 # SWISH format: 2.1-dev-24 # Search words: "public license" # Number of hits: 348 # Search time: 0.007 seconds # Run time: 0.012 seconds 998 /usr/doc/packages/ijb/gpl.html "gpl.html" 26002 A wild card and boolean search: > ./swish-e -w 'sa* or java' -m 1 # SWISH format: 2.1-dev-24 # Search words: sa* or java # Number of hits: 7476 # Search time: 0.082 seconds # Run time: 0.087 seconds Or a good number of results: > ./swish-e -w 'is or und or run' -m 1 # SWISH format: 2.1-dev-24 # Search words: is or und or run # Number of hits: 14477 # Search time: 0.084 seconds # Run time: 0.089 seconds Or everything: > ./swish-e -w 'not dksksks' -m 1 # SWISH format: 2.1-dev-24 # Search words: not dksksks # Number of hits: 23840 # Search time: 0.069 seconds # Run time: 0.074 seconds This is pushing the limit for little old swish, but here's indexing a few more very small xml files (~150 bytes each) 3830016 files indexed. 582898349 total bytes. Elapsed time: 00:48:22 CPU time: 00:44:01 Bill Moseley mailto:[EMAIL PROTECTED]
Re: [OT] search.cpan.org
There's a simple solution: http://kobesearch.cpan.org/
Re: [OT] Re: search.cpan.org
Nick Tonkin wrote: > Because it does a full text search of all the contents of the DB. > Not sure what he's using for a back end, but mysql 4.0 (in alpha) has very fast and feature rich full text searching now, so perhaps he can migrate to that once it's released in December sometime. I'm using it on our site and searching fulltext indexes on three fields (including a large text field) in under 3 seconds on over 70,000 records on a p550 with 490 megs of ram.
Re: Deleting a cookie
Jon Robison wrote: > I have created a login system using the wonderful Ticket system from the > Eagle book. I have modified TicketAccess so that after authentication, > it reviews the arguments in the query string and does push_handler, the > handler being chosen based on the args. > > My only problem is that I want to provide the users with a logout button > which will delete the cookie from thier browser, yet I cannot find how!. Jon, I had the same problem and could not succesfully delete the cookie from all browsers (IE, Netscape, Konqueror, Lynx, Opera etc.). I eventually solved it by keeping the existing (session) cookie which was assigned when the user first logged in, but marking the user as logged out on the server side. i.e. associate a user cookie with session data stored in a database, and instead of deleting the cookie on the client side, just set something on the server side session information that marks the user as having logged out. If the user then logs in again, just reuse the same cookie and mark the user as having logged in. This way you only have to assign an authentication cookie once per browser session. This may be tough to drop into TicketTool because IIRC it stores the authentication info in the cookie itself, rather than a server side session it associates with a cookie. Not very helpful, but it's another approach. I'd like to hear if you get it working across various browsers by expiring the cookie - for future ref. ~mark
[OT] Re: search.cpan.org
Well, ask Ask if you want the whole truth. But when I saked him that's what he said. Maybe there's a problem with the architecture and some pre-indexing is done per session or something suboptimal like that. Ask? ~~~ Nick Tonkin On Tue, 27 Nov 2001, Robert Landrum wrote: > Sure... When doing searches. But it takes me about 20 seconds just to > hit any page... not just the search pages. > > And don't misunderstand, I think search.cpan.org is awesome. I just > wondered if anyone knew why it was slow all the time. > > Rob > > > At 12:55 PM -0800 11/27/01, Nick Tonkin wrote: > >Because it does a full text search of all the contents of the DB. > > > > > >~~~ > >Nick Tonkin > > > >On Tue, 27 Nov 2001, Robert Landrum wrote: > > > >> Does anyone know why search.cpan.org is always the s-l-o-w-e-s-t site > >> on the internet? I can't believe it always busy. I've had trouble > >> hitting it at 3 AM. > >> > >> Maybe it's just me... > >> > >> > >> Rob > >> > >> -- > >> "Only two things are infinite: The universe, and human stupidity. > >>And I'm not > >> sure about the former." --Albert Einstein > >> > > > > > -- > "Only two things are infinite: The universe, and human stupidity. And I'm not > sure about the former." --Albert Einstein >
Re: [OT] Re: search.cpan.org
At 12:55 PM 11/27/01 -0800, Nick Tonkin wrote: > >Because it does a full text search of all the contents of the DB. Perhaps, but it's just overloaded. I'm sure he's working on it, but anyone want of offer Graham free hosting? A few mirrors would be nice, too. (Plus, all my CPAN.pm setups are now failing to work, too) Bill Moseley mailto:[EMAIL PROTECTED]
[OT] Re: search.cpan.org
Sure... When doing searches. But it takes me about 20 seconds just to hit any page... not just the search pages. And don't misunderstand, I think search.cpan.org is awesome. I just wondered if anyone knew why it was slow all the time. Rob At 12:55 PM -0800 11/27/01, Nick Tonkin wrote: >Because it does a full text search of all the contents of the DB. > > >~~~ >Nick Tonkin > >On Tue, 27 Nov 2001, Robert Landrum wrote: > >> Does anyone know why search.cpan.org is always the s-l-o-w-e-s-t site >> on the internet? I can't believe it always busy. I've had trouble >> hitting it at 3 AM. >> >> Maybe it's just me... >> >> >> Rob >> >> -- >> "Only two things are infinite: The universe, and human stupidity. >>And I'm not >> sure about the former." --Albert Einstein >> > -- "Only two things are infinite: The universe, and human stupidity. And I'm not sure about the former." --Albert Einstein
[OT] Re: search.cpan.org
Because it does a full text search of all the contents of the DB. ~~~ Nick Tonkin On Tue, 27 Nov 2001, Robert Landrum wrote: > Does anyone know why search.cpan.org is always the s-l-o-w-e-s-t site > on the internet? I can't believe it always busy. I've had trouble > hitting it at 3 AM. > > Maybe it's just me... > > > Rob > > -- > "Only two things are infinite: The universe, and human stupidity. And I'm not > sure about the former." --Albert Einstein >
Re: [JOB-SF Bay Area] Looking for someone to join my Web apps team at EFI/PrintMe
Hi John, I have been working with apache/mod_perl/oracle on Solaris and Linux for about 2 years. The projects included building secure intranet sections, dynamic pages, and most recently a ticketing system and a system to replace a paper trail in a very large non-profit. I'm relocating to Palo Alto, CA and I'm in the process of looking for a part time job. Do you think that there might be part-time opporotunity as part of the department you've described? Thanks, Alex On Tue, 27 Nov 2001, John Armstrong wrote: > Hello all- > I got my head count for the next few months and was given another > spot to fill on the team! Hooray! > > We are building a next generation internet printing system here at > Electronics For Imaging (EFII). The Web apps portion is heavily > Apache/ModPerl/HTML::Mason/Oracle based running under Linux and Solaris. > I am looking for someone that can help round out the team and work on > more back-end functionality. Initially this is the e-commerce/ERP > integration, XML integration with other system components as well as > 'modernizing' our initially developed architecture and helping to clean > up the code base so that moving forward is not quite so painful. > > EFI is a mid-sized( 1000 employees or so ) public company that is > doing just fine in the current market. We have not had any lay-off's and > are growing at a comfortable rate, our stock is stable and we always > meet our market expectations. All in all its a comfortable place to > weather this storm. The PrintMe team runs as an 'internal startup', that > means its pretty relaxed and divorced from many of the day-to-day issues > that would normally come with working in a larger company. > > Looking for the usual skill-set, experience with mod-perl/apache, > ability to build your own architecture and framework from the ground-up > and the ability to write code that plays well with others. I really > enjoy people that come to the table with an overall understanding of how > things work together and a somewhat proven track-record. > > If your interested drop me an email. We are located in Foster City, > CA, just south of San Francisco. > > See us on the web at http://www.printme.com/ or http://www.efi.com/ > > John- > >
[OT] search.cpan.org
Does anyone know why search.cpan.org is always the s-l-o-w-e-s-t site on the internet? I can't believe it always busy. I've had trouble hitting it at 3 AM. Maybe it's just me... Rob -- "Only two things are infinite: The universe, and human stupidity. And I'm not sure about the former." --Albert Einstein
RE: DSO Issues
Ditto. DSO makes my life so much better in terms of portability and administratability that having my services down for a few seconds during a log rotation is certainly worth it. Regards, Christian > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On > Behalf Of Vivek Khera > Sent: Tuesday, November 27, 2001 2:17 PM > To: [EMAIL PROTECTED] > Subject: Re: DSO Issues > > > > "DW" == David Wheeler <[EMAIL PROTECTED]> writes: > > DW> While it seems to be well-known anecdotally that one > should never use a > DW> DSO install of mod_perl (particularly among Mason > developers), is there > DW> yet any place where all the known issues surrounding the > use of DSO > > The *only* issue I encounter is a massive memory leak upon SIGHUP or > SIGUSR to apache. The amount of leakage depends on my particular > application. Having a DSO makes it much easier for me to administer > (having multiple instances of apache running on the same machine, some > with and some without mod_perl), so I live with it and do a full > stop/restart instead of SIGHUP to rotate logs. > > -- > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > Vivek Khera, Ph.D.Khera Communications, Inc. > Internet: [EMAIL PROTECTED] Rockville, MD +1-240-453-8497 > AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/ >
[JOB-SF Bay Area] Looking for someone to join my Web apps team at EFI/PrintMe
Hello all- I got my head count for the next few months and was given another spot to fill on the team! Hooray! We are building a next generation internet printing system here at Electronics For Imaging (EFII). The Web apps portion is heavily Apache/ModPerl/HTML::Mason/Oracle based running under Linux and Solaris. I am looking for someone that can help round out the team and work on more back-end functionality. Initially this is the e-commerce/ERP integration, XML integration with other system components as well as 'modernizing' our initially developed architecture and helping to clean up the code base so that moving forward is not quite so painful. EFI is a mid-sized( 1000 employees or so ) public company that is doing just fine in the current market. We have not had any lay-off's and are growing at a comfortable rate, our stock is stable and we always meet our market expectations. All in all its a comfortable place to weather this storm. The PrintMe team runs as an 'internal startup', that means its pretty relaxed and divorced from many of the day-to-day issues that would normally come with working in a larger company. Looking for the usual skill-set, experience with mod-perl/apache, ability to build your own architecture and framework from the ground-up and the ability to write code that plays well with others. I really enjoy people that come to the table with an overall understanding of how things work together and a somewhat proven track-record. If your interested drop me an email. We are located in Foster City, CA, just south of San Francisco. See us on the web at http://www.printme.com/ or http://www.efi.com/ John-
Re: DSO Issues
> "DW" == David Wheeler <[EMAIL PROTECTED]> writes: DW> While it seems to be well-known anecdotally that one should never use a DW> DSO install of mod_perl (particularly among Mason developers), is there DW> yet any place where all the known issues surrounding the use of DSO The *only* issue I encounter is a massive memory leak upon SIGHUP or SIGUSR to apache. The amount of leakage depends on my particular application. Having a DSO makes it much easier for me to administer (having multiple instances of apache running on the same machine, some with and some without mod_perl), so I live with it and do a full stop/restart instead of SIGHUP to rotate logs. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D.Khera Communications, Inc. Internet: [EMAIL PROTECTED] Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
Re: Apache::AuthCookie login faliure reason
> "CH" == Carolyn Hicks <[EMAIL PROTECTED]> writes: CH> this to something like 'InvalidLogin' in authen_cred, you can then check CH> for this and set the reason via $r->subprocess_env in AuthCookieHandler-> authen_ses_key, before AuthCookie->authenticate wipes CH> the cookie out. Not extensively tested, but seems to work so far :) This is what I do. Unfortunately the diagram in AuthCookie man page is incorrect in that returning undef from authen_cred sends you back to the login screen (last I checked), so one must pull these tricks. my %errors = ( 'badpass' => 'Sorry, your login information is incorrect. Please try again.', 'suspended' => 'Sorry, your account is supended. Please contact us for assistance.', 'sessfail' => 'Sorry, there was a problem establishing your session. Please try again.', 'terminated' => 'Sorry, this account has been cancelled. Please create a new one.', ); # Check credentials in database. If failure, return 'ERROR:code' # where code is from %errors hash. On success, return the cookie sub authen_cred ($$\@) { my $self = shift; my $r = shift; my ($acct,$password,$isAdmin) = @_; Apache->request($r); # need to set for openDB(). my $dbh = openDB() or return 'ERROR:sessfail'; # first, check id/password from database my $orec = new orec() or return 'ERROR:sessfail'; my $oid = $orec->acct_to_id($acct) or return 'ERROR:badpass'; eval { $orec->populate_id($oid); }; return 'ERROR:badpass' if ($@ and $@ =~ m/^notfound/); return 'ERROR:terminated' if $orec->owner_status() eq 'terminated'; $orec->verify_password($password) or return 'ERROR:badpass'; # ok, so now create a session for them and use that session ID # as their cookie value my %session; eval { tie %session, 'Apache::Session::Postgres', undef, { Handle => $dbh, Commit => 0, }; }; if ($@) { warn "authen_cred got $@ creating new session"; return 'ERROR:sessfail'; } else { $session{user} = $orec->owner_email(); $session{owner_id} = $orec->owner_id(); if ($isAdmin) { # instantiate the admin record in this session and log that # this admin is impersonating this user. my $arec = arec->new($orec->{_CONTEXT}); $arec->populate_id($arec->decode($isAdmin)); $session{arec} = $arec; $arec->log_action('Logged in as account owner.',$orec); } return $session{_session_id}; } } # upon failure to authenticate the session, set MLMAuthReason environment and # return undef. sub authen_ses_key ($$$) { my $self = shift; my $r = shift; my $key = shift; Apache->request($r); # need to set for openDB(). if ($key =~ m/^ERROR:(\w+)(-\d+)?$/) { # set $r->subprocess_env('MLMAuthReason') to failure reason $r->subprocess_env('MLMAuthReason' => $errors{$1}); return undef; } # Check if key is in database. my %session; eval { my $dbh = openDB(); tie %session, 'Apache::Session::Postgres', $key, { Handle => $dbh, Commit => 0, }; }; if ($@) { warn "authen_ses_key got $@ retrieving session `$key'"; $r->subprocess_env('MLMAuthReason' => 'Unable to retrieve session. Possibly expired. Please login again.'); return undef; } else { # got the session... now stash it away for later use $r->pnotes('sessionkey',$key); $r->pnotes('sessionhashref',\%session); $r->pnotes('owner_id',scalar($session{owner_id})); return $session{user}; } } -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D.Khera Communications, Inc. Internet: [EMAIL PROTECTED] Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
[Job Seeker]
hi all... well, with this economy and all I guess it's a bad time to look for a new job, but... things here at covad are taking a turn for the worse. In fact, covad stopped using mod_perl some time ago, and I no longer have the internal corporate sponsorship and support I once had. Thus, stuff like the weekly digest is probably going to come to an end after only a year (yes, the first "issue" covered the week of Septmber 24, 2000) due to my situation here at work. anyway, if anyone has room for a decent mod_perl developer and doesn't mind me working remotely (unless you are near Philadelphia), please drop me a line... --Geoff __ Do You Yahoo!? Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. http://geocities.yahoo.com/ps/info1
Re: Apache - mod_perl - Windows
Greetings. You may be in need of AddModule mod_perl.c After the ClearModuleList somewhere around line 207 of httpd.conf as distributed. (What's ClearModuleList's used for anyway? I never really understood it - but then again, I never really read its documentation...) As for mod_perl on win32, I am using it and the speed up in the load times is quite impressive. It does have a few glitches, the major possibly being that script execution is single threaded. Look for the relevant discussion in the list's archive (and in a forthcoming documentation upgrade). One thing I noticed on Win2k (but I believe it is Apache releated: as I recall, I saw it in a cgi-bin situation) is that scripts printing abundantly to stderr (which apache redirects to errorr_log) have a tendency to hang. This is an incentive to have a clena compile, if you "use warnings" ... or to redirect stderr to some other file ;) Cheers, alf
Re: Apache - mod_perl - Windows
On Tue, 27 Nov 2001, Albrecht Fortenbacher wrote: > I tried to install precompiled mod_perl within an Apache 1.3.22 server > on Windows 2000 as indicated on http://perl.apache.org, and this failed > (error message below). [ .. ] > --- > 1. my environment is Windows 2000, Apache 1.3.22 and Perl 5.6.1, binary > build 629 provided by ActiveState > 2. I installed mod_perl via ActiveState's ppm from > http://theoryx5.uwinnipeg.ca/ppmpackages, as indicated on the > perl.apache.org page > 3. at the end of the installation process, the module mod_perl.so is > copied into the Apache modules directory > 4. this module is not recognized by Apache, as the following *weird* > error message shows: > > Can't locate API module structure `mod_perl' in file > > e:/apache/modules/mod_perl. > > so: (127) The specified procedure could not be found: > This error message was produced by the line > > LoadModule mod_perl modules/mod_perl.so > in the httpd.conf file. Hi, Try, in http.conf, LoadModule perl_module modules/mod_perl.so rather than LoadModule mod_perl modules/mod_perl.so best regards, randy kobes
RE: Apache - mod_perl - Windows
:: sorry for bothering you with a question concerning mod_perl under :: windows (it's not that I like windows so much, it's just because I have :: to use a windows system ...) Same here - I'm forced to use Windows because we're a Windows only shop. Additionally, I don't know Unix so that kind of limits my opportunities. :-( :: My question is: :: 1. is there a way to get a precompiled windows version running (I don't :: want to reset my Apache server to some ancient version!) I have set up several Windows / Apache / mod_perl servers without any problems whatsoever. I would recommend the following (in order): Download and install the latest non-v2 distribution of Apache Download ActiveState's "ActivePerl" (http://www.activestate.com/) and install into the Apache directory Use "PPM" (Perl Package Manager) to download and install "mod_perl" (and any other module you want). Note: You will need to add the following "PPD Repository Path" to PPM in order to get "mod_perl": http://theoryx5.uwinnipeg.ca/cgi-bin/ppmserver?urn:/PPMServer :: 2. is it worth the effort (and likely to be successful) to configure the :: CPAN module with make- and cc-Utilities (e.g. from cygwin), and is there :: an *easy* indication how to do it :: or It's possible to do it via Cygwin, but not necessary if you follow the steps above. As to whether or not it's worth the effort... YES, YES, YES!!! You have got to see the difference between mod_perl and mod_cgi to believe it. Once you've worked under mod_perl, you'll will never go back to plain old CGI. :: 3. is Apache/mod_perl and windows an invalid combination which simply :: should not be used??? No way. This combination works very well with some caveats (see the documentation for details). Jonathan M. Hollin - WYPUG Co-ordinator West Yorkshire Perl User Group http://wypug.pm.org/
DSO Issues
Hi All, While it seems to be well-known anecdotally that one should never use a DSO install of mod_perl (particularly among Mason developers), is there yet any place where all the known issues surrounding the use of DSO mod_perl are documented? I see a place in the guide where Stas mentions issues with mymalloc and such, but I also saw a post from a few months ago where he'd asked for someone with extensive experience with DSO installs to come forward and discuss the known issues. Did this ever come about? Thanks! David -- David Wheeler AIM: dwTheory [EMAIL PROTECTED] ICQ: 15726394 Yahoo!: dew7e Jabber: [EMAIL PROTECTED]
Apache - mod_perl - Windows
Hi, sorry for bothering you with a question concerning mod_perl under windows (it's not that I like windows so much, it's just because I have to use a windows system ...) I tried to install precompiled mod_perl within an Apache 1.3.22 server on Windows 2000 as indicated on http://perl.apache.org, and this failed (error message below). My question is: 1. is there a way to get a precompiled windows version running (I don't want to reset my Apache server to some ancient version!) or 2. is it worth the effort (and likely to be successful) to configure the CPAN module with make- and cc-Utilities (e.g. from cygwin), and is there an *easy* indication how to do it or 3. is Apache/mod_perl and windows an invalid combination which simply should not be used??? Thanks in advance Albrecht Fortenbacher --- 1. my environment is Windows 2000, Apache 1.3.22 and Perl 5.6.1, binary build 629 provided by ActiveState 2. I installed mod_perl via ActiveState's ppm from http://theoryx5.uwinnipeg.ca/ppmpackages, as indicated on the perl.apache.org page 3. at the end of the installation process, the module mod_perl.so is copied into the Apache modules directory 4. this module is not recognized by Apache, as the following *weird* error message shows: > Can't locate API module structure `mod_perl' in file > e:/apache/modules/mod_perl. > so: (127) The specified procedure could not be found: This error message was produced by the line > LoadModule mod_perl modules/mod_perl.so in the httpd.conf file. -- ___ Prof. Dr. Albrecht Fortenbacher Angew. Informatik / FHTW Berlin Anschrift: FB4, FHTW Berlin, Treskowallee 8, 10313 Berlin Tel: 030 5019-2321 Fax: -2671 mailto:[EMAIL PROTECTED] http://www.f4.fhtw-berlin.de/people/forte
Re: Deleting a cookie
Expiring the cookie works well for me. Here's what I have: sub handler { [ ... ] if ($r->uri =~ /logout/) { if (my $cookie = destroy_cookie($r)) { return logout_screen($r); } else { return 500; } } [ ... ] } sub destroy_cookie { my $r = shift; # you may or may not be using this my $auth_domain = $r->dir_config('Auth_Domain'); my $cookie = Apache::Cookie->new( $r, expires => "-24h", domain => $auth_domain, name=> 'auth', # whatever you've called it path=> '/', value => '' ); $cookie->bake; return $cookie; } sub logout_screen { [ ... ] } 1; ~~~ Nick Tonkin On Tue, 27 Nov 2001, Jon Robison wrote: > I have created a login system using the wonderful Ticket system from the > Eagle book. I have modified TicketAccess so that after authentication, > it reviews the arguments in the query string and does push_handler, the > handler being chosen based on the args. > > My only problem is that I want to provide the users with a logout button > which will delete the cookie from thier browser, yet I cannot find how!. > I have reviewed every module on my system with 'Cookie' in the name > (Apache::Cookie, CGI::Cookie, etc.) and nowhere does it tell how to do > this. There is a small mention of changing the expiration to < 0, but > apparently I am doing it wrong (possible confusing point is the use of > an 'expires' value in the cookie itself, seperate, I think, from the > 'expires' attribute on the cookie?) > > I know it is a lot to ask, but I am relatively new to this part of > mod_perl (pushing handlers, etc.), so if anyone can look at this and > replace my BLOCKED comments with a couple of helpfull lines, I would > greatly appreciate it! > > Thanks in advance - > > Jonathon Robison > > > Below is my modified TicketAccess, as well as the Logout module I am > re-directing to for logout action: > = > package FES::Apache::TicketAccess; > > use strict; > use Apache::Constants qw(:common); > use FES::Apache::TicketTool (); > > sub handler { > my $r = shift; > my %input = $r->args; > # for checking input items > my $ticketTool = FES::Apache::TicketTool->new($r); > my($result, $msg) = $ticketTool->verify_ticket($r); > unless ($result) { > $r->log_reason($msg, $r->filename); > my $cookie = $ticketTool->make_return_address($r); > $r->err_headers_out->add('Set-Cookie' => $cookie); > return FORBIDDEN; > } > ## Here is where we need to insert a push_handler insert. I won't need > ## the requested uri from the $r, since the $r goes along for the ride > in## push_handler > > my $action = defined $input{'act'} ? $input{'act'} : 'view'; > > print STDERR "action is defined as $action\n"; ## DEBUGGING > > if ($action eq 'logout') { > $r->push_handlers('PerlHandler' => 'FES::Control::Logout'); > return OK; > } elsif ($action eq 'view') { > $r->push_handlers('PerlHandler' => 'FES::Control::View'); > return OK; > } else { > $r->push_handlers('PerlHandler' => 'FES::Control::View'); > return OK; > } >## ARE THOSE THE CORRECT THINGS TO 'RETURN' FOR THESE CASES? > > } > > 1; > == > > And the Logout.pm: > > = > package FES::Control::Logout; > > use strict; > use Apache; > use Apache::Constants qw(:common); > use FES::Common::Common qw( header footer); > use CGI qw/:standard/; > use CGI::Cookie; > > sub handler { > my $r = shift; > my $q = new CGI; > my $ticket = _get_ticket('r' => $r); > > ## HERE IS WHERE I NEED TO 1.) DELETE USER'S TICKET COOKIE AND > ## 2.) REDIRECT THEM TO "/FES" (w/o bringing old > $r),(WHERE THEY SHOULD GET > ## A NEW LOGIN SCREEN BECAUSE COOKIE IS > GONE.) > > } > > sub _get_ticket { > my $args = { > 'r' => undef, > @_ > }; > my $r = $args->{'r'}; > my %cookies = CGI::Cookie->parse($r->header_in('Cookie')); > # TESTING > my %ticket = $cookies{'Ticket'}->value; # TESTING > return \%ticket; > } > > 1; > = >
location directive
Hi I have put mod_perl handler inside a virtual host section then inside the virtualhost section, i also put location directives to override overall modperl handler in some situations, with sethandler default-handler. for instance Alias /icons/ d:/Apache/icons/ SetHandler default-handler this works ok as soon as the uri is /icons/file but modperl handler intercept if the uri is just /icons/ which should otherwise show the directory index of the location. isn't it a sort of bug ? everything works ok if i put modperl handler inside a location, inside the virtual host but this is precisely what i don't want to do. "Ce message vous est envoyé par laposte.net - web : www.laposte.net/ minitel : 3615 LAPOSTENET (0,84 F TTC la minute)/ téléphone : 08 92 68 13 50 (2,21 F TTC la minute)"
Re: Deleting a cookie
Mohit Agarwal wrote: > > Never tried the negative value for expiration time, but setting it to > a very small value, say 1s, works. I'm not sure, but setting the > cookie value to null should also have the same effect. I believe setting the expiry date less than the current time should work. Mithun
RE: Apache::Registry HTTP HEAD "feature" fix ;-)
> -Original Message- > From: Jean-Michel Hiver [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, November 27, 2001 9:02 AM > To: [EMAIL PROTECTED] > Subject: Re: Apache::Registry HTTP HEAD "feature" fix ;-) > > > > this should work for scripts that only use print() (without > the patch I sent > > yesterday :) > > Looks neat! I'll make sure I'll take a close look at that :-) > Cheers, BTW, I think I figured out why your redirect to /dev/null was working... CGI.pm can tell if it is running under mod_perl and sets its header() routine to add the headers to the outgoing header table using mod_perl methods. thus, the headers go directly to the client while the content stays put. however, if you don't use CGI.pm your old solution doesn't work... anyway, I haven't stressed the solution I just posted too much, but I did test both CGI.pm and non-CGI.pm cases with multiple print statements and it seems to work ok... time will tell :) HTH --Geoff
Re: Apache::Registry HTTP HEAD "feature" fix ;-)
> this should work for scripts that only use print() (without the patch I sent > yesterday :) Looks neat! I'll make sure I'll take a close look at that :-) Cheers, -- == \__ = /\/\ IT'S TIME FOR A DIFFERENT KIND OF WEB / /\__/\ \ _/_/_/\/\_\_ Jean-Michel Hiver - Software Director \ \ \/*/ / [EMAIL PROTECTED]+44 (0)114 221 4968 \ \/__\/ \/\ VISIT HTTP://WWW.MKDOC.COM == / ===
RE: Apache::Registry HTTP HEAD "feature" fix ;-)
> -Original Message- > From: Jean-Michel Hiver [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 26, 2001 9:38 AM > To: [EMAIL PROTECTED] > Subject: Re: Apache::Registry HTTP HEAD "feature" fix ;-) > > > > well, I just gave you a patch that worked :) basically, it > only provides a > > solution for mod_cgi compatible scripts, but if you're > using the mod_perl > > API then it is up to you to check $r->header_only and take > appropriate > > action... > > True, however your patch also means that it's necessary to recompile > stuff, which is not always possible. In addition (and as an exercise) > I'd be happy to find a clean Perl way to do it. > this should work for scripts that only use print() (without the patch I sent yesterday :) --Geoff package My::HEADRegistry; use Apache::Constants qw(DONE); use Apache::RegistryNG; use strict; @My::HEADRegistry::ISA = qw(Apache::RegistryNG); sub new { my ($class, $r) = @_; $r ||= Apache->request; tie *STDOUT, $class, $r; return tied *STDOUT; } sub PRINT { my ($self, @data) = @_; my $r = $self->{r}; # we're emulating mod_cgi, where there is no auto-dereferencing... my $data = join '', @data; my $dlm = "\015?\012"; # a bit borrowed from LWP::UserAgent my ($key, $value); local $_; unless ($r->sent_header) { # if we have already sent the headers, no reason to scan the output while(($_, $data) = split /$dlm/, $data, 2) { # scan the incoming data for headers if ($_ && /^(\S+?):\s*(.*)$/) { # if the data looks like a header, add it to the header table ($key, $value) = ($1, $2); last unless $key; $r->cgi_header_out($key, $value); } } } # send the headers unless we've already sent them $r->send_http_header && $r->sent_header(DONE) unless $r->sent_header; # if this is a HEAD request, we're done return if $r->header_only; # otherwise, send whatever data we have left to the client $r->write_client($data); } sub TIEHANDLE { my ($class, $r) = @_; return bless { r => $r }, $class; } 1;
Re: Deleting a cookie
On Tue, 27 Nov 2001, Jon Robison wrote: > My only problem is that I want to provide the users with a logout > button which will delete the cookie from thier browser, yet I cannot > find how!. I have reviewed every module on my system with 'Cookie' > in the name (Apache::Cookie, CGI::Cookie, etc.) and nowhere does it > tell how to do this. There is a small mention of changing the > expiration to < 0, but apparently I am doing it wrong (possible > confusing point is the use of an 'expires' value in the cookie > itself, seperate, I think, from the 'expires' attribute on the > cookie?) Never tried the negative value for expiration time, but setting it to a very small value, say 1s, works. I'm not sure, but setting the cookie value to null should also have the same effect.
Deleting a cookie
I have created a login system using the wonderful Ticket system from the Eagle book. I have modified TicketAccess so that after authentication, it reviews the arguments in the query string and does push_handler, the handler being chosen based on the args. My only problem is that I want to provide the users with a logout button which will delete the cookie from thier browser, yet I cannot find how!. I have reviewed every module on my system with 'Cookie' in the name (Apache::Cookie, CGI::Cookie, etc.) and nowhere does it tell how to do this. There is a small mention of changing the expiration to < 0, but apparently I am doing it wrong (possible confusing point is the use of an 'expires' value in the cookie itself, seperate, I think, from the 'expires' attribute on the cookie?) I know it is a lot to ask, but I am relatively new to this part of mod_perl (pushing handlers, etc.), so if anyone can look at this and replace my BLOCKED comments with a couple of helpfull lines, I would greatly appreciate it! Thanks in advance - Jonathon Robison Below is my modified TicketAccess, as well as the Logout module I am re-directing to for logout action: = package FES::Apache::TicketAccess; use strict; use Apache::Constants qw(:common); use FES::Apache::TicketTool (); sub handler { my $r = shift; my %input = $r->args; # for checking input items my $ticketTool = FES::Apache::TicketTool->new($r); my($result, $msg) = $ticketTool->verify_ticket($r); unless ($result) { $r->log_reason($msg, $r->filename); my $cookie = $ticketTool->make_return_address($r); $r->err_headers_out->add('Set-Cookie' => $cookie); return FORBIDDEN; } ## Here is where we need to insert a push_handler insert. I won't need ## the requested uri from the $r, since the $r goes along for the ride in## push_handler my $action = defined $input{'act'} ? $input{'act'} : 'view'; print STDERR "action is defined as $action\n"; ## DEBUGGING if ($action eq 'logout') { $r->push_handlers('PerlHandler' => 'FES::Control::Logout'); return OK; } elsif ($action eq 'view') { $r->push_handlers('PerlHandler' => 'FES::Control::View'); return OK; } else { $r->push_handlers('PerlHandler' => 'FES::Control::View'); return OK; } ## ARE THOSE THE CORRECT THINGS TO 'RETURN' FOR THESE CASES? } 1; == And the Logout.pm: = package FES::Control::Logout; use strict; use Apache; use Apache::Constants qw(:common); use FES::Common::Common qw( header footer); use CGI qw/:standard/; use CGI::Cookie; sub handler { my $r = shift; my $q = new CGI; my $ticket = _get_ticket('r' => $r); ## HERE IS WHERE I NEED TO 1.) DELETE USER'S TICKET COOKIE AND ## 2.) REDIRECT THEM TO "/FES" (w/o bringing old $r),(WHERE THEY SHOULD GET ## A NEW LOGIN SCREEN BECAUSE COOKIE IS GONE.) } sub _get_ticket { my $args = { 'r' => undef, @_ }; my $r = $args->{'r'}; my %cookies = CGI::Cookie->parse($r->header_in('Cookie')); # TESTING my %ticket = $cookies{'Ticket'}->value; # TESTING return \%ticket; } 1; =
ANNOUNCE: Apache::ImageMagick 2.0b5
The URL ftp://ftp.dev.ecos.de/pub/perl/image/Apache-ImageMagick-2.0b5.tar.gz has entered CPAN as file: $CPAN/authors/id/G/GR/GRICHTER/Apache-ImageMagick-2.0b5.tar.gz size: 10734 bytes md5: f2b27559a97f349603c218be8205409d This release fixes a bug, which causes cached files to stay opened. NAME Apache::ImageMagick - Convert and manipulate images on the fly DESCRIPTION This module uses the Image::Magick library to process or create an image on the fly. It is able to convert the source image to any type you request that is supported by Image::Magick (e.g. TIFF, PPM, PGM, PPB, GIF, JPEG and more). Additionaly you can specify (multiple) image manipulation filters in the additional path info and format options in the query string. Apache::ImageMagick caches the result image so multiple requested with the same parameters only needs one computation. To do more sophisticated manipulation, Apache::ImageMagick can run a script that does the image manipulation/creation. Last but not least Apache::ImageMagick comes with a proxy module, that can be linked into a non mod_perl frontend proxy server and which will delivers cached images which highest possible speed. For detailed information see perldoc Apache::ImageMagick AUTHOR G.Richter ([EMAIL PROTECTED]) Based on work from Lincoln Stein and Doug MacEachern publish in "Writing Apache Modules with Perl and C" see www.modperl.com - 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 925131 WWW:http://www.ecos.de Fax: +49 6133 925152 -
ANNOUNCE: Embperl 2.0b5
The URL ftp://ftp.dev.ecos.de/pub/perl/embperl/HTML-Embperl-2.0b5.tar.gz has entered CPAN as file: $CPAN/authors/id/G/GR/GRICHTER/HTML-Embperl-2.0b5.tar.gz size: 506804 bytes md5: e5836be6ad29f8658052e512e2427c74 This is mainly a bug fix release. The only new feature is the possibility to pass parameters to xslt processors. Details about the new XML support can be found in the announce for 2.0b4 (see http://www.ecos.de/~mailarc/embperl/2001-11/msg00120.html) Embperl is a system for building dynamic websites with Perl. It gives you the power to embed Perl code in your HTML documents and the ability to build your Web site out of small reusable objects in an object-oriented style. You can also take advantage of all the usual Perl modules, (including DBI for database access) use their functionality and easily include their output in your web pages. Embperl has several features which are especially useful for creating HTML, including dynamic tables, form field processing, URL escaping/unescaping, session handling, and more. With 2.0 this feature are extented to use XML/XSLT, extent the Embperl's syntax, build taglibs, cacheing and more. See http://perl.apache.org/embperl/ (english) or http://www.ecos.de/embperl/ (german) for more information. Changes since 2.0b4: - Add xsltparam parameter which takes a hashref and is used to pass parameters to the xslt processor. If not given defaults to %fdat. - Add require URI::URL to test.pl so make test work with newer LWP. Patch from Jonathan Stowe. - Fixed problem in registry/tied test, which failed for some Apache versions because of addtional http header. Patch from Jonathan Stowe. - Fixed problem with comments inside [! !] blocks. Reported by Alan Milligan. - Fixed compiling problem with very recent versions of libxslt. Reported by Michael Stevens and Jonathan Stowe. - Fixed make test so it skips session tests if Apache::SessionX isn't installed. Reported by from Jonathan Stowe. - Fixed path problem with Execute ({sub => foo,... }) on win32. - Fixed a problem with duplicate subroutine names when running multiple pages in the same package. - Fixed problem with reloading when file changed, which sometimes didn't reload correctly in 2.0b4 - Fixed memory leak which occured when using libxslt. - Fixed MakeMaker problem with Perl 5.7.1. - Removed some uninitialized value warnings. - Added "make start" and "make stop" to start and stop test httpd Enjoy 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 925131 WWW:http://www.ecos.de Fax: +49 6133 925152 -