Re: problem with method auth_type
jehan procaccia wrote: hello, I followed the thread : http://www.gossamer-threads.com/archive/mod_perl_C1/modperl_F7/mod_perl_2.0_question_about_$r-%3Econnection-%3Eauth_type_P51273/#51273 While using module AuthCookieLDAP based on AuthCookie I got exactly the same error: Use of uninitialized value. [Wed Jul 23 16:25:54 2003] [error] [client 127.0.0.1] Can't locate object method auth_type via package Apache::Connection at /usr/lib/perl5/site_perl/5.8.0/Apache/AuthCookie.pm line 182.!, referer: http://localhost/ldap I am trying to Authenticate HTTP connection to an openldap Server, using AuthCookie and AuthCookieLDAP, both written for apache 1.3.X and mod_perl 1.X. Here I use Apache 2.0.40 and mod_perl-1.99_07-5 (which is supposed to be mod_perl 2.0 I understood !?) on a RedHat 9 system. Although I added PerlModule Apache::compat and PerlOptions +GlobalRequest in httpd.conf , I still get the above mentioned error :-( Any help ? Thanks. PS: The author of AuthCookie is about to port its module to mod_perl 2.0, maybe that would solve the problem, but when, and why doesn't it work now with Apache::compat ? http://perl.apache.org/docs/2.0/user/porting/compat.html#C__connection_E_gt_auth_type_ Have you tried the latest cvs of mod_perl2? Apache::compat provides the necessary code there: package Apache::Connection; # auth_type and user records don't exist in 2.0 conn_rec struct # 'PerlOptions +GlobalRequest' is required sub auth_type { shift; Apache-request-ap_auth_type(@_) } sub user { shift; Apache-request-user(@_) } For more info see: http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: compile latest CVS
jehan procaccia wrote: hello I just donwloaded latest cvs as stated in : http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution Now I don't really understand what directory is supposed to contain the MP_AP_PREFIX variable ? It's the path where Apache was installed to. I'm not on RH so I'm not sure where it installs it to. But from looking at the RH rpms, it spreads things across different dirs. There is a RH rpm package which includes the build instructions specific to RH, just grab the src.rpm from here: http://fr.rpmfind.net/linux/rpm2html/search.php?query=mod_perlsubmit=Search+... next look at the spec file, it says: # Compile the module. %{__perl} Makefile.PL /dev/null \ PREFIX=$RPM_BUILD_ROOT/usr INSTALLDIRS=vendor \ MP_APXS=%{_sbindir}/apxs MP_APR_CONFIG=%{_bindir}/apr-config \ CCFLAGS=$RPM_OPT_FLAGS -fPIC make So I suppose that if you have installed the Apache rpm from RH you should say at least: perl Makefile.PL MP_APXS=/usr/sbin/apxs MP_APR_CONFIG=/usr/bin/apr-config adjust the paths to these scripts if my guess was wrong. You can use locate(1) to find them. You can also try to use the latest src.rpm from rawhide, I'm not sure how recent it is http://fr.rpmfind.net//linux/RPM/rawhide/1.0/i386/RedHat/RPMS/mod_perl-1.99_09-6.i386.html says Jul 16, which is very recent. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [MP2] Placing Apache::RequestRec Apache::RequestIO APR::Tableuse statements in startup.pl
Jamie Krasnoo wrote: Will placing Apache::RequestRec Apache::RequestIO APR::Table in startup.pl to load them up for multiple handlers have any bad side effects? I noticed that when I load them via startup.pl the handlers that use them don't complain that they don't have the use statements within the module code and still work as normal. While this works for you, it's a bad practice. Why? Because other people using your code may not have these modules loaded from startup.pl. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [MP2] Placing Apache::RequestRec Apache::RequestIO APR::Tableuse statements in startup.pl
Jamie Krasnoo wrote: On Thu, 2003-07-24 at 02:15, Stas Bekman wrote: Jamie Krasnoo wrote: Will placing Apache::RequestRec Apache::RequestIO APR::Table in startup.pl to load them up for multiple handlers have any bad side effects? I noticed that when I load them via startup.pl the handlers that use them don't complain that they don't have the use statements within the module code and still work as normal. While this works for you, it's a bad practice. Why? Because other people using your code may not have these modules loaded from startup.pl. Won't loading them for every handler put an instance of it in memory over and over again though? Or will Perl realize that its already loaded and not load it again? How would this behave in MPM threadpool? perldoc -f require It gets loaded only once. Why should be any difference with threadpool. Application-wise it's all transparent. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: how to extend CPAN module?
wrote: Hi, How to correctly extend CPAN module, perldoc only explains how to create CPAN module from scratch, but what about extending? I want to add some Foo::My.pm to existing Foo bundle. Which Makefile.PLs should patched? all? just one in subsdirectory 'mod'? Any link? Please ask only mod_perl specific question at the mod_perl list. There are plenty other lists and discussion forums that can answer generic perl questions. Good starting point are: http://perl.apache.org/docs/offsite/other.html#Perl http://lists.perl.org/. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [mp1] Safe segfaults with mp1
Joel Palmius wrote: This works, separate file /tmp/test.pl: use Safe; my($compartment) = new Safe; $compartment-permit(qw(:browse)); $compartment-reval(print \gnu\n\;); if($@) { die $@; } print \n\n; (Script prints gnu) This does not work, in perl-handler Handler.pm: [...] use Safe; sub handler { my $r = shift; return DECLINED unless $r-content_type() eq 'text/html'; [...] print Content-type: text/plain\n\n; my($compartment) = new Safe; $compartment-permit(qw(:browse)); $compartment-reval(print \gnu\n\;); if($@) { die $@; } [...] Request results in segfault: [Thu Jul 24 12:59:56 2003] [notice] child pid 3003 exit signal Segmentation fault (11) If I comment out $compartment-reval(), then the process does not segfault. Since Safe works outside mod_perl, I'm guessing there's something with the mod_perl environment that messes things up. I have run the rest of the setup for several months now without noticing any other ill effects, so I don't think it is a bad installation of something. Setup is: Gentoo linux perl 5.8.0 apache 1.3.27 mod_perl 1.27 Ideas anyone? Joel, I have reproduced the segfault using your test script. It's handy to have p5p people sitting next to you. Just asked this question Tim Bunce, and he replied: Safe is a failed experiment. It works only for several cases. TIEHANDLE is not one of them [print under mod_perl uses a tied STDOUT]. Do not use it if it doesn't work for you. I'm supposed to ask Dan Sugalsky whether perl6 will have this functionality designed from the ground up. We could prevent the segfault in mod_perl, but you still won't be able to use Safe under it. So IMHO it's not worth the slowdown to do extra checks. Should probably add it to the troubleshooting section. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [mp1] Safe segfaults with mp1
Stas Bekman wrote: Joel Palmius wrote: use Safe; my($compartment) = new Safe; $compartment-permit(qw(:browse)); $compartment-reval(print \gnu\n\;); [...] Request results in segfault: [Thu Jul 24 12:59:56 2003] [notice] child pid 3003 exit signal Segmentation fault (11) [...] Joel, I have reproduced the segfault using your test script. It's handy to have p5p people sitting next to you. Just asked this question Tim Bunce, and he replied: Safe is a failed experiment. It works only for several cases. TIEHANDLE is not one of them [print under mod_perl uses a tied STDOUT]. Do not use it if it doesn't work for you. I'm supposed to ask Dan Sugalsky whether perl6 will have this functionality designed from the ground up. We could prevent the segfault in mod_perl, but you still won't be able to use Safe under it. So IMHO it's not worth the slowdown to do extra checks. Should probably add it to the troubleshooting section. And here is the patch that prevents the segfault. I'm not sure whether it should go in. I have attached it as well, since the original had \t in it and it'll be certainly mangled. Index: src/modules/perl/Apache.xs === RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v retrieving revision 1.128 diff -u -r1.128 Apache.xs --- src/modules/perl/Apache.xs 6 Jul 2003 04:51:20 - 1.128 +++ src/modules/perl/Apache.xs 24 Jul 2003 14:38:33 - @@ -1134,7 +1134,9 @@ sv_setiv(sendh, 0); } else { - CV *cv = GvCV(gv_fetchpv(Apache::write_client, FALSE, SVt_PVCV)); +/* should exist already */ +CV *cv = GvCV(gv_fetchpv(Apache::write_client, GV_ADDWARN, SVt_PVCV)); +if(!cv) croak(can't find Apache::write_client, are you using Safe.pm?); soft_timeout(mod_perl: Apache-print, r); PUSHMARK(mark); #ifdef PERL_OBJECT __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com Index: src/modules/perl/Apache.xs === RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v retrieving revision 1.128 diff -u -r1.128 Apache.xs --- src/modules/perl/Apache.xs 6 Jul 2003 04:51:20 - 1.128 +++ src/modules/perl/Apache.xs 24 Jul 2003 14:45:16 - @@ -1134,7 +1134,9 @@ sv_setiv(sendh, 0); } else { - CV *cv = GvCV(gv_fetchpv(Apache::write_client, FALSE, SVt_PVCV)); +/* should exist already */ +CV *cv = GvCV(gv_fetchpv(Apache::write_client, GV_ADDWARN, SVt_PVCV)); +if(!cv) croak(can't find Apache::write_client, are you using Safe.pm?); soft_timeout(mod_perl: Apache-print, r); PUSHMARK(mark); #ifdef PERL_OBJECT
Re: Test unexpectedly succeeded during make test
First of all, when reporting problems please following the guidelines: http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems OS: AIX 4.3.3 w/the latest maintenance level modperl/request_rec_tie_apiok 1/3 unexpectedly succeeded The test t/response/TestModperl/request_rec_tie_api.pm goes as: require Apache::Build; my @todo; push @todo, 1 if Apache::Build::AIX(); plan $r, tests = 3, todo = [EMAIL PROTECTED]; # XXX: on AIX 4.3.3 we get: # STDIN STDOUT STDERR # perl: 0 1 2 # mod_perl: 0 0 2 my $fileno = fileno STDOUT; ok $fileno; t_debug fileno STDOUT: $fileno; the problem is that on the AIX that I was testing I was receiving STDOUT as 0 under mod_perl. I don't remember which perl it was :( but this is not a problem. This is the test that really fails: filter/in_bbs_msg.t 255 65280?? ?? % ?? please run this test separately and post the error_log file and the output of the run: rm t/logs/error_log t/TEST -v filter/in_bbs_msg.t Next you also want to install LWP, otherwise many of the tests aren't running: all skipped: cannot find module 'LWP' __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Advice sought for learning mod_perl (2 or 1)
Ged Haywood wrote: Q1: Is there a similar module to Apache::Request? Depends what you want to do, but not really. Care to try porting it? No no. Apache::Request 2 port is in works and it'll be available RSN thanks to Joe Schaefer and Randy Kobes who do an extraordinary job. Though it'll be released sooner if more people help with testing and polishing it. For more information see: http://httpd.apache.org/apreq/ __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [mp1] Safe segfaults with mp1
Joel Palmius wrote: Ah, well, after a five hours of experimentation I thought up a working workaround anyway. This works with an unpatched version of mp1 ($substr is any perl code fetched from external source): my(@ops) = split(/\x0a/,$substr); my($cell,$reval); foreach $cell (@ops) { $cell =~ s/^[\x09\ ]+//g; $cell =~ s/^print\ /\$output\ \.\=\ /; if($cell) { $reval .= $cell . \n; } } my($output); $reval .= \$output;\n; my($compartment) = new Safe(Tempo); $compartment-permit(qw(:browse)); $output = $compartment-reval($reval); if($@) { $self-{ERROR} = gettext(Security exception: . $@); $self-{ERRORCODE} = 99; } print $output; I just replace all print statements with $output .= , and then make sure that the reval results in the final contents of $output, which I then print outside the reval(). Works fine now. So far nothing else has crashed, although I'm somewhat suspicious of a number of rather random events in the code. I'm almost certain this is me having messed up something else though. Neat. I expect it to work as long as you do simple things, it's going to be much harder to make it working with more complex code. However I was trying to simplify your logic and use IO::String to catch the output: print Content-type: text/plain\n\n; use warnings; use strict; use Safe; our $output = ''; my($cmpt) = new Safe 'MyRoot'; $cmpt-share('$output'); $cmpt-permit(qw(leaveeval entereval caller require :browse )); $cmpt-reval('EOI'); # redirect prints to a buffer use IO::String; my $str_fh = IO::String-new($output); select $str_fh; # put the normal code here print gnu\n; EOI if($@) { die $@; } select STDOUT; print $output; However, if I'm not supposed to use Safe in conjunction with mp, what *am* I supposed to use? I didn't say that. I just said that if it doesn't work for you... but as you have just shown that TIMTOWTDI ;) I might be possible to convince to write a version of Safe specifically for mp1, although I expect I shall have to experience more problems with the existing Safe code to be bothered. :-) You can always give it a try. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: mp2: multiple include paths accross virtual servers?
Carl Brewer wrote: I'm running into something that may be a feature(!) of my misunderstanding of how mp works. I've got this defined in a VirtualHost directive: PerlRequire /data/www/foo/secure/etc/startup.pl For a number of different virtual servers. Is it possible for mp2 (or mp in general) to keep state seperate between virtual servers? Ie: if I have a different include path set in a couple of different startup.pl scripts, will the different virtual servers keep them seperate, or can I only have the one across a particular httpd instance? I'm fearing that I'll need seperate httpd's for each seperate site? You need to add: PerlOptions +Parent See: http://perl.apache.org/docs/2.0/user/config/config.html#C_Parent_ __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: cookies and POST in pure MP2?
Carl Brewer wrote: Egor Korablev wrote: Hi How can I write and get cookies and get POST data (text) under MP2 handler without using apache::compat? You can either use libapreq, which is _almost_ there :) or hack yuor own bits up cribbed from CGI.pm or the test stuff in the mp2 test suite. That's what I'm using at the moment while assisting as best I can with the libapreq development. If you look through the archives for this list you'll find lots of useful bits pieces. probably you can just use CGI.pm. Carl doesn't want to use it, so he had to go to the pains to extract the wanted bits from it ;) make sure that you are using the latest CGI.pm. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
[Fwd: Call for Participation for ApacheCon US 2003]
FYI: -BEGIN PGP SIGNED MESSAGE- Call for Participation: ApacheCon US 2003 = November 16-19, 2002, Las Vegas, Nevada, US [Please feel free to forward this notice far and wide!] SUBMISSION DEADLINE: Monday, 25 August May 2003, 23:59 EDT Come share your knowledge of Apache software at this educational and fun-filled gathering of Apache users, vendors, and friends. Apache Software Foundation members are designing the technical program for ApacheCon US 2002 that will include over 40 sessions planned. We are particularly interested in session proposals covering: o Apache Web server topics (installation, compilation, configuration, migration, ...) o All Apache Software Foundation projects (Jakarta, mod_perl, Xerces, et cetera) o scripting languages and dynamic content (Java, PHP, Perl, TCL, Python, XML, XSL, etc.) o Security and eCommerce o Performance tuning, load balancing, high availability o tips for writing Apache Web server modules o Technical and non-technical case studies o new Web-related technologies Only educational sessions related to projects of the Apache Software Foundation or the Web in general will be considered (commercial sales or marketing presentation won't be accepted; please contact [EMAIL PROTECTED] if you're interested in giving a vendor presentation). If you would like to be a speaker at the ApacheCon US 2003 event, please go to the ApacheCon Web site, log in, and choose the 'Submit a CFP' option from the list there: http://ApacheCon.Com/html/login.html NOTE: If you were a speaker or delegate at a past ApacheCon, please log in using the email address you used before; this will remember your information and pre-load the CFP form for you. If this is your first time being involved with ApacheCon, please create a new account. ALL SESSIONS WILL BE 50 MINUTES LONG! If you wish to propose a session that will take two consecutive slots, please mention that in the comments section of the CFP form. - -- #kenP-)} Ken Coar, Sanagendamgagwedweinini http://Golux.Com/coar/ Author, developer, opinionist http://Apache-Server.Com/ Millennium hand and shrimp! -BEGIN PGP SIGNATURE- Version: PGPfreeware 6.5.8 for non-commercial use http://www.pgp.com iQCVAwUBPxwvUJrNPMCpn3XdAQESjAP+Ozou5pTexacvHoa3QpDKeHDFV4zbKRwN AB2ECcrlgCw8INxVfhrdiryvJJvS7yaBzXlBgictqCsBp1cLlqs/grMe44bhy4FK BfSVKNm2mp8NK9NTUz0YnQM02UGOlpj/pdwJU7WPQlwk29htdITcz+AyA0zLQ9TZ DlnJiGAHFjw= =c2Wd -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: MP2 Redirection
Jamie Krasnoo wrote: What would be the best way to redirect in MP2? How would I set the Location in the header? not any different from mp1 (assuming that you have been working with mp1 before, but the mp1 documentation and literature can be used as a reference for most mp2 things). something like this? my $r = Apache-request; # docs say $r-header_out and family are now deceased. that's right. And $r-headers_out() is available in mp1 for several years and should be used in mp1 as well to easy the transition. $r-headers_out(Location = '/some/place.html'); return Apache::DECLINED; why DECLINED? just return Apache::OK. I'm also not sure why do you use Apache-request, I assume you are inside a handler, not a registry script. Since if you are inside a registry script you don't need to return anything at all. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: MP2 Redirection
Jamie Krasnoo wrote: [...] $r-headers_out(Location = '/some/place.html'); return Apache::DECLINED; why DECLINED? just return Apache::OK. My mistake, its been a while and I'm just getting back into it. So its like I'm learning everything all over again. You can use OK? The example in the Eagle book uses REDIRECT within a handler for redirection. So I'm assuming it goes the same for MP2. You are right, one returns OK if using parsed headers, as in this example: sub handler { my $r = shift; my $location = $r-args; print Location: $location\n\n; Apache::OK; } I got the redirection to work. However I don't think its working as it should. Nowhere in the docs does it say that you have to load APR::Table with Apache::RequestRec and Apache::RequestIO to have $r-headers_out() to work. Without APR::Table loaded I get the error: [Tue Jul 22 03:56:35 2003] [error] [client 192.168.0.2] Can't locate object method STORE via package APR::Table at /www/web/perl/MyApache/Redirect.pm line 17. $r-headers_out returns a tied hash reference, so ones needs to load APR::Table in order to work with this reference. Doc patches are very welcome. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: what is $r-clear_rgy_endav?
wrote: Hi! What function $r-clear_rgy_endav($script_name) do in Apache::Registry before and $r-stash_rgy_endav($script_name) after eval-ing cgi script? resets the list of END blocks that possible have been inserted from the registry script. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Calling a mod_perl method from whithin a CGI script
Eric Ricardo Anton wrote: I have started using Apache::AuthCookie, which runs under mod_perl, for authentication. The problem is that the whole website Im working on is based on mod_cgi. I need the CGI scripts to call a mod_perl method in order to recognize the user that is logged in. Since I can't port the scripts from mod_cgi to mod_perl, how can I make a CGI script call a mod_perl method? Thanks for any help. let's say you have a script: print Content-type: text/plain\n\n; print Hello whoever you are\n; now you change it to be: my $r = shift; my $username = $r-connection-user || ''; print Content-type: text/plain\n\n; print Hello $username\n; or: my $r = Apache-request; my $username = $r-connection-user || ''; print Content-type: text/plain\n\n; print Hello $username\n; This is correct for mp1. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Content compression FAQ
Slava Bizyayev wrote: Oops, sorry for that. It should be OK now. http://devl4.outlook.net/devdoc/FAQ/compression.pod Thanks, committed __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: clones and parents (bug report)
Randy Kobes wrote: [..] Just to verify, I also get this with ActivePerl 806, Apache/2.0.47, and the current mod_perl cvs version. Here's some partial debug information: PERL58! 28083490() PERL58! 280648b5() and what are these two perl calls? modperl_perl_destruct(interpreter * 0x0089c794): line 130 + 9 bytes: modperl_perl.c Perhaps the interpreter struct is corrupt? modperl_interp_destroy(modperl_interp_t * 0x008a47c8): line 128 + 12 bytes: modperl_interp.c modperl_interp_pool_destroy(void * 0x00869b78): line 184 + 12 bytes: modperl_interp.c run_cleanups(cleanup_t * * 0x0089a7a8): line 1980: httpd-2.0.47\srclib\apr\memory\unix\apr_pools.c apr_pool_destroy(apr_pool_t * 0x00401585): line 758: httpd-2.0.47\srclib\apr\memory\unix\apr_pools.c main(int 0x00401d82, const char * const * 0x0001) line 619 APACHE! mainCRTStartup + 227 bytes KERNEL32! 77e7eb69() === -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: does pnotes() work at all in 1.27?
James Hartling wrote: I use pnotes all over the place in 1.27, and haven't noticed any problems. I just stepped through some code and everything looks good between the Init phase and the content handling phase. I'm using Apache::Request-instance everywhere so I'm dealing with the same request object, but even if you're using Apache::Request-new I'd still expect that to work. Apache::Request-instance is probably the magic pill for Mark ;) __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: DDD and mod_perl handler
Pablo Velasquez wrote: Hello, I've been searching for guidance on using DDD with mod_perl. (DDD is fantastic) [...] I've been reading online for the answer and there are some hints: Debugging mod_perl C Internals http://perl.apache.org/docs/2.0/devel/debug/c.html This document explains how to debug C internals, not perl. I've done some googling and found a post from Gerald answering a similar question for embperl. To debug mod_perl handlers under ddd, you need to configure Apache::DB normally, and next instead of starting httpd -x, you need to do: ddd --debugger '/home/httpd/httpd_perl/bin/httpd -f /home/httpd/httpd_perl/conf/httpd.conf -X -DPERLDB' --perl (adjust the paths) Now when you issue a request ddd will give you an interactive shell, just like you get with perl -d. It won't open the source file for you, since it doesn't know what that source file is. You have to open it manually via menu item 'Open Source' and finish the first execution in the interactive shell window. Only on the next request you will be able to step through with the source window. Moreover you won't be able to step through using the source window for registry scripts. This is because registry scripts aren't executed as files, but evaled as a string. Here is an example: httpd.conf: IfDefine PERLDB Perl use Apache::DB (); Apache::DB-init; /Perl Location / PerlFixupHandler Apache::DB #PerlFixupHandler Apache::SmallProf /Location /IfDefine Location /hello-world SetHandler perl-script PerlHandler Apache::HelloWorld /Location #file:Apache/HelloWorld.pm package Apache::HelloWorld; use strict; sub handler { my $r = shift; $r-send_http_header('text/plain'); print Hello ; print world\n return 0; } 1; 1) start ddd: ddd --debugger '/home/httpd/httpd_perl/bin/httpd -f /home/httpd/httpd_perl/conf/httpd.conf -X -DPERLDB' --perl 2) using the menu 'open source' for Apache/HelloWorld.pm. 3) issue a request: lynx --dump http://localhost:8000/hello-world using the DDD commands menu do 'finish' (sometimes twice). At this point all the output will go to the interactive shell console and not the client. 4) issue the request second time (this time in browser if wanted): lynx --dump http://localhost:8000/hello-world now you can step through the source code with ddd's commands menu, and even look at the contents of the variables in the 'Data' window. The pain is that you have to manually open the source file. If you can find how to make it programmatically please share with us. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Content compression FAQ
Slava Bizyayev wrote: Thanks Stas! Full POD file is available now at http://devl4.outlook.net/devdoc/FAQ/compression.pod Forbidden You don't have permission to access /devdoc/FAQ/compression.pod on this server. Slava - Original Message - From: Stas Bekman [EMAIL PROTECTED] Sent: Monday, July 14, 2003 12:42 AM Subject: Re: Content compression FAQ Great work, Slava. Please send the diff (or probably just the whole thing), or the URL where we can download it from and we'll update http://perl.apache.org/docs/tutorials/client/compression/compression.html -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: templating system opinions
Jesse Erlbaum wrote: Hey Ken -- Search the guide: http://perl.apache.org/search/swish.cgi?query=templatesbm=submit=sear ch I'm deeply amused that there are nearly as many articles about templating systems on perl.apache.org (30) as there are templating modules on CPAN! The search shows matching sections, not articles. Most of these matches belong to a single tutorial: http://perl.apache.org/docs/tutorials/tmpl/comparison/comparison.html __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Problem configuring and making mod_perl
Richard Kurth wrote: Thanks for the suggestion but it did not work I still get the same error. Also this is a rh9.0 Server it's possible that you don't have the kerberos package installed. What: % locate krb5.h gives? If you get nada, install the package and try again. I hit the same error trying to build on a rh9.0 workstation. This solved my problem: CPPFLAGS=-I/usr/kerberos/include export CPPFLAGS [...] -DMOD_SSL_VERSION=\2.8.12\ mod_ssl.c mv mod_ssl.o mod_ssl.lo In file included from /usr/include/openssl/ssl.h:179, from mod_ssl.h:116, from mod_ssl.c:65: /usr/include/openssl/kssl.h:72:18: krb5.h: No such file or directory [...] __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: mod_per2/PerlInc in Virtualhost
Thomas Schindl wrote: Hi, Is it possible to use different PerlINC-Paths in different virtual hosts in mod_perl2. In mod_perl1 I've used Apache::PerlVINC what do I use in mod_perl2? It's possible with threaded mpm: http://perl.apache.org/docs/2.0/user/config/config.html#toc_C_Parent_ __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: clones and parents
Marc M. Adkins wrote: No wonder this seemed familiar. I wrote pretty much the same memo six weeks ago. D'oh! I've been spending too much time at the keyboard... I thought I had dejavu ;) So is PerlOptions +Parent working? Whenever I enable it I get a segfault on W2K / Ap2.0.46 / mp1.99.10dev. have you submitted a bug report? http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: modperl2 Apache::HTTP_FORBIDDEN... [long post]
Shannon Eric Peevey wrote: use constant MP2 = ($mod_perl::VERSION = 1.99); # test for the version of mod_perl, and use the appropriate libraries BEGIN { if (MP2) { require Apache::Const; require Apache::Access; require Apache::Connection; require Apache::Log; require Apache::RequestRec; require Apache::RequestUtil; apache::Const-import(-compile = ^ This might be a typo, but if you change that to Apache::Const (upper case 'A'), does that help? Fantastic!!! I have been staring at all of the wrong code for way too long... :P Thanks for taking the time to find my error :) I should have a working version by the beginning of next week. I think that this still won't work. The reason: Apache::Const-import(-compile = 'HTTP_UNAUTHORIZED','HTTP_INTERNAL_SERVER_ERROR','DECLINED','HTTP_FORBIDDEN','OK'); only compiles the constants, it doesn't import them. Drop the '-compile =' part, and then they will be imported. -compile tell Apache::Const to not import the constants but to compile them. -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: modperl2 Apache::HTTP_FORBIDDEN and Apache::HTTP_INTERNAL_SERVER_ERRORimplemented?
Shannon Eric Peevey wrote: Stas Bekman wrote: speeves wrote: Hi! Just wondering if Apache::HTTP_FORBIDDEN and Apache::HTTP_INTERNAL_SERVER_ERROR have been implemented? I have been trying to port Apache::AuthenNTLM, and keep getting: [Tue Jul 15 16:46:08 2003] [error] failed to resolve handler `Apache::AuthenNTLM' [Tue Jul 15 16:46:08 2003] [error] [client 192.168.1.2] Bareword Apache::HTTP_FORBIDDEN not allowed while strict subs in u se at /usr/local/lib/perl/5.6.1/Apache/AuthenNTLM.pm line 593. Bareword Apache::HTTP_INTERNAL_SERVER_ERROR not allowed while strict subs in use at /usr/local/lib/perl/5.6.1/Apache/Authe nNTLM.pm line 597. Bareword Apache::HTTP_INTERNAL_SERVER_ERROR not allowed while strict subs in use at /usr/local/lib/perl/5.6.1/Apache/Authe nNTLM.pm line 632. BEGIN not safe after errors--compilation aborted at /usr/local/lib/perl/5.6.1/Apache/AuthenNTLM.pm line 671. Compilation failed in require at (eval 10) line 3. in the error_log. I have other constants that are imported from Apache::Const, so do not think that it is a problem with scope... Here is the code: line 593 -- return $self-{ntlmauthoritative} ? (defined($nonce) ? (MP2 ? Apache::HTTP_FORBIDDEN : Apache::Constants::HTTP_ FORBIDDEN) : (MP2 ? Apache::HTTP_INTERNAL_SERVER_ERROR : Apache::Constants::HTTP_INTERNAL_SERVER_ERROR)) : (MP2 ? Apache::DE CLINED : Apache::Constants::DECLINED) ; and line 632 --- # return MP2 ? Apache::HTTP_INTERNAL_SERVER_ERROR : Apache::Constants::HTTP_INTERNAL_SERVER_ERROR ; If you need more, let me know. Have you imported them? use Apache::Const compile -qw(Apache::HTTP_FORBIDDEN); All the available Apache:: constants are listed here: http://perl.apache.org/docs/2.0/api/Apache/Const.html Yeah, unfortunately... :( Why unfortunately? Though I seem to be chasing it down to a possible problem with the method handler: sub handler ($$) But even with a change to: sub handler : method This is an interesting one. How to make the two coexist in the same code base. Ideally you want to do this: sub handler1 ($$) {} sub handler2 : method {} *handler = MP2 ? \handler2 : \handler1; But probably it'll complain about different prototypes. Or it might just work. Give it a try. I'm still not able to access the imported CONSTANTS This is definitely the most complex port that I've done, so is taking me a little while to find all of the buggies... Will keep you posted :) probably because a mistake in my example above, drop the compile part. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: clones and parents
Marc M. Adkins wrote: So is PerlOptions +Parent working? Whenever I enable it I get a segfault on W2K / Ap2.0.46 / mp1.99.10dev. have you submitted a bug report? http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems I never know whether to submit a bug report or not. Often these things turn out to be known issues or I find out it was my own bug at some later time... If you get a segfault, chances are that something is broken, since the sw should gracefully handle cases when someone does something wrong and not segfault. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Problem configuring and making mod_perl
Richard Kurth wrote: I get this when I run locate krb5.h /usr/kerberos/include/gssapi/gssapi_krb5.h /usr/kerberos/include/krb5.h So I would say it is there Indeed. Next check the Makefile file and see why the path /usr/kerberos/include is not in includes list. e.g. you could manually fix it to add /usr/kerberos/include to the list, if CPPFLAGS doesn't have an effect. Richard Kurth wrote: Thanks for the suggestion but it did not work I still get the same error. Also this is a rh9.0 Server it's possible that you don't have the kerberos package installed. What: % locate krb5.h gives? If you get nada, install the package and try again. I hit the same error trying to build on a rh9.0 workstation. This solved my problem: CPPFLAGS=-I/usr/kerberos/include export CPPFLAGS [...] -DMOD_SSL_VERSION=\2.8.12\ mod_ssl.c mv mod_ssl.o mod_ssl.lo In file included from /usr/include/openssl/ssl.h:179, from mod_ssl.h:116, from mod_ssl.c:65: /usr/include/openssl/kssl.h:72:18: krb5.h: No such file or directory [...] __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: IPC Open
I'm getting the error message: [16307]ERR: 24: Error in Perl code: Can't locate object method OPEN via package Apache::RequestRec at /usr/lib/perl5/5.8.0/IPC/Open3.pm line 136. perl -MApache2 -MModPerl::MethodLookup -e print_method OPEN to use method 'OPEN' add: use Apache::RequestIO (); __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::Registry in mod_perl 2
[please don't take the threads off the list] ColinB wrote: --- Stas Bekman [EMAIL PROTECTED] wrote: ColinB wrote: So how can I go about installing just Apache::Registry from the mod_perl 1 tar file without having to install ALL of mod_perl 1 ? simply copy it into one of the dirs in your @INC. You will also need to load Apache::compat for it to work. Thanks. I've untarred mod_perl 1.0 and searched for any Registry* filnames: ./lib/Apache/RegistryBB.pm ./lib/Apache/RegistryNG.pm ./lib/Apache/Registry.pm ./lib/Apache/RegistryLoader.pm Do I need to copy ALL of these files (and maybe others?) or just the ./lib/Apache/Registry.pm file? If you are going to use only Apache::Registry you only need to copy lib/Apache/Registry.pm __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Double erroneous requests in POST with multipart/form-data
Mark Maunder wrote: I'm running all scripts under Apache::Registry and using Apache::Request because I'm handling file uploads. Sorry, should have included that. I did test this: I modified the Apache::Registry script that was being posted to so that it didn't create an Apache::Registry request object, but simply did a print Content-type: text/html\n\nTesting123\n; And I got the same double request problem. So it seems that it's Apache not liking that particular request for some reason. Here's something wierd. I telnetted to my server's port 80 and pasted the request, and it didn't reproduce the problem. Try using the command line user agent, e.g. lwp, lynx or else, where you can control the involvement of the user agent. For example you can see response headers, which probably aren't available under IE. [...] __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: modperl2 Apache::HTTP_FORBIDDEN and Apache::HTTP_INTERNAL_SERVER_ERRORimplemented?
speeves wrote: Hi! Just wondering if Apache::HTTP_FORBIDDEN and Apache::HTTP_INTERNAL_SERVER_ERROR have been implemented? I have been trying to port Apache::AuthenNTLM, and keep getting: [Tue Jul 15 16:46:08 2003] [error] failed to resolve handler `Apache::AuthenNTLM' [Tue Jul 15 16:46:08 2003] [error] [client 192.168.1.2] Bareword Apache::HTTP_FORBIDDEN not allowed while strict subs in u se at /usr/local/lib/perl/5.6.1/Apache/AuthenNTLM.pm line 593. Bareword Apache::HTTP_INTERNAL_SERVER_ERROR not allowed while strict subs in use at /usr/local/lib/perl/5.6.1/Apache/Authe nNTLM.pm line 597. Bareword Apache::HTTP_INTERNAL_SERVER_ERROR not allowed while strict subs in use at /usr/local/lib/perl/5.6.1/Apache/Authe nNTLM.pm line 632. BEGIN not safe after errors--compilation aborted at /usr/local/lib/perl/5.6.1/Apache/AuthenNTLM.pm line 671. Compilation failed in require at (eval 10) line 3. in the error_log. I have other constants that are imported from Apache::Const, so do not think that it is a problem with scope... Here is the code: line 593 -- return $self-{ntlmauthoritative} ? (defined($nonce) ? (MP2 ? Apache::HTTP_FORBIDDEN : Apache::Constants::HTTP_ FORBIDDEN) : (MP2 ? Apache::HTTP_INTERNAL_SERVER_ERROR : Apache::Constants::HTTP_INTERNAL_SERVER_ERROR)) : (MP2 ? Apache::DE CLINED : Apache::Constants::DECLINED) ; and line 632 --- # return MP2 ? Apache::HTTP_INTERNAL_SERVER_ERROR : Apache::Constants::HTTP_INTERNAL_SERVER_ERROR ; If you need more, let me know. Have you imported them? use Apache::Const compile -qw(Apache::HTTP_FORBIDDEN); All the available Apache:: constants are listed here: http://perl.apache.org/docs/2.0/api/Apache/Const.html __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: PerlOptions +Parent without ithreads
Stuart Johnston wrote: I am trying to setup Virtual Hosts each with their own Perl interpreter. I found the PerlOptions +Parent configuration but that requires ithreads. Is there another similar option I should look at that does not requre ithread? No. Perl interpreter pools are possible only with threads. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error stringnot specified)
Philippe M. Chiasson wrote: On Thu, 2003-07-03 at 01:24, Bill Marrs wrote: This fixed the bug for me. Great! Will commit it in the near future. (Can't seem to access the cvs server right now, crappy internet cafe) -1, this is a wrong solution. print ; should flush just like it did in mod_perl 1.0 if $| == 1; Consider this script: print Content-type: text/plain\n\n; local $| = 0; print start\n\n; local $| = 1; print ; sleep 5; local $| = 0; print end\n; print , must immediately flush the buffered data, since $| has changed from 0 to 1. One thing that could help is if someone could take the time to write a test for this bug. Unfortunately I don't seem to be able to reproduce the problem, so I can't debug the problem. It could be a bug on the mod_deflate's behalf as well. Philippe, were you able to reproduce the problem with Bill's setup? I was writing a test, but couldn't get it to fail... may be because i was using 2.0.47. Bill, do you have the problem with the latest apache version? Also Bill, why do you have this setup: Location /perl AddOutputFilterByType DEFLATE text/* SetOutputFilter DEFLATE /Location why adding it twice? You need only the latter inside Location, or alternatively only the former outside Location if you want it to be set globally: http://httpd.apache.org/docs-2.0/mod/core.html#addoutputfilterbytype __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Is statically-compiled mod_perl better?
It seems that at present it is not possible to build mod_perl 2.0 statically. It can only be built dynamically and loaded using LoadModule in httpd.conf. This seems strange if the preferred method of building is static. What was right for 1.0 doesn't necessarily right for 2.0. mod_perl 2.0 DSO seems to be just fine, besides having linking problems on certain OSes (like mac) which will be resolved as soon as an expert of the relevant OS will provide us help. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache config problem .. please help
Anyway, all this started from an attempt to access env. vars from legacy scripts running under registry. What is the easiest way to get env. var access without the accompanying performance penalty that mod_perl documentation talks about? If you need to have your scripts run unmodified, have PerlSetupEnv Off in all sections that you don't need to access the CGI env vars, and have it On only in those Locations that run legacy scripts. http://perl.apache.org/search/swish.cgi?query=PerlSetupEnvsbm=SecEsubmit=search __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::Registry - String Compaction == Less RAM?
Perrin Harkins wrote: On Mon, 2003-07-07 at 11:50, Nigel Hamilton wrote: I thought I could save some RAM by stripping out comments and whitespace before the eval step - so I quickly wrote a Registry-like handler that strips comments. Those don't take up any space in the actual compiled opcodes. The only space you could save is in the string that the file is initially loaded into and the $eval string that gets built up to pass to eval(). [...] I'd just like to add an example which shows you what exactly perl sees when it compiles your code: perl -MO=Deparse -le '\ print \ this is a string \ # hmm, some comment \ . another string \ # bummer, i should end the line now \ ;' prints: BEGIN { $/ = \n; $\ = \n; } print 'this is a stringanother string'; -e syntax OK Also see: __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::Registry - String Compaction == Less RAM?
[sent it out too early] Stas Bekman wrote: Also see: http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlResponseHandler __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [MP2 - BUG ?] Issue handing Apache config. error messages
Issac Goldstand wrote: Right. Could you possibly clarify the difference between SetHandler perl-script and SetHandler modperl? I'm still not sure I've got the straight of it yet... You must be kidding ;) Have you read the sections at the URL posted below? Stas Bekman wrote: Sreeji K Das wrote: [...] You need to use 'SetHandler perl-script' for that, see: http://perl.apache.org/docs/2.0/user/config/config.html#C_SetHandler_ __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: untainting PATH in mod_perl
Dominique Quatravaux wrote: Sorry, getting out of good ideas.. Surprise, surprise: I found out that my code does not work under mod_perl 1.23 either! And I found the real solution: one has to add PerlSetupEnv Off to the Apache configuration file. Now the untainting mumbo-jumbo in perl section works. Warning: this has the consequence of breaking the part of the CGI environment emulation that deals with environment (e.g. instead of $ENV{HTTP_USER_AGENT}, you now have to check Apache-request()-subprocess_env(HTTP_USER_AGENT)). Glancing at its source code, I don't think CGI.pm will survive that... BTW, I finally got around to reading mod_perl's source, and it is now clear to me that the environment, when being copied from -subprocess_env() into %ENV, gets tainted (around line 704 in src/modules/perl/mod_perl.c). The whole %ENV gets tainted, not just the HTTP_USER_AGENT and such from the CGI context, so PATH is tainted as well. This explains our now common problem - and also guarantees that there is no easy way out of it if you use CGI.pm yourself :-(. You need to untaint the variables before you use them. Since they get reset on every request, you need to untaint them inside your script/handler's run time, not the BEGIN block...: http://perl.apache.org/docs/1.0/guide/porting.html#BEGIN_blocks it should work just fine with mp1 and mp2. Relying on 'PerlSetupEnv Off' is not a very good idea, since if you want to release your code for others to use, they may not be able to turn it off, since it'll break their CGI-legacy code as you have observed. FWIW, I use the following code when I need to use ``|qx: local $ENV{PATH} = /bin:/usr/bin; local @ENV{ qw(IFS CDPATH ENV BASH_ENV) }; __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: mod_perl 1.0 and 2.0
Sreeji K Das wrote: [...] I'd also think mod_perl 1.x series may be discontinued after a while, as 2.x gets to be used widely (however, it may be a while). The term discontinued doesn't quite apply to Open Source software. A few years from now when the majority will move to mod_perl 2.0, mod_perl 1.0 might be not worked on actively, but being an open source the project it will be maintained as long as someone will volunteer to do that. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: compile issue: conflicting types for getline
Stewart, Eric wrote: Apologies for duplication - I've discovered some unexpected behavior with the pasting into a W2K session of VPC 6 on Mac 10.2.6 - and then got a little clicky and clicked on the wrong thing. :( On RedHat Linux 9.0, with Apache 1.3.27, PHP 4.3.2, and mod_perl 1.28, I'm getting a compile error. These, near as I know, are the latest stable versions of everything - which is why I suspect I'm running into this problem: make[2]: Entering directory `/usr/local/src/apache_1.3.27/src/support' gcc -c -I../os/unix -I../include -DLINUX=22 -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -I/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE `../apaci` htpasswd.c htpasswd.c:145: conflicting types for `getline' /usr/include/stdio.h:473: previous declaration of `getline' make[2]: *** [htpasswd.o] Error 1 make[2]: Leaving directory `/usr/local/src/apache_1.3.27/src/support' make[1]: *** [build-support] Error 1 make[1]: Leaving directory `/usr/local/src/apache_1.3.27' make: *** [build] Error 2 I've seen posts that point the finger at mod_perl. This may be the case as I've managed to compile another Apache server without mod_perl on a different system (RH 9 with PHP). However, I'm thinking it's more along the lines of a compiler (IOW, RedHat's use of gcc 3.2.2) issue. What I could really use is a solution to get past this point - I'd rather like to avoid downgrading either my OS or compiler. I also kind of need the support tools including htpasswd, so skipping them in the compile is highly undesired. ./configure options or even Makefile modifications are preferred. Code patches are acceptable, even to some extent expected, but I'm a lazy systems admin, not a programmer ... Of course, any assistance at all (as repeated and varied searches on groups.google and www.google only verify the problem's existence and have yet to provide a solution) is welcome and appreciated. Not quite a mod_perl problem per se. It's probably perl that includes /usr/include/stdio.h. However htpasswd.c's definition is static, so you can workaround it by simply doing: perl -pi -e 's|getline|my_getline|' src/support/*.c Of course this shouldn't have been a problem in first place, because this function is status. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Undocumented behaviour in Apache-print()?
Steve Hay wrote: Hi, I've just spent quite a while tracking down a problem with a web page generated by a mod_perl program in which 8-bit ISO-8859-1 characters were not being shown properly. The software runs via Apache::Registry, and works fine under mod_cgi. It turns out that the problem is due to a difference in behaviour between Perl's built-in print() function in Perl 5.8.0+ and the Apache-print() method that mod_perl overrides it with. I've consulted the documentation on the mod_perl website, and could find no mention of the difference. If my conclusions below are correct then this information may well be worth adding. [the rest of the very detailed analysis has been snipped] 5.8.0 is a pretty new perl version, which provides the new functionality, and it seems that hardly anybody has been using the UTF stuff with mod_perl. So I suppose you are the first one to hit the problem. Certainly we need to update mod_perl to handle this correctly. Would you be interested to try to make Apache-print() do the right thing? If not, we should log it in the STATUS file and hopefully someone will have the time and inclination to solve it. In any case a simple test that reproduces the problem will be needed. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Dynamically banning hosts
Mustafa Tan wrote: Is it possible to dynamically ban IP addresses using mod_perl. Like even the first connection from the specified ip will be rejected. I know that you can do this using httpd.conf but I am wondering how to do the same dynamically while Apache is running. Also how can I cope with denial of service attacks? I know there is no general solution to this, but is there a particular technique to ease the problem. The environment is one host that serves small number of people with a very limited bandwidth. in mod_perl 2.0 you can do it even better: http://perl.apache.org/docs/2.0/user/handlers/protocols.html#PerlPreConnectionHandler or during the normal mp1-like handler: http://perl.apache.org/docs/2.0/user/handlers/http.html#toc_PerlAccessHandler __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [mp2] Apache::DBI
Beau E. Cox wrote: Hi - I am running Apache 2.0.47/mod_perl 1.99-dev-10-cvs on SuSE Linux 8.2. I am trying to install and use Apache::DBI. [...] 2) The documentation says to configure mod_perl with: perl Makefile.PL PERL_CHILD_INIT=1 PERL_AUTHEN=1 PERL_AUTHZ=1 PERL_CLEANUP=1 PERL_STACKED_HANDLERS=1 These are mod_perl 1 parameters. I could not find any corresponding mod_perl 2 parameters. That documentation is talking about mod_perl 1.0, mod_perl 2.0 doesn't need any of these compile options. which URL you are talking about? Perhaps it should be fixed to say that you need these options only if you use mp1. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: module ported and doc addition...
Shannon Eric Peevey wrote: [...] Also, you don't realy have to do that. The old ala mp1 style works just fine. use Apache::Const qw(OK DECLINED) sub handler { return OK; } Well... I must have been smoking crack, 'cause I seem to remember a simple: return MP2 ? Apache::OK : OK throwing an error, hence, the change to: MP2 ? Apache::OK : Apache::Constants::OK Now that I test it, though, there doesn't seem to be a problem... :P May be you haven't been importing the constant. These two aren't the same: use Apache::Const qw(OK DECLINED); use Apache::Const -compile = qw(OK DECLINED); the latter only compiles the constants, the former compiles and imports it. [...] Thanks. I have received that permission from Mr. Horner since I have written this email. I have contacted the [EMAIL PROTECTED] gang, but they haven't responded yet. (No problems, as I am about to start on Apache-AuthNTLM.) I will upload another version to CPAN when they give me authorization. :) Also, I have ported: Apache-AuthenPasswd Apache-AuthzPasswd I've updated the online list. with notices as to the limitations of these modules. (I inherited these with the AuthenNIS mods... Haven't had a chance to port those yet, though.) They have been uploaded and indexed on CPAN. Since you now have the perms, you no longer need to get the blessing from the modules list. Simply go ahead and upload your module. First go to the PAUSE interface and check that you actually co-own the modules in question. Also need to get excited about getting the authperlldap mod done as well... :) ;) __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Memoize.pm and mod_perl
[EMAIL PROTECTED] wrote: Has anyone used the Memoize module extensively in a mod_perl environment? I am thinking of using it to cache queries from the database, particularly for lookups (somthing like $obj-get_name_from_id()). In many cases the data is static so I don't mind is staying over from one request to the next but I wanted to primarily use to limit the number of queries per http request. To keep the cache from growing (the website receives 20 hit/min on average w/ 20,000 users) I wanted to either implement a LRU/Expiration cache. The other alternative I was considering was to use a cleanup handler after every request. I would like to know any experiences/thoughts anyone has had of using Memoize in a mod_perl environment. Memoize should work just fine under mod_perl. If you need to reset the cache between requests you should call its flush_cache() function. refer to its manpage for more info. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [mod_perl] Re: Content compression FAQ
Ross Matt-QMR000 wrote: I like to be removed from this list but the un-scribe does not work for me. the problem is the mail address that I used way back when has been aliases. the list's help email explains how to unsubscribe from a different address, post to [EMAIL PROTECTED] for the details. If everything else fails please contact [EMAIL PROTECTED] __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: AuthenNTLM - Help
Francisco de Assis Tristão wrote: Frank, please, i am trying to configure AuthenNTLM on a solaris 2.8 (SPARC) machine. But i did not find any sample about how to configure httpd.conf. May you help me? I had compiled apache 2 version 2.0.46 with ssl suport (i am configuring it with mod_jk and Tomcat too). Do i need to have mod_perl installed? You certainly need to have mod_perl installed. This and other questions are answered at http://perl.apache.org/. However I'm not sure whether this module has been ported to mod_perl 2.0. Therefore you probably need to either port it, or use mod_perl 1.0, in case it wasn't ported yet. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: mod-perl - read
Siva Yendapalli wrote: I am totally a newbie to mod_perl. I could able to get the content length using $r-headers_in(Content-Length). but I don't see anything in the $buf when I call the function $r-read($buf,$r-headers_in(Content-Length)). I am sure I am doing some thing wrong with the configuration or with mod_perl program. Please can some body give me an example and what I should do with the configuration to load the program. You provide to little context to be able to answer your question. Which mod_perl are you using 1.0 or 2.0? Can you post a short code snippet that you have a problem with? Which phase are you calling the handler from? Or is it a registry script? __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Bareword Apache::OK not allowed, Apache::PerlSection
Alexander Newald wrote: Hello, I have installed mod_perl2 (http://perl.apache.org/dist/mod_perl-2.0-current.tar.gz, mod_perl-1.99_09) with cd mod_perl-1.99_09 perl Makefile.PL MP_INST_APACHE2=1 MP_AP_PREFIX=/usr/local/apache2 and added LoadModule perl_module modules/mod_perl.so Perl $ServerName = `hostname`; /Perl to my httpd.conf When I try to start the server I get [Mon Jul 14 14:46:25 2003] [error] failed to resolve handler `Apache::PerlSection' Syntax error on line 321 of /etc/httpd/httpd.conf: Bareword Apache::OK not allowed while strict subs in use at /usr/lib/perl5/site_perl/5.8.0/i686-linux/Apache/PerlSection.pm line 47. BEGIN not safe after errors--compilation aborted at /usr/lib/perl5/site_perl/5.8.0/i686-linux/Apache/PerlSection.pm line 58. Compilation failed in require at (eval 2) line 3. It doesn't matter what I put between Perl /Perl Any hints? works fine for me, may be you need to add: PerlModule Apache2 before your first Perl section? Also I'd suggest to always run your mod_perl server with: PerlSwitches -wT __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [RFC] web-messaging application for mod_perl
Adi Fairbank wrote: On, or in the near vicinity of Mon, 14 Jul 2003 18:49:58 +0300 Stas Bekman [EMAIL PROTECTED] has thus written: Probably the best bet is to give it some cool unique name, like Apache::AdiChat and then you are all set, since you are not going to take over [...] What's wrong with WebMessaging ? Do you foresee that interfering with some future software in the Apache:: namespace, or is it just too generic? I thought it was a good name since it accurately describes what it is: not webmail, not instant messaging, but web messaging. (basically, it's like those message boxes you get on a stock trading website when you login to your account) James has gone into a detailed reply why this could be a bad idea. I'd just add that it's very hard to choose a good name for a module. And it seems that unique k001 names never have such problems. Perhaps you can have a unique name for your application and in the future you will extract a framework from it, making your app use it and allowing other apps to do the same. So with time you will see whether Apache::WebMessaging is a good name and whether it fits well into the scope of what it's supposed to do. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Virtual Host Logging Perl Script
Jez Hancock wrote: Hi, I've just written a short perl script to perform logging for our virtual hosts. The code has plenty of comments so I'll paste it below. My question is: would it be possible to use mod_perl in some way to perform the function of the script? In testing the speed of the script seems reasonable enough, is there a better way to do what I'm doing below? Take a look at: http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlLogHandler a similar code will work for mp1 if you don't use 2.0. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: informational notice in Makefile.PL
Randy Kobes wrote: On Mon, 14 Jul 2003, Stas Bekman wrote: [ ... ] Are you talking about the dependencies list? by 'the current state of affairs with mod_perl 2.0', you mean that it's not indexed by PAUSE. It's available from CPAN. Actually, once it gets indexed by CPAN it'll break all the other modules which specify mod_perl (1.0) as a dependency and won't work with 2.0. Perhaps it might be an idea, at this stage, to recommend to module authors that, if their package is for mod_perl 1 only, to use a module like Apache::Constants in their PREREQ_PM (ie, something available only within mod_perl 1), and if it's for mod_perl 2 only, use something like Apache::Const, or something available only with mod_perl 2. This won't help existing packages, but it would at least alert people that a problem is on the horizon. Good idea, Randy. And there is an even more intuitive solution: either require Apache or Apache2, depending on which version you need. To help in this, perhaps it would be worthwhile to promote the use of Module::Install? A package (Module::Install::mod_perl?) could be made which would make available a function to test for the mod_perl version a user has, and then decide if this is appropriate for the package about to be installed. If the required mod_perl version isn't present, one could either offer to add the required version to PREREQ_PM, or else just die, as automated installs of mod_perl can be tricky. A lot of the code for this could be extracted from Apache::Test; Stas, you've also worked through this logic in making packages that include different versions for different mod_perl versions. Only the package author need have Module::Install::* when constructing the Makefile.PL - the necessary stuff for the added functionality is added to the distribution, making it transparent to the user. Yup, I was planning to look at how Module::Install solves this issue. Unfortunatelly I've missed the BOF last week at the OSCon that was discussing this module :( __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [mp2] Apache::Cookie
Swen Schillig wrote: Are there any plans to have Apache::Cookie or does mp2 code always has to use CGI if there are cookies needed ? Apache::Cookie is a part of the libapreq-2 library. It'll become available as soon as Apache::Request is released. You are more then welcome to join the libapreq list and help debug the current version. For more info see: http://httpd.apache.org/apreq/ __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Undocumented behaviour in Apache-print()?
Steve Hay wrote: 5.8.0 is a pretty new perl version, which provides the new functionality, and it seems that hardly anybody has been using the UTF stuff with mod_perl. 5.8.0 is actually a couple of days short of being one year old (happy birthday!), which is increasingly not that new any more. 5.8.1 should be out soon too. I meant that it was too new to be embraced by the crowd. it'll probably take a few more years before this will happen. In any case, this is just an excuse ;) As for hardly anybody using UTF8 stuff with mod_perl... I didn't think that I was until I realised that most XML parsers (certainly the two that I most uses -- XML::LibXML and XML::DOM) return all their data in Perl's internal UTF-8 format! Then the penny dropped that I was actually using it rather a lot :-) I thought XML was dead. Do people still use this archaic technology? I went to this session at this OS conference with many k00l ppls and there was this dude[1] who said that YAML is the future. Next they started talking about animals, and for some reason everybody liked ponie. All well, orange people [2], orange sites [3], orange ponies [4], jetlag, too many flights, too little sleep... 1: http://husk.org/pics/imgs/people/perl/london.pm_ingy_2001-07-30/ingy_nino_tired.jpg 2: http://husk.org/pics/imgs/people/perl/london.pm_ingy_2001-07-30/acme_perl_hacker_scary.jpg 3: http://search.cpan.org/ 4: http://ponie.kwiki.org/ http://www.poniecode.org/ ;) __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: untainting PATH in mod_perl
Peter B. Ensch wrote: FWIW, I use the following code when I need to use ``|qx: local $ENV{PATH} = /bin:/usr/bin; local @ENV{ qw(IFS CDPATH ENV BASH_ENV) }; But this code must be used in each scope where you intend to use backticks, a system call Etc. Is there no way to untaint your PATH environment one time for the script or handler? If you write code used by other people this is probably the only way to go. This is because you want to control the setting. What if PATH gets untainted at the server startup, but then some other module sets a new tainted value to $ENV{PATH}? So it's a good habit to have it local to the code that you run. Besides helps to avoid forking external processes. If you can rewrite your code: foreach(`/bin/ls $path`) { do something } (which is probably not the real code), not to `` but to read the file in, and process it, you eliminate the whole problem altogether. I realize that this is not always possible. How about abstracting untaint and `` into a single function: sub backticks { local $ENV{PATH} = /bin:/usr/bin; local @ENV{ qw(IFS CDPATH ENV BASH_ENV) }; qx(@_); } __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Bareword Apache::OK not allowed, Apache::PerlSection
[...] works fine for me, may be you need to add: PerlModule Apache2 before your first Perl section? Also I'd suggest to always run your mod_perl server with: PerlSwitches -wT Hello, I have done all this. As I had some more spare time I tried the cvs version and found that cvs version is working. The code of PerlSection.pm differs from the current tar and the cvs Is this a bug and I should post a bug report on it? That explains why I couldn't reproduce the problem, thanks. If it works in cvs why reporting a bug? Philippe has been working on PerlSections recently, so yes the cvs version is different from 1.99_09. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Undocumented behaviour in Apache-print()?
[putting the test case on the top] Steve Hay wrote: In any case a simple test that reproduces the problem will be needed. This test program reproduces the problem: use 5.008; use Encode; print Content-type: text/plain\n\n, decode('iso-8859-1', 'ü'); Use LWP's get program to get that from an Apache/mod_cgi setup, run it through UNIX's od -c (get http://localhost/cgi-bin/test.pl | od -c) and you get: 000 374 001 Try the same from an Apache/mod_perl setup and you get: 000 303 274 002 i.e. the double-byte UTF-8 character representing ü that has been output is converted back to ü by Perl's print() [ü is character 252, octal 374], but is left as the two bytes by Apache's print(). I've actually re-built my mod_perl using the half-formed patch given above and it fixes this particular test case! On my linux box it's 'od -b', 'od -c' prints the actual ascii chars. I've tested mp2 and it has the same problem. I've used a different version of your test: #!/usr/bin/perl -w use utf8; print Content-type: text/plain\n\n; $a = \xC3\xBC; utf8::decode($a); print $a; which gives the same char, as in: % perl -le '$a = \xC3\xBC; use utf8; utf8::decode($a); print $a;' ü mod_perl 1.0 and 2.0 respond with: GET 'http://localhost:8002/cgi-bin/test.pl' | od -b 000 303 274 and moc_cgi with 000 374 Hmm. We really need somebody who understands the internals of Perl and mod_perl better than me, but here's a first stab at it: The Perl source code contains a pp_print() function in pp_hot.c which I presume is basically CORE::print(). It makes use of a do_print() function. I think that function comes from doio.c, although it's actually called Perl_do_print() there. That function does some stuff with the UTF-8 flag, which I guess is the sort of thing that we're after. Here's a chunk of Perl_do_print() from Perl 5.8.0: if (PerlIO_isutf8(fp)) { if (!SvUTF8(sv)) sv_utf8_upgrade(sv = sv_mortalcopy(sv)); } else if (DO_UTF8(sv)) { if (!sv_utf8_downgrade((sv = sv_mortalcopy(sv)), TRUE) ckWARN_d(WARN_UTF8)) { Perl_warner(aTHX_ packWARN(WARN_UTF8), Wide character in print); } } I think what this does is look to see if the fp (a PerlIO *) has the :utf8 encoding layer. If so, then it upgrades the sv to UTF8 (which is always possible). If not, then it looks to see if the bytes pragma is enabled. If not, then it downgrades the sv from UTF8 (which is not always possible -- if that fails and the UTF8 warnings category is enabled then it outputs the good ol' Wide character in print warning). I have attempted to shoe-horn this into mod_perl's print() method (in src/modules/perl/Apache.xs). Here's the diff against mod_perl 1.28: [Unfortunately, I've had to comment-out the first part of that if block, because I got an unresolved external symbol error relating to the PerlIO_isutf8() function otherwise (which may be because that function isn't documented in the perlapio manpage).] --- Apache.xs.orig2003-06-06 12:31:10.0 +0100 +++ Apache.xs2003-07-15 12:20:42.0 +0100 @@ -1119,12 +1119,25 @@ SV *sv = sv_newmortal(); SV *rp = ST(0); SV *sendh = perl_get_sv(Apache::__SendHeader, TRUE); +/*PerlIO *fp = PerlIO_stdout();*/ if(items 2) do_join(sv, sv_no, MARK+1, SP); /* $sv = join '', @_[1..$#_] */ else sv_setsv(sv, ST(1)); +/*if (PerlIO_isutf8(fp)) { +if (!SvUTF8(sv)) +sv_utf8_upgrade(sv = sv_mortalcopy(sv)); +} +else*/ if (DO_UTF8(sv)) { +if (!sv_utf8_downgrade((sv = sv_mortalcopy(sv)), TRUE) + ckWARN_d(WARN_UTF8)) +{ +Perl_warner(aTHX_ packWARN(WARN_UTF8), Wide character in print); +} +} + PUSHMARK(sp); XPUSHs(rp); XPUSHs(sv); Besides the problem with PerlIO_isutf8(), there are other problems that spring to my mind straight away with this: - is getting the PerlIO * for STDOUT to right thing to be doing anyway? - if items 2, do we need to handle the UTF8-ness of each of those items individually before we join them? - we need to code this in such a way as to remain backwards compatible with older Perls. looks like this is the main question. Do we handle utf8 only for perl 5.8? __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [MP2 - BUG ?] Issue handing Apache config. error messages
Issac Goldstand wrote: [...] (Starting with mor_perl 2)... I'm toying with the idea of starting the porting tutorial, but I want to make sure it's written well for clueless people (which I probably still at least half count as :-)) and with accurate content. porting or starting? We already have a porting guide: http://perl.apache.org/docs/2.0/user/porting/porting.html a porting reference: http://perl.apache.org/docs/2.0/user/porting/compat.html Right - I read it, and it's reference. It's not a good guide. A guide should start with the basics. The mp_1 guide is one of the most beautiful pieces of electronic documentation in existance! It should be a book (I know: practical mod_perl) Seriously though - the guide is what personally turned me on to mod_perl, but the above two documents make me shiver and stay the hell away from mp_2. What's needed is a good friendly piece of documentation to get people moving... to mp_2 Certainly. Just remember that the guide is 4 years old. The 2.0 docs are a few months old. So all we need is to make it better. and even getting started: http://perl.apache.org/docs/2.0/user/intro/start_fast.html Will look at it shortly - Let's not bite off more than we can chew in one mouthful. I'd suggest to improve these docs where approapriate and start a new doc only if it really doesn't fit into the existing docs. I'm just not sure if it *does* fit... Let's see what you come up with and we can decides whether it fits or not. The idea is to avoid forks and have people collaborate on the single best source of documentation, rather than private projects. Private projects could be good, but given the complexity of mod_perl, having a good single source of documentation is a great boon for its acceptance. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Apache::Registry in mod_perl 2
ColinB wrote: This page: http://perl.apache.org/docs/2.0/user/porting/compat.html#C_Apache__Registry___C_Apache__PerlRun__and_Friends says that mod_perl 2's ModPerl::Registry does not chdir() into the script's directory, wheras mod_perl 1's Apache::Registry DOES chdir(). It also says that this will eventually be fixed by the time mod_perl 2 is released, and in the meantime you can use the Apache::Registry (which is part of mod_perl 1) in mod_perl 2. As I will be trying to get some old scripts working in mod_perl 2, it seems prudent to use Apache::Registry. You have omitted this sentence: However you will have problems if you are using anything but the preforked MPM, the main reason why ModPerl::Registry doesn't chdir(). So how can I go about installing just Apache::Registry from the mod_perl 1 tar file without having to install ALL of mod_perl 1 ? simply copy it into one of the dirs in your @INC. You will also need to load Apache::compat for it to work. Alternatively you can subclass ModPerl::Registry's chdir_file function to perform chdir, like Apache::Registry does. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [mp2 Patch] BUG with mod_deflate and $|=1 (20014:Error stringnot specified)
Bill Marrs wrote: At 04:24 AM 7/15/2003, Stas Bekman wrote: Philippe M. Chiasson wrote: On Thu, 2003-07-03 at 01:24, Bill Marrs wrote: This fixed the bug for me. Great! Will commit it in the near future. (Can't seem to access the cvs server right now, crappy internet cafe) -1, this is a wrong solution. print ; should flush just like it did in mod_perl 1.0 if $| == 1; Consider this script: print Content-type: text/plain\n\n; local $| = 0; print start\n\n; local $| = 1; print ; sleep 5; local $| = 0; print end\n; print , must immediately flush the buffered data, since $| has changed from 0 to 1. This may be naive, but might it not flush the output buffer at the 4th line (local $| = 1;)? ...or does the flush only happen when print is called. Having to call print seems cumbersome to do a flush, but maybe that's just the way Perl works? There is $r-rflush for this purpose. This is not a perl API, but Apache API. You can also use IO::File or other IO packages that extend perl to provide this kind of API. But this is how perl works, so we have to preserve it under mod_perl. One thing that could help is if someone could take the time to write a test for this bug. Unfortunately I don't seem to be able to reproduce the problem, so I can't debug the problem. It could be a bug on the mod_deflate's behalf as well. Philippe, were you able to reproduce the problem with Bill's setup? I was writing a test, but couldn't get it to fail... may be because i was using 2.0.47. Bill, do you have the problem with the latest apache version? Did you see my note in the original post about this working fine under mod_cgi, but causing the 20014:Error only under mod_perl? This seemed to point the finger squarely at mod_perl. If I was able to reproduce it I could tell, but I don't seem to. I could upgrade to 2.0.47, but it seems unlikely that it would fix this. Are you sure you're running a mod_perl without Philippe's fix (in Apache__RequestIO.h), I assumed he eventually checked it in. No, Philippe hasn't committed it, neither I have used it. If you can test with 2.9.47 that will help. Otherwise I'll later try with .46 as well. Also Bill, why do you have this setup: Location /perl AddOutputFilterByType DEFLATE text/* SetOutputFilter DEFLATE /Location why adding it twice? You need only the latter inside Location, or alternatively only the former outside Location if you want it to be set globally: http://httpd.apache.org/docs-2.0/mod/core.html#addoutputfilterbytype Ah, I misunderstood the mod_deflate docs. I think at the time, it didn't seem to work with just one of them in-place, so I added the other. *SHRUG* I can't say I'm a pro at Apache config files, I just tinker until it works. I assume this is irrelevant to the bug, though. I'm not sure if your config doesn't insert the filter twice. Need to check whether SetOutputFilter overrides AddOutputFilterByType as well. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Undocumented behaviour in Apache-print()?
Steve Hay wrote: Stas Bekman wrote: I have attempted to shoe-horn this into mod_perl's print() method (in src/modules/perl/Apache.xs). Here's the diff against mod_perl 1.28: [Unfortunately, I've had to comment-out the first part of that if block, because I got an unresolved external symbol error relating to the PerlIO_isutf8() function otherwise (which may be because that function isn't documented in the perlapio manpage).] --- Apache.xs.orig2003-06-06 12:31:10.0 +0100 +++ Apache.xs2003-07-15 12:20:42.0 +0100 @@ -1119,12 +1119,25 @@ SV *sv = sv_newmortal(); SV *rp = ST(0); SV *sendh = perl_get_sv(Apache::__SendHeader, TRUE); +/*PerlIO *fp = PerlIO_stdout();*/ if(items 2) do_join(sv, sv_no, MARK+1, SP); /* $sv = join '', @_[1..$#_] */ else sv_setsv(sv, ST(1)); +/*if (PerlIO_isutf8(fp)) { +if (!SvUTF8(sv)) +sv_utf8_upgrade(sv = sv_mortalcopy(sv)); +} +else*/ if (DO_UTF8(sv)) { +if (!sv_utf8_downgrade((sv = sv_mortalcopy(sv)), TRUE) + ckWARN_d(WARN_UTF8)) +{ +Perl_warner(aTHX_ packWARN(WARN_UTF8), Wide character in print); +} +} + PUSHMARK(sp); XPUSHs(rp); XPUSHs(sv); Besides the problem with PerlIO_isutf8(), there are other problems that spring to my mind straight away with this: - is getting the PerlIO * for STDOUT to right thing to be doing anyway? - if items 2, do we need to handle the UTF8-ness of each of those items individually before we join them? - we need to code this in such a way as to remain backwards compatible with older Perls. looks like this is the main question. Do we handle utf8 only for perl 5.8? It's only Perl 5.8 that has the special UTF-8 flag which the functions above all operate with respect to. If a Perl variable contains a sequence of bytes that make up a valid UTF-8 character, but the string is not flagged with Perl's special flag, then Perl's built-in print() doesn't do this automatic conversion anyway. Yes. Apps wanting to handle utf will need to 'require 5.008;' as in your example. IOW, print Content-type: text/plain\n\n; $a = \xC3\xBC; print $a; retrieved from a mod_cgi server produces (via od -b / od -c): 000 303 274 002 yup, because you need to add utf8::decode($a); before printing $a. Which your version does as well. Perl 5.6 and older don't have the UTF-8 flag and hence don't do any automatic conversion via print(). Therefore, mod_perl's print() should not have the difference from Perl's print() that exists in 5.8, so no change should be required. Sure enough, looking at the doio.c source file in Perl 5.6.1, the entire chunk of code that I half-inched above is not present. So you suggest that we copy this functionality from Perl. So if need to #ifdef it for 5.8.0. I have attempted to shoe-horn this into mod_perl's print() method (in src/modules/perl/Apache.xs). Here's the diff against mod_perl 1.28: [Unfortunately, I've had to comment-out the first part of that if block, because I got an unresolved external symbol error relating to the PerlIO_isutf8() function otherwise (which may be because that function isn't documented in the perlapio manpage).] --- Apache.xs.orig2003-06-06 12:31:10.0 +0100 +++ Apache.xs2003-07-15 12:20:42.0 +0100 @@ -1119,12 +1119,25 @@ SV *sv = sv_newmortal(); SV *rp = ST(0); SV *sendh = perl_get_sv(Apache::__SendHeader, TRUE); +/*PerlIO *fp = PerlIO_stdout();*/ if(items 2) do_join(sv, sv_no, MARK+1, SP); /* $sv = join '', @_[1..$#_] */ else sv_setsv(sv, ST(1)); +/*if (PerlIO_isutf8(fp)) { +if (!SvUTF8(sv)) +sv_utf8_upgrade(sv = sv_mortalcopy(sv)); +} +else*/ if (DO_UTF8(sv)) { +if (!sv_utf8_downgrade((sv = sv_mortalcopy(sv)), TRUE) + ckWARN_d(WARN_UTF8)) +{ +Perl_warner(aTHX_ packWARN(WARN_UTF8), Wide character in print); +} +} + PUSHMARK(sp); XPUSHs(rp); XPUSHs(sv); Besides the problem with PerlIO_isutf8(), mod_perl 1.x doesn't use perlio, hence you have this problem. adding: #include perlio.h should resolve it I think. there are other problems that spring to my mind straight away with this: - is getting the PerlIO * for STDOUT to right thing to be doing anyway? PerlIO *fp = IoOFP(GvIOp(defoutgv)) - if items 2, do we need to handle the UTF8-ness of each of those items individually before we join them? I'm not sure, how perl handles this? __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: module ported and doc addition...
Shannon Eric Peevey wrote: Stas Bekman wrote: Shannon Eric Peevey wrote: [...] Also, you don't realy have to do that. The old ala mp1 style works just fine. use Apache::Const qw(OK DECLINED) sub handler { return OK; } Well... I must have been smoking crack, 'cause I seem to remember a simple: return MP2 ? Apache::OK : OK throwing an error, hence, the change to: MP2 ? Apache::OK : Apache::Constants::OK Now that I test it, though, there doesn't seem to be a problem... :P May be you haven't been importing the constant. These two aren't the same: use Apache::Const qw(OK DECLINED); use Apache::Const -compile = qw(OK DECLINED); the latter only compiles the constants, the former compiles and imports it. [...] Just started working on Apache-AuthNTLM and came across the cross reference that you posted awhile back. This might be where I got it: sub handler { # ... return MP2 ? Apache::OK : Apache::Constants::OK; } 1; in the mod_perl 1.0 and 2.0 Constants Coexistence section of: http://perl.apache.org/docs/2.0/user/porting/compat.html#C_Apache__Constants_ Yup, in mod_perl 2.0 we should better use fully qualified constants, because now we have APR:: and Apache:: constants, hence the docs use this style everywhere. However the mp1's style works as well. Though I haven't checked whether there are any overlaps if the top level is removed. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Virtual Host Logging Perl Script
Perrin Harkins wrote: On Tue, 2003-07-15 at 14:27, Jez Hancock wrote: On Tue, Jul 15, 2003 at 01:32:11PM +0300, Stas Bekman wrote: Take a look at: http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlLogHandler a similar code will work for mp1 if you don't use 2.0. Much obliged, that does look to be something I could use. Reminds me I need to be locking the logfile as well ;) Actually, if you are just printing one short line I think you'll be fine without locking on unix systems. See the FAQ: http://www.perldoc.com/perl5.8.0/pod/perlfaq5.html#All-I-want-to-do-is-append-a-small-amount-of-text-to-the-end-of-a-file.--Do-I-still-have-to-use-locking- Is this still correct in the threaded environment where the filehandle is shared across several threads? The writes are atomic 4k or so, indeed, but what happens if two threads write to the same filehandle at the same time on the SMP machine? Won't things get messed up? I haven't checked, perhaps perlio already provides an internal locking. Arthur would be a good person to ask. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Virtual Host Logging Perl Script
Perrin Harkins wrote: On Tue, 2003-07-15 at 16:11, Stas Bekman wrote: Is this still correct in the threaded environment where the filehandle is shared across several threads? Why would the filehandle be shared? Wouldn't you open a new handle in each thread? Because it's shared on the OS level. You open a new perl IO handle in each thread, but I think that they all use the same filedescriptor underneath. I think Arthur was mentioning that at his ithreads talk. Need to run some tests to confirm that. I expect this would be fine, since the behavior is enforced by the system library rather than by Perl. You can always use flock if you're feeling paranoid about it though. Are you sure? Won't flock maintain a process-wide flag? Unless there is a special threads-aware implementation that does it right. This is of course just rambling based on known issuws with all the other process-wide variables like cwd, chroot, environ, etc. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Few Important Questions
Eric Cholet wrote: Mustafa Tan wrote: Hi Everybody, mod_perl is a great software. Thanks for everybody who spent time on it and make it available. When you send a reply to this, can you also describe how we can help, as an individiual, to support mod_perl and people behind it financially. Mustafa, one way to provide financial support is a donation: http://www.apache.org/foundation/contributing.html There's a paypal button on that page, and an address for sending checks. The ASF is a non profit org which makes donations tax deductible. mod_perl relies on the ASF infrastructure for its CVS server, mailing lists and web sites. Donations help fund these infrastructure expenses. Actually I think it's better to contribute to perl foundation instead. Since it now supports specific grants for specific tasks/people, whereas ASF's donation won't go to the mod_perl developers but will be used to support the global ASF infrastructure (which is of course not least important, but that won't fulfill your goal) Therefore if you have someone who you want to sponsor you can submit a request for it here: http://www.perl-foundation.org/index.cgi?page=grants __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: module ported and doc addition...
Shannon Eric Peevey wrote: Shannon Eric Peevey wrote: Hi! Just wanted to let everyone know that I have just finished porting the Apache-AuthExpire module to work with both modperl1 and 2. It is a: # Small mod_perl handler to provide Authentication phase time outs for # sensitive areas, per realm. There are some issues with konqueror, mozilla and netscape, but should be a simple fix if someone is watching the headers Great, I've updated the online list of ported modules. Possible documentation inclusion...?: When using a ternary conditional in conjunction with a conditional operator, I needed to enclose the statement with parentheses to force the ternary conditional to be executed first. For example: my ($res, $sent_pw) = $r-get_basic_auth_pw; return $res if $res != (MP2 ? Apache::OK : Apache::Constants::OK); # return not OK status if not OK well, this is not a mod_perl issue. '=~' has a higher precedence than '?:' http://www.perldoc.com/perl5.8.0/pod/perlop.html#SYNOPSIS Also, you don't realy have to do that. The old ala mp1 style works just fine. use Apache::Const qw(OK DECLINED) sub handler { return OK; } Took me a while to catch that... :P speeves cws Is J. J. Horner on this list? (Are you out there...? :)) ) If so, can you contact me about getting permissions to upload the Apache-AuthExpire mod that I have ported? (So it can be indexed by PAUSE.) Also, Stas, is there a way that I can get around having to wait for an author to upload a ported module? I am not adding any functionality except making it work with both versions of modperl, and making additions that the CPAN testers have requested. I have a clear window for now, and would like to keep on porting mods while I have a little extra time... You can always upload a module, however it won't be indexed and then it's going to be a pain to reindex, since you will have to ask Andreas to do that. So I'd get the permissions resolved first. If you can't reach the original author you should email [EMAIL PROTECTED] explaining the situation and asking to give you the right perms (nowadays CPAN supports co-owners of namespaces). Meanwhile upload it somewhere online and post the link here, I'll link to it from: /http://perl.apache.org/products/apache-modules.html __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Socket-based porotocol module: how to re-use connection?
Jie Gao wrote: Hi All, I am playing with a socket-based protocol module based on Stas' MyApache::EchoSocket. I wonder what is needed to enable the function of re-using connections? As long as you don't quit the handler you keep the connection open. However I still have to investigate what are the issues with socket based protocol modules, there was a thread on the httpd-dev list saying that there some problems with it. So it's better to use bucket brigade based data manipulations. In perl we can use this: $server = IO::Socket::INET-new(LocalHost = my.host.com, LocalPort = 8899, ReuseAddr = 1, Proto = tcp, Listen= 200 ) How is this implemented http in mod_perl via Apache2 without using http? Any suggestions? it's not implemented in mod_perl, but in Apache 2 itself. You can look at the C source code and write similar in perl inside your handler. Most of the relevant logic resides in files starting with http_ in the apache source. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [ANNOUNCE] libapreq-1.2 release
Joe Schaefer wrote: libapreq-1.2.tar.gz (Apache::Request) is now on CPAN: file: $CPAN/authors/id/J/JO/JOESUF/libapreq-1.2.tar.gz size: 277549 bytes md5: ae08726f11ca25a215d4d854d675c3ff and at www.apache.org: file: http://www.apache.org/dist/httpd/libapreq-1.2.tar.gz sig: http://www.apache.org/dist/httpd/libapreq-1.2.tar.gz.asc key: http://www.apache.org/dist/httpd/KEYS Ah, shouldn't this be 1.20? I thought that 1.2 1.16. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [RELEASE CANDIDATE] Apache::Test 1.03-dev
Rob Bloodgood wrote: Tuesday, June 24, 2003, 1:51:51 PM, you wrote: JS Rob Bloodgood [EMAIL PROTECTED] writes: JS [...] *** root mode: changing the fs ownership to 'nobody' (99:99) /usr/sbin/httpd -X -d /root/.cpan/build/Apache-Test-1.03/t -f /root/.cpan/build/Apache-Test-1.03/t/conf/httpd JS Is the docroot (/root/.cpan/.../t/httpd.conf) inside JS a directory that nobody can read from? Probably JS not, from the looks of it. JS Try moving the Apache-Test-1.03 directory to /tmp and JS see if you have better luck there. Good spot! I changed permissions so 'nobody' could access the .cpan dir, and it immediately worked perfectly. Apache::Test and libapreq-1.2 now installed here! Yup, Philippe has mentioned this to me as well. When run as 'root', we do change the perms within the current distro dir, but we don't check whether the parent dirs have the read perms. I will add this check and make the program fail with an appropriate error if that's the case. e.g.: The directory /root/foo/Apache-Test-1.03 is not readable by user 'nobody', either make sure that all the dirs up to /root/foo/Apache-Test-1.03 are readable by that user, or move the whole tree to some other directory (e.g. /tmp) or run 'make test' as non-root! __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: informational notice in Makefile.PL
Shannon Eric Peevey wrote: Hi! In an attempt to simplify the install process for dependencies with my modules, I have been using the ExtUtils::AutoInstall module. (Great module, BTW :) ) But, with the current state of affairs with mod_perl and its availability from CPAN, I wanted to through an information notice to the effect of, if you are planning to use mod_perl2 and apache2, you will have to answer no here, and manually download it from perl.apache.org... I contacted Autrijus Tang, the maintainer of ExtUtils::AutoInstall, and asked him if it was possible, (I didn't see it documented), and he answered with this: # notify the user about mod_perl 2 BEGIN { print q{ NOTICE * If you are planning to use mod_perl2 and Apache2, please, do not answer yes when prompted to install mod_perl. You will need to download mod_perl2 manually from http://perl.apache.org/download/index.html * } } I placed it after the first BEGIN block and voila! I am communicating :) Are you talking about the dependencies list? by 'the current state of affairs with mod_perl 2.0', you mean that it's not indexed by PAUSE. It's available from CPAN. Actually, once it gets indexed by CPAN it'll break all the other modules which specify mod_perl (1.0) as a dependency and won't work with 2.0. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Books - was How practical is that Practical mod_perl?
Alex McLintock wrote: At 17:40 12/06/03 -0400, Perrin Harkins wrote: On Thu, 2003-06-12 at 17:31, Gedanken wrote: speaking of mod perl books, i have gotten lost somewhere. theres the eagle book, theres stas' book (practical mod_perl i learned today), and theres 'geoffs book'. what is the name of geoffs book please? It's mod_perl Developer's Cookbook. You can find info on all the known books linked from the front page of perl.apache.org: http://perl.apache.org/docs/offsite/books.html - Perrin By the way. My book reviews website http://news.diversebooks.com/ has reviews of several perl books. The system is being enhanced to make it easier to submit, find, and link to book reviews. (And yes - new development is being done in perl) Any feedback on how what sort of book reviews you like, and what you find uesful is welcome. This site seems to be offline. In any case if it's still alive, I'd suggest to ask perl.org webmasters to link to it. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: 6 months of labour
Clinton Gormley wrote: Hi all Well, my last 6 months of loving labour has finally drawn to a close with the launch of my site. http://www.traveljury.com is supposed to be an IMDB style travel site, which will contain the type of information you would find in Lonely Planet or Rough Guides, but contributed by a community. At the moment, it's pretty empty, but you've got to start somewhere :) Thanks to everybody who has pointed me in the right direction (and given their assurances about chosen directions!) I would appreciate any feedback, bug-reports and suggestions from all of you experienced webmasters out there, and any information or pictures you can contribute to traveljury would be greatly appreciated. I'm off to South America in a couple of weeks - laptop in hand - to start populating the database. We have a success stories collection, you may want submit a story for inclusion. See: http://perl.apache.org/outstanding/sites.html http://perl.apache.org/outstanding/success_stories/index.html __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [mp2] Having trouble setting params with CGI
Michael Maciag wrote: I'm trying to use CGI to get/set params within my mp2 PerlResponseHandler, at least until Apache::Request for mp2 is released. The get works just fine but my clients don't see the params I'm trying to set. Is it likely I just have an error somewhere or is there anything I have to do differently than just a simple: $q-param( -name = 'myparam', -value ='myvalue') in my handler? Do you have a simple example that reproduces the problem? Also make sure that you use the latest version of CGI.pm. 2.97 as of this writing. The best way to submit problems is to write a new test for the mod_perl 2.0 suite. You kill two birds at the same time when doing that, you learn how to write tests and save us a lot of time. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: ModPerl debugging
Christopher Knight wrote: Im getting an error with ModPerl::Registry and ModPerl::PerlRun (I tried both just in case)(that doesnt happen under CGI) that tells me I have an errror... (ya... that is about how usefull it is) ###SNIP### [Tue Jun 24 08:15:58 2003] [error] 16728: ModPerl::PerlRun: Not a CODE reference at /path/to/my/webserver/html/index.pl line 65. [Tue Jun 24 08:16:26 2003] [error] [client .] Deep recursion on subroutine ModPerl::RegistryCooker::default_handler at /usr/local/lib/perl/5.6.1/ModPerl/PerlRun.pm line 16. # the problem is, its not giving me any usefull information as to where the problem is... Considering I having about 10 custom modules that the script calls on, I dont have enough time to look at every line of code. Is there anyway to turn on super-debug mode... etc... so I can get more info? sure, set MOD_PERL_TRACE/PerlTrace to 'h' http://perl.apache.org/docs/2.0/user/config/config.html#C_PerlTrace_ Also if you can submit a short example that reproduces the problem I can look at it. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [mp2] Can't call method method on an undefined value ... TestRequest.pmline 411
Doug Wyatt wrote: Also, it appears that blib/lib/Bundle/ApacheTest.pm is missing a ';' at the end of the third line. thanks, committed. -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: mp2: some POST data is showing up as a hashref after I parseit
Carl Brewer wrote: Apache 2.0.46 modperl 1.99-10.dev (CVS snapshot from last night) perl 5.8.0 NetBSD 1.6.1 I've got a form that I'm posting to an MP2 script, and am parsing the output with the following subroutines : sub hash_post { # returns a hash of all the POST values my ($r) = shift; my $post_string = CB::read_post($r); my %rethash = {}; my @bits = split(//, $post_string); foreach my $bit (@bits) { $bit =~ /^(.*)=(.*)$/; my $key = CGI::Util::unescape($1); my $value = CGI::Util::unescape($2); $rethash{$key} = $value; } return %rethash; } CB::read_post() is : sub read_post { use Apache::Filter (); use APR::Bucket (); use APR::Brigade (); use constant IOBUFSIZE = 8192; use Apache::Const -compile = qw(MODE_READBYTES); use APR::Const-compile = qw(SUCCESS BLOCK_READ); use CGI::Util; my $r = shift; my $debug = shift || 0; my @data = (); my $seen_eos = 0; my $filters = $r-input_filters(); my $ba = $r-connection-bucket_alloc; my $bb = APR::Brigade-new($r-pool, $ba); do { my $rv = $filters-get_brigade($bb, Apache::MODE_READBYTES, APR::BLOCK_READ, IOBUFSIZE); if ($rv != APR::SUCCESS) { return $rv; } while (!$bb-empty) { my $buf; my $b = $bb-first; $b-remove; if ($b-is_eos) { warn EOS bucket:\n if $debug; $seen_eos++; last; } my $status = $b-read($buf); warn DATA bucket: [$buf]\n if $debug; if ($status != APR::SUCCESS) { return $status; } push @data, $buf; } $bb-destroy; } while (!$seen_eos); my $string = join '', @data; return $string; } The observant will notice that read_post() is pretty-much Stas's code from the mp test scripts, so I figure it's got to be good code (Stas wrote it :) ) This all seems to work quite nicely for the simple form I'm processing, like so : my %posted_data = CB::hash_post($r); foreach my $key (keys %posted_data) { $vars-{form}-{$key} = $posted_data{$key}; } The %vars gets thrown into template toolkit and as far as I can see, it looks fine, so I _think_ I'm parsing the POST data correctly at this point. But I then want to throw the data at a database insert : CB::submit_training_log($user_id, %posted_data); sub submit_training_log { my ($user_id,%values) = @_; # use DBI; #my $dbh = DBI-connect(DBI:mysql:.$db_name.:.$db_server, $db_user, $db_pass, { RaiseError = 1}) or return -1; my $fields = user_id; my $values = \'.$user_id.\'; foreach my $key (keys %values) { $fields .= ,$key; $values .= ,\'.$values{$key}.\'; } my $insert = INSERT into training_log ($fields) VALUES ($values); logit($log,$insert); # $dbh-disconnect; } (yes, I need to do lots of safety/sanity/taint checks etc ... ) What I see in the INSERT log message is this : INSERT into training_log ('user_id','av_hr','distance','time','percent_fat','max_speed','comments', 'time_e3','time_o2','max_power','weather','weight','resting_hr','day', 'mon','time_e1','motivation','fatigue','energy_burnt','max_hr','stress', 'time_e2','time_rec','location','planned_session','av_speed', 'actual_session','HASH(0x8d7be98)','av_power','time_se','soreness', 'sleep','year') VALUES ('1','','','','','','The session was great!','','','','funky','','','25','6','','1','1','','','1','','', '','','','As per planned session','','','','1','1','2003') There's a HASH(0x8d7be98) in there. That's a problem! Can anyone see where it might be coming from? All the form variables are accounted for, so it seems to be coming from nowhere? The onlyplace I can think of is the submit button? it definitely looks like a thing coming from the HTML page. Do you see it in the POSTed body? before you even parse it? __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Question about Apache::Request and query strings
Tom Gazzini wrote: I have a perl function which, amongst other things, needs to redirect the request to another page. It also needs to pass all the query parameters of the original request (both GET and POST) to the redirected page, and also add one parameter of it's own (an error message). Sounds simple enough, but I'm having problems with the passing paramters bit. Here's what I have: sub show_error { my ($r, $error) = @_; # $r is an Apache:Request object passed by the caller my $uri = URI-new($url); foreach my $p (@params) { $uri-query_form($p = $r-param($p)); } $uri-query_form(error = $error); $r-internal_redirect($uri-canonical); } But this doesn't work. The '?error=' query string gets passed, but the orginal request query strings don't. What am I doing wrong? And is there an easier way? This example may help: http://perl.apache.org/docs/1.0/guide/snippets.html#Reusing_Data_from_POST_request __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: mod_perl Redirect Error
Rasoul Hajikhani wrote: Hello there, We have just upgraded to : Apache/1.3.27 Ben-SSL/1.48 (Unix) PHP/4.2.3 mod_perl/1.27 configured Running perl 5.6.1. I am getting 302 error message on my redirects. This comes as a complete surprise since the same piece of code works just fine on: Apache/1.3.14 Ben-SSL/1.42 (Unix) PHP/4.0.3pl1 mod_perl/1.24_01 configured Here is my code: $r-headers_in-unset(Content-length); $r-header_out(Location = $uri); $r-status(REDIRECT); $r-send_http_header; return REDIRECT; I am not sure where to begin debugging. I first wanted to check w/ you guys to see if there are any quick fixes. I appreciate any feed back. This is probably because Apache has changed the way it handles return codes. I believe you should return OK as in this example: http://perl.apache.org/docs/1.0/guide/snippets.html#mod_rewrite_in_Perl __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [RFC] web-messaging application for mod_perl
Adi Fairbank wrote: On, or in the near vicinity of Tue, 1 Jul 2003 11:23:00 +0200 Enrico Sorcinelli [EMAIL PROTECTED] has thus spoken: On Mon, 30 Jun 2003 12:57:00 -0700 Adi Fairbank [EMAIL PROTECTED] wrote: Apache::WebMessaging I am about ready to release an intraserver web-messaging application for mod_perl. A brief description of the app follows; I'd like to hear some comments from the mod_perl/Perl/P5EE community on: You could look about Apache::* modules naming conventions: http://perl.apache.org/products/apache-modules.html#Module_Naming_Conventions Apache::App::WebMessaging namespace could be a right place :-) According to the asterisk note below Apache::App:: However, if you are planning a substantial framework with many inter-related modules, you should probably go with a top-level namespace outside of Apache::. This app already has 7-8 inter-related modules, though I would not call it a substantial framework. In fact it requires you to already have your own application framework setup in order to use it. It's basically a plug-in application for your existing mod_perl framework. I could rename it to just WebMessaging:: but it is specifically designed for mod_perl, which is why I think it should go in Apache::. Also, I noticed there are currently no Apache::App:: modules. Should this be the first?? Probably the best bet is to give it some cool unique name, like Apache::AdiChat and then you are all set, since you are not going to take over any future framework/namespaces... __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
[admin] please trim the quoted text in replies to a minimum
As I'm catching up with a big backlog of mod_perl emails I notice that some readers tend to either respond on top of a message with the original message quoted below it, and some readers nicely followup at the end of the message but keep the whole quoted original message on top. These approaches make the reading process harder, in addition to wasting network resources. You can certainly respond in any way you prefer, but if you can keep only the relevant paragraphs of the text you are responding to and trim the rest, it'll be easier for the rest of us to keep up with the threads. Remember that all posts are archived [1] and one can always retrieve the original message if it wasn't stored locally. Of course don't jump to the other exteme edge and overtrim. Use your common sense as a guide to how much is enough to keep the sufficient context. Thanks for your consideration! This issue is covered in our list's etiquette's guide: http://perl.apache.org/maillist/email-etiquette.html#Extracts_From_Other_Posts [1] http://perl.apache.org/maillist/modperl.html#Searchable_Archives __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: errors installing libapreq [RESOLVED]
Chris Devers wrote: Well, I rebuilt Apache/mod_perl, and it seemed to work. For those that hit the same error, the fix -- which I've saved as a script for future reference :) -- is as follows: * Install Apache/mod_perl: #!/bin/sh # chd.build.apachemodperl.sh perl=/sw/bin/perl modperldir=/usr/src/mod_perl-1.27 apachedir=/usr/src/apache_1.3.27 builddir=/usr/local/apache pushd $modperldir $perl Makefile.PL \ APACHE_SRC=../apache_1.3.xx/src \ APACHE_PREFIX=${builddir} \ APACHE_USER=www \ APACHE_GROUP=www \ DO_HTTPD=1 \ USE_APACI=1 \ EVERYTHING=1 \ APACI_ARGS='--sbindir=${builddir}/sbin, \ --sysconfdir=${builddir}/etc, \ --localstatedir=${builddir}/var, \ --runtimedir=${builddir}/var/run, \ --logfiledir=${builddir}/var/logs, \ --proxycachedir=${builddir}/var/proxy, \ --enable-module=so' make make test sudo make install pushd $apachedir sudo make install echo Verifying that the build worked: ${builddir}/sbin/apachectl configtest \ echo congratulations, you may now reset apache by running \ echo ${builddir}/sbin/apachectl start * Installation may disrupt Perl modules. I had to rebuild Apache::Test % sudo /sw/bin/perl -MCPAN -e shell cpan install Apache::Test * Install libapreq: % perl Makefile.PL \ -httpd /usr/local/apache/sbin/httpd \ -apxs /usr/local/apache/sbin/apxs % make % make test % make install Everything went smoothly up to the `perl Makefile.PL [...]` step, where I got this error: skipping test setup...Undefined subroutine Apache::Test::config called at /sw/lib/perl5/site_perl/5.8.0/darwin/Apache/TestMM.pm line 90. Warning: prerequisite Apache::Test 1.03 not found. We have unknown version. And, as I say, rebuilding Apache::Test in the CPAN shell took care of that. Others may hit different problems that could be fixed similarly. All better now :) That's all because of the issue case-insensitive issues with Apache/test.pm vs. Apache/Test.pm, which are no longer a problem, since mod_perl 2.0, no longer carries Apache/test.pm (it has been renamed to Apache/testold.pm). __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: make test fails when calling getaddrinfo() on 255.255.255.255
ColinB wrote: --- Stas Bekman [EMAIL PROTECTED] wrote: ColinB wrote: I am compiling mod_perl 2.0 on Solaris 9. When I run make test for mod_perl 2.0 it fails almost immediately with file vhost.c, line 232, assertion rv == APR_SUCCESS failed after it calls apr_sockaddr_info_get() with the hostname 255.255.255.255. I think this may have something to do with the test's http.conf containing _default_ virtual hostnames. apr_sockaddr_info_get() eventually calls getaddrinfo() with the nodename 255.255.255.255 which returns EAI_NONAME (no address associated with nodename). But if I call getaddrinfo() for 255.255.255.255 from another machine (which is running Solaris 8 although this may be unrelated), it returns 0. Is there something wrong with the configuration of my Solaris 9 machine - should getaddrinfo() always return 0 for 255.255.255.255 ? What happens if you add a simple vhost to your httpd.conf without even using mod_perl. I bet that this is an apache issue. I think I found a partial answer to this. I was searching the Apache bug database and I found a similar report (number 20063) by someone who was using SSL (I'm not) but had exactly the same assertion. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20063 It seems that a _default_ virtual host in httpd.conf which resolvs to 255.255.255.255 causes getaddrinfo to fail in Solaris unless the hosts: line in /etc/nsswitch.conf contained dns. I found that my hosts line did not contain dns, so I added it and sure enough, it solved the problem. It seems that only the presence of dns allows getaddrinfo to work correctly. The bug report was rejected as being an OS problem, so the solution is really a just a workaround. Do you think it's worth documenting here: http://perl.apache.org/docs/2.0/user/troubleshooting/troubleshooting.html ? If so, can you rewrite the above description and the workaround as a pod/text section that can be added as is to this document, if possible with a title that pinpoints the problem. Also it seems to be an issue for Apache::Test, not really for mod_perl itself. So we should probably add a new top level group 'Testing'. Thanks. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Flushing
Oskar wrote: Hi, I have script that is doing some time consuming operations hence have set $|=1 to disable buffering. It works correctly in command line but when I run it as cgi it does buffers everything and flushing does not work. After reaching timeout limit it displays server error. I have apache 1.3 Does anyone here has suggestion how to prevent it (other then increasing the timeout limit because it then returns 404 to client)? http://perl.apache.org/docs/1.0/guide/performance.html#Using1_Under_mod_perl_and_Better_print___Techniques_ __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Content compression FAQ
Slava Bizyayev wrote: Hi everyone, I've just updated the content at http://devl4.outlook.net/devdoc/FAQ/compression.html . It is supposed to be a final version, unless I missed something important. Great work, Slava. Please send the diff (or probably just the whole thing), or the URL where we can download it from and we'll update http://perl.apache.org/docs/tutorials/client/compression/compression.html We can update it as many times as needed, so there is no really need to first perfect it. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Magic number checking on storable error with Apache::Session::MySQL
Dan McCormick wrote: Hi, I'm running a site with Apache, MySQL, Mason, and Apache::Session::MySQL. I've been sporadically seeing this message in my error log: [Wed Jul 9 20:41:42 2003] [error] Magic number checking on storable string failed at blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/thaw.al) line 364, at /usr/lib/perl5/site_perl/5.6.1/Apache/Session/Serialize/Storable.pm line 27 Can anyone provide any clues as to why this might be happening? Is it implying the db data is corrupt? probably most likely unrelated to mod_perl, the error normally happens when you upgrade Storable and you try to read files that were created with older Storable version. perl users list/newsgroups is probably more appropriate for this issue. FYI, a cronjob deletes sessions that are more than 30 minutes old, but creating a session and then manually deleting it did not reproduce this error. Software specs: Apache 1.3.27 mod_perl 1.27 Apache::Session 1.54 MySQL 4.0.13 Thanks, Dan -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: make test fails
The Alliett's wrote: Trying to compile mod_perl 1.28 with apache 1.3.27 on redhat 7.3 system Here is the output of the errors. Any idea's on how to fix this. ../apache_1.3.27/src/httpd -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t httpd listening on port 8529 will write error_log to: t/logs/error_log letting apache warm up...\c done /usr/bin/perl t/TEST 0 still waiting for server to warm up...not ok server failed to start! (please examine t/logs/error_log) at t/TEST line 95. make: *** [run_tests] Error 9 [EMAIL PROTECTED] mod_perl-1.27]# tail t/logs/error_log [notice] Destruction-DESTROY called for $global_object Prototype mismatch: sub Socket::INADDR_ANY vs () at /usr/lib/perl5/5.6.1/i686-linux/Socket.pm line 329. Prototype mismatch: sub Socket::INADDR_BROADCAST vs () at /usr/lib/perl5/5.6.1/i686-linux/Socket.pm line 330. Prototype mismatch: sub Socket::INADDR_LOOPBACK vs () at /usr/lib/perl5/5.6.1/i686-linux/Socket.pm line 331. Prototype mismatch: sub Socket::INADDR_LOOPBACK vs () at /usr/lib/perl5/5.6.1/i686-linux/Socket.pm line 332. [Thu Jul 10 10:56:16 2003] [warn] [notice] child_init for process 22132, report any problems to [no address given] a possible reason for this issue: you have 5.6.1 installed but using a different perl version to build/test mod_perl, but for some reason 5.6.1 gets into the way. Dumping @INC may show some light (hint: perl -V) If you search the archives you will find more than one report and follow-ups on this issue. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: non-LFS Apache 1.3.27 w/ LFS Perl 5.8.0 (using mod_perl)
[EMAIL PROTECTED] wrote: Thanks for your prompt response! We did compile Apache with CFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 but we're trying to move away from this now, because of vendors like IBM and Oracle not willing to re-compile (websphere mods and mod_ossos) with the same flags. Thus without re-compiling my whole Perl 5.8.0 build I need to come up with a solution. Like I said before Doug MacEachern actually allows you to get away with this in mod_perl 1.27 (with mod_perl 1.24 it would squeal and terminate during compile time). Sorry for my ignorance but it does look like it will work (non-LFS Apache) provided that you don't try to access files larger then 2GB. Is there another low level consideration I'm not taking into account? Everything will work OK if all the components are compiled without large file support. Of course you won't be able to handle files 2GB. Last but not least...Perl 5.6.1 and greater compiles with LFS (default) and Apache has always compiled without it (unless you specifically specify it). Did you re-compile Apache with CFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64? mod_perl 1.x does it for you (i.e. uses perl's cppflags) if you build static (since it builds apache). perl -V:cppflags cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -I/usr/include/gdbm'; I'm not sure what happen if you build DSO. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: doc discrepancy?
Shannon Eric Peevey wrote: Hi! Just doing some late night reading, and found something in the second paragraph under the PerlAuthenHandler heading in the following webpage: http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlAuthenHandler !--- Otherwise the handler returns *|Apache::AUTH_REQUIRED|* to indicate that the user has not authenticated successfully. --- According to: http://perl.apache.org/docs/2.0/user/porting/compat.html#Deprecated_Constants AUTH_REQUIRED is depracated in favor of HTTP_UNAUTHORIZED. Is Apache actually returning AUTH_REQUIRED, which is then aliased behind the scenes? (I have been using HTTP_UNAUTHORIZED successfully in conjunction with both versions of modperl...) Thank you, Shannon, I've corrected that document as per your advice. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
[RELEASE CANDIDATE] Apache::Test 1.03-dev
I've uploaded 1.03's release candidate. If nobody finds any faults, I'll upload it tomorrow on CPAN. (libapreq needs to rely on 1.03 fixes to release its 1.2's version). Please try it out: http://www.apache.org/~stas/Apache-Test-1.03-dev.tar.gz Test it with mod_perl 1.0: perl Makefile.PL -httpd /path/to/1.x/httpd make test and with mod_perl 2.0: perl Makefile.PL -httpd /path/to/2.x/httpd make test Alternatively you can do: APACHE=/path/to/1.x/httpd perl Makefile.PL make test or for C-style shell users: env APACHE=/path/to/1.x/httpd perl Makefile.PL make test __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: non-LFS Apache 1.3.27 w/ LFS Perl 5.8.0 (using mod_perl)
[EMAIL PROTECTED] wrote: Hey Sorry - it took 30 mins to receive the confirmation (wasn't sure if it went through successfully the 1st time)... Anyway, I don't have a BUG to report - all I want to know is, is it SAVE to run non-LFS Apache with LFS Perl using mod_perl LFS. It works...sure...but I'm not sure what the outcome will be if I deploy this solution into our production environment. Intermittent Segmentation Faults? Ah sorry then, I thought I'm concerned about Segmentation Faults meant that you had such. You can rebuild Apache with: CFLAGS=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64. Assuming that you don't trip on any functions that Apache considers unsafe on your os with largefiles enabled. See Makefile.PL for more info. The point is: You need to have both components to agree on sizeof() the vars they use. If they don't at best you will get immediate problem, at worst there will be subtle problems happening only in certain situations. It may work OK, if you call only methods which use variables, whose sizeof() doesn't change when LARGE_FILES are enabled. I know it's a big pain :( Same in mod_perl 2.0 and Apache 2.0. e.g. we have a problem with APR::PerlIO, and it seems that I've worked around it, by disabling -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 only for building this module, if perl was built with large files support. Your safest bet is to have both components compiled with the same large file flags. Again...sorry for the 'impatience' but I need to make a decision today if we're to go ahead with this solution... Understood. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [RELEASE CANDIDATE] Apache::Test 1.03-dev
[Xavier, please keep reports on the list so others won't have to duplicate the effort for reported platforms/setups ;) thanks ] Xavier Noria wrote: On Wednesday 18 June 2003 11:13, Stas Bekman wrote: I've uploaded 1.03's release candidate. If nobody finds any faults, I'll upload it tomorrow on CPAN. (libapreq needs to rely on 1.03 fixes to release its 1.2's version). Please try it out: http://www.apache.org/~stas/Apache-Test-1.03-dev.tar.gz Tests OK over here: Solaris (Intel), perl 5.8.0, Apache 1.3.27, mod_perl 1.27. fxn -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: mod_perl slower than expected? - Test Code!
Joe Schaefer wrote: Trevor Phillips [EMAIL PROTECTED] writes: [...] On my main dev box, ab gives an average of 8.8secs for the mod_perl run, and 7.2secs for the FastCGI run. The internal timer and printed output reflects these results too. How does the cgi/command-line version stack up? AFAICT your test isn't measuring any architectural differences between modperl and fastgci, just how well the server's embedded perl interpreter performs relative to perl itself. I wonder if compiling modperl as a DSO versus compiling it statically might explain the performance lag. I doubt that this makes any difference. I think what makes the difference is the fact that the mod_perl handler is setup via .htaccess. Have you tried setting it in httpd.conf? Otherwise it's parsed on each request, no surprises that it's slower. Also add: PerlModule Thrash PerlModule Apache::Request to your httpd.conf to pre-compile the modules. Moreover, your code loads Apache::Request, but doesn't use it. Unrelated to the case, but related to performance in general: eval use Time::HiRes;; if (!$@) { $Thrash::UseTimeHiRes = 1; } is probably a bit faster as: eval { require Time::HiRes }; if (!$@) { $Thrash::UseTimeHiRes = 1; } and neater as: use constant UseTimeHiRes = eval { require Time::HiRes }; __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [RELEASE CANDIDATE] Apache::Test 1.03-dev
Stas Bekman wrote: I've uploaded 1.03's release candidate. If nobody finds any faults, I'll upload it tomorrow on CPAN. (libapreq needs to rely on 1.03 fixes to release its 1.2's version). Please try it out: http://www.apache.org/~stas/Apache-Test-1.03-dev.tar.gz Thank you all very much for testing this release candidate. Apache::Test 1.03 is propogating to CPAN mirrors at this very moment. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: mod_perl 2 and file upload how-to
Alejandro Galue wrote: Hello, I need help in file uploading with mod_perl 2. Apache::Request is not compatible with mod_perl 2, and I want to know how can I upload file widthout using CGI.pm Please send me an example if possible. Simply copy the relevant code from CGI.pm. Alternatively if you have some time help Joe to finish the porting of Apache::Request, which is getting there. Join the apreq-dev list: http://httpd.apache.org/apreq/, and offer your help. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: how to unsubscribe from this list
Jordan Ward wrote: Can someone please direct me to where I can unsubscribe from this list. it's in the mail headers: list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:[EMAIL PROTECTED] -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Mod Image Magick
Augusto Flavio wrote: I have some problems when i try install the mod Image Magick. #perl -MCPAN -e 'install Image::Magick' [...] /usr/bin/make test -- NOT OK Running make install make test had returned bad status, won't install without force [...] and now? what i do? don't have idea. I fail to see the relation of this question to mod_perl. Please refrain from asking totally Off-topic questions here. The traffic on the list is quite high nowadays and we want to keep it focused on mod_perl, before people will start unsubscribing. Thank you for understanding that. There are plenty of other perl-related help lists where you can find the help you are looking for. Check: http://perl.apache.org/docs/offsite/other.html __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com