mos_perl2 on Windows
I just installed it via PPM (for ActiveStates 5.8.6.811). I had my site working under Apache1/CGI without problem. I upgraded to Apache2/mod_perl and I configured my site conf like so (per the docs): alias /reports "C:\path\to\reports" PerlModule ModPerl::PerlRun SetHandler perl-script PerlResponseHandler ModPerl::PerlRun PerlOptions +ParseHeaders Options +ExecCGI My httpd.conf looks like: # # MOD_PERL 2.0 # LoadFile "C:/Perl/bin/perl58.dll" LoadModule perl_module modules/mod_perl.so #PerlRequire "C:/Apache2/conf/extra.pl" <--- this errors out on APR.DLL even though it is there...Apache won't start unless I comment this out Apache starts without errors but I get the following error when trying to server up the page: [Mon May 23 11:46:57 2005] [error] [client 10.149.82.49] Attempt to serve directory: C:/path/to/reports/ This is my first "exposure" to mod_perl so maybe it is me? Robert
Re: mos_perl2 on Windows
On 5/23/05, Randy Kobes <[EMAIL PROTECTED]> wrote: > On Mon, 23 May 2005, Robert wrote: > > > I just installed it via PPM (for ActiveStates 5.8.6.811). > > I had my site working under Apache1/CGI without problem. > > > > I upgraded to Apache2/mod_perl and I configured my site conf like so (per > > the docs): > > > > alias /reports "C:\path\to\reports" > > > > PerlModule ModPerl::PerlRun > > > > > > SetHandler perl-script > > PerlResponseHandler ModPerl::PerlRun > > PerlOptions +ParseHeaders > > Options +ExecCGI > > > > > > My httpd.conf looks like: > > > > # > > # MOD_PERL 2.0 > > # > > LoadFile "C:/Perl/bin/perl58.dll" > > LoadModule perl_module modules/mod_perl.so > > #PerlRequire "C:/Apache2/conf/extra.pl" <--- this errors out on APR.DLL > > even though it is there...Apache won't start unless I comment this out > > > > Apache starts without errors but I get the following error when trying to > > server up the page: > > > > [Mon May 23 11:46:57 2005] [error] [client 10.149.82.49] Attempt to serve > > directory: C:/path/to/reports/ > > I take it this is for a request of >http://localhost/reports > You probably do want Apache to refuse; for security reasons, > you wouldn't want a user to get a listing of scripts in > such a directory. > > Do requests for >http://localhost/reports/some_script_that_does_exist > succeed? > > -- > best regards, > randy kobes > It does not: Apache log: [Mon May 23 14:05:47 2005] [error] [client 10.149.82.49] Options ExecCGI is off in this directory: C:/Documents and Settings/BHicks/My Documents/websites/LIVE/reports/test.cgi 403 Forbidden: You don't have permission to access /reports/test.cgi on this server. I do have the "AddHandler cgi-script .cgi" uncommented in the httpd.conf and "Options +ExecCGI" is in my site conf. I am using the example snippet from the perldocs for mod_perl as the test script: my $r = Apache2::RequestUtil->request; $r->content_type("text/html"); $r->send_http_header; $r->print("mod_perl rules!"); If I change the conf file to this: SetHandler perl-script PerlResponseHandler ModPerl::PerlRun PerlOptions +ParseHeaders Options +ExecCGI Order allow,deny Allow from all I now get the following error in the Apache2 log file: [Mon May 23 14:11:37 2005] [error] Can't locate object method "send_http_header" via package "Apache2::RequestRec" at (eval 5) line 5.\n Sorry if this is long, and I am so ignorant. : \ Robert
Re: Can't load perl file
"Nick Pietraniec" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Turns out it was an error in the mod_perl.pl file > > I took "Can't load" to mean "Where's this file?" Where I should have > taken it as "There's an error in this file" > What was the problem? I have that error as well and I used the example from the mod_perl site itself. Robert
Re: how to use mod_perl sections with mod_jk?
Just exactly how does $PerlConfig work? Can I put my entire configuration in a here document using $PerlConfig? What are the limitations with $PerlConfig? Quoting Robert Nicholson <[EMAIL PROTECTED]>: > I found a small discussion on $PerlConfig but where is the > documentation for this? > > For instance I don't know how it interacts with other Perl section > syntax within the same > Perl section. > > But are there limitations with using regular Perl section syntax with > other modules directives or should that be possible? > > On Aug 1, 2006, at 12:58 AM, Andreas J. Koenig wrote: > > >>>>>> On Mon, 31 Jul 2006 23:00:33 -0500, Robert Nicholson > >>>>>> <[EMAIL PROTECTED]> said: > > > >> So I'm trying to make a great deal of my httpd.conf dynamic based > >> primarily on hostname etc. > > > >> I have most of it working but I've found that at least in my case I > >> cannot use mod_jk directives in a perl section. > > > >> Q. Should I be able to use mod_jk directives in a perl section? > > > >> > >> push @JkWorkerProperty, [qw(worker.myWorker.port $workerPort)]; > >> > > > >> also I often want to do >> with Apache-> module() but how would I do say an Include where the > >> value was set in a perl stanza but the Include will be outside the > >> perl stanza. Failing that can I "Include" static httpd.conf > >> snippests in a perl section with say Apache-> include()? > > > >> Point is the path varies so I want to include where my variable has > >> scope. > > > > All this works if you use $PerlConfig instead of symbol table > > manipulations. $PerlConfig is like an include statement for a string. > > Works fine with apache1 but needs recent SVN for apache2. > > > > -- > > andreas > This message was sent using IMP, the Internet Messaging Program.
Re: how to use mod_perl sections with mod_jk?
Well I did try to put my entire configuration and it was producing errors so now I'm liberally using Perl Sections and I'm going to try to use $PerlConfig to solve my mod_jk problem. if I've got three perl sections and I use perlconfig on the second one will everything "join" together correctly then? Again, I tried a here document and it resulted in errors. basically $PerlConfig < That resulted in errors at least in my case. Quoting "Andreas J. Koenig" <[EMAIL PROTECTED]>: > > On Tue, 1 Aug 2006 11:06:15 -0500, [EMAIL PROTECTED] said: > > > Just exactly how does $PerlConfig work? > > Can I put my entire configuration in a here document using $PerlConfig? > > Yes. > > > What are the limitations with $PerlConfig? > > Try it out. > > The Apache::PerlSections manpage is a bit terse. But in Apache2 it's > better: http://perl.apache.org/docs/2.0/api/Apache2/PerlSections.html > As I said, it is like an Include statement on a scalar. > > > $PerlConfig = "Alias /foo /bar\n"; > > > It's that easy. > > > -- > andreas > This message was sent using IMP, the Internet Messaging Program.
Confused about variable scope.
So if my httpd.conf has multiple sections and I am doing something like this in the first one. for (`env`) { next unless /^X_/; /(.*)=(.*)/; $ENV{$1} = $2; push @PassEnv, $1; #print "$_\n"; } and I then do my $somevariable = $ENV{'X_KEY'}; in other Perl sections are these variables defined and what are their values. and is %ENV also populated in those Perl sections? Do I have to repeat the above code in every Perl Section where I want access to these values? This message was sent using IMP, the Internet Messaging Program.
Another question about variable scope.
So my httpd.conf includes another file that also has Perl Sections it seems that the in a file included by httpd.conf then the condition isn't true Why is that? This message was sent using IMP, the Internet Messaging Program.
Re: Another question about variable scope.
This was something else so please forget this particular question. Quoting [EMAIL PROTECTED]: > So my httpd.conf includes another file that also has Perl Sections > > it seems that the > so if httpd.conf loaded mod_perl and I try a > > > > in a file included by httpd.conf > > then the condition isn't true > > Why is that? > > > > This message was sent using IMP, the Internet Messaging Program. > > This message was sent using IMP, the Internet Messaging Program.
Re: Confused about variable scope.
The approach I'm using is the suggested approach in the mod perl book. Basically setup the environment in order to pass information to apache so that it's available in httpd.conf and then in httpd.conf to use mod perl to interrogate %ENV. One problem is that mod_perl clears out %ENV so what you see below is a way to repopulate it after that has happened. Quoting Jonathan Vanasco <[EMAIL PROTECTED]>: > > On Aug 1, 2006, at 4:38 PM, [EMAIL PROTECTED] wrote: > > for (`env`) { > > next unless /^X_/; > > /(.*)=(.*)/; > > $ENV{$1} = $2; > > push @PassEnv, $1; > > #print "$_\n"; > > } > > > > and I then do > > > > my $somevariable = $ENV{'X_KEY'}; > > my question is what exactly are you trying to do? this sounds like a > really assbackwards way to do what you really want done. > This message was sent using IMP, the Internet Messaging Program.
Re: how to use mod_perl sections with mod_jk?
Can you show me how this can be configured then without using $PerlConfig JkWorkerProperty worker.list=myWorker JkWorkerProperty worker.myWorker.port=$workerPort JkWorkerProperty worker.myWorker.host=127.0.0.1 JkWorkerProperty worker.myWorker.type=ajp13 JkWorkerProperty worker.myWorker.secret=secretword If I try push @JkWorkerProperty, "worker.list=myWorker"; it doesn't setup right. This is rather unique because it's valid apache syntax but not that common I'm now using $PerlConfig to work around this but I'd like to know if there was another way. This is how I'm my $logDir = $ENV{'X_LOGDIR'}; my $workerPort = $ENV{'X_WORKER_PORT'}; $PerlConfig .=< # repopulate %ENV for (`env`) { next unless /^X_/; /(.*)=(.*)/; $ENV{$1} = $2; push @PassEnv, $1; #print "$_\n"; } this essentially puts back what mod_perl took out of %ENV upon startup and it seems to remain in %ENV across all Perl Sections. I have not seen any example where PassEnv can be used instead of the above approach. --- http://perl.apache.org/docs/1.0/guide/config.html#Apache_Configuration_in_Perl http://perl.apache.org/docs/1.0/guide/porting.html#Passing_ENV_variables_to_CGI "The Perl %ENV is cleared during startup, but the C environment is left intact. With a combo of forking `env` and sections you can do even do wildcards matching. For example, this passes all environment variables that begin with the letter H:" --- What is the correct way to define a variable that can hold state that will survive across Perl Sections but yet won't end up in the httpd configuration? Do I have to declare a my and use $ENV everytime I need to refer to these variables in a Perl Section? Unfortunately with the mod_perl setup I'm using I cannot use Apache::PerlSections->dump so it's hard to verify things. Quoting Robert Nicholson <[EMAIL PROTECTED]>: > So can you or somebody else post a complete httpd.conf that makes use > of $PerlConfig then? > > On Aug 1, 2006, at 2:24 PM, Andreas J. Koenig wrote: > > >>>>>> On Tue, 1 Aug 2006 13:56:31 -0500, [EMAIL PROTECTED] said: > > > >> That resulted in errors at least in my case. > > > > You did read that I said you need SVN recent for apache2? > > > > -- > > andreas > This message was sent using IMP, the Internet Messaging Program.
Re: how to use mod_perl sections with mod_jk?
Well I've just converted all places in httpd.conf where I need to do interpolation to use here documents and $PerlConfig so consider me a convert. Quoting "Andreas J. Koenig" <[EMAIL PROTECTED]>: > >>>>> On Wed, 2 Aug 2006 14:16:00 -0500, [EMAIL PROTECTED] said: > > > Can you show me how this can be configured then without using > $PerlConfig > > JkWorkerProperty worker.list=myWorker > > JkWorkerProperty worker.myWorker.port=$workerPort > > JkWorkerProperty worker.myWorker.host=127.0.0.1 > > JkWorkerProperty worker.myWorker.type=ajp13 > > JkWorkerProperty worker.myWorker.secret=secretword > > I think such things can _only_ be done with $PerlConfig. That's why I > use it everywhere. I only have to write things as documented in the > apache docs and need not understand the subtleties of the other > variables supported by Apache*::PerlSections > > > If I try > > > push @JkWorkerProperty, "worker.list=myWorker"; > > > it doesn't setup right. > > Not surprising for me. > > > This is rather unique because it's valid apache syntax but not that > common > > I cannot understand your sentence because I see no valid apache syntax here. > > > I'm now using $PerlConfig to work around this but I'd like to know if > there > > was another way. > > > This is how I'm > > > > > > my $logDir = $ENV{'X_LOGDIR'}; > > my $workerPort = $ENV{'X_WORKER_PORT'}; > > > $PerlConfig .=< > JkWorkerProperty worker.list=myWorker > > JkWorkerProperty worker.myWorker.port=$workerPort > > JkWorkerProperty worker.myWorker.host=127.0.0.1 > > JkWorkerProperty worker.myWorker.type=ajp13 > > JkWorkerProperty worker.myWorker.secret=secretword > > JkLogFile $logDir/mod_jk.log > > JkLogLevel debug > > JkShmFile $logDir/jk-runtime-status > > END > > > Please note in order to do the $ENV above I have to have this. > > > > > # repopulate %ENV > > > for (`env`) { > > next unless /^X_/; > > /(.*)=(.*)/; > > $ENV{$1} = $2; > > push @PassEnv, $1; > > #print "$_\n"; > > } > > > this essentially puts back what mod_perl took out of %ENV upon startup > and it > > seems to remain in %ENV across all Perl Sections. I have not seen any > example > > where PassEnv can be used instead of the above approach. > > > --- > > > > http://perl.apache.org/docs/1.0/guide/config.html#Apache_Configuration_in_Perl > > > http://perl.apache.org/docs/1.0/guide/porting.html#Passing_ENV_variables_to_CGI > > > "The Perl %ENV is cleared during startup, but the C environment is left > intact. > > With a combo of forking `env` and sections you can do even do > wildcards > > matching. For example, this passes all environment variables that begin > with > > the letter H:" > > > --- > > > What is the correct way to define a variable that can hold state that > will > > survive across Perl Sections but yet won't end up in the httpd > configuration? > > Do I have to declare a my and use $ENV everytime I need to refer to > these > > variables in a Perl Section? > > If the Perl section are in the same file, I'd use lexical variables > because they are ignored by the mod_perl mechanism. If they are in > different files, pick names that are unlikely to be interpreted by > perl or mod_perl. Maybe use underscores or so. Definitely no need to > use %ENV, $robert_at_elastica::foo::bar works as well and doesn't > trigger perl's environment handling. > > > Unfortunately with the mod_perl setup I'm using I cannot use > > > Apache::PerlSections->dump so it's hard to verify things. > > > Quoting Robert Nicholson <[EMAIL PROTECTED]>: > > >> So can you or somebody else post a complete httpd.conf that makes use > >> of $PerlConfig then? > >> > >> On Aug 1, 2006, at 2:24 PM, Andreas J. Koenig wrote: > >> > >> >>>>>> On Tue, 1 Aug 2006 13:56:31 -0500, [EMAIL PROTECTED] said: > >> > > >> >> That resulted in errors at least in my case. > >> > > >> > You did read that I said you need SVN recent for apache2? > >> > > >> > -- > >> > andreas > >> > > > > > > > > This message was sent using IMP, the Internet Messaging Program. > > > > -- > andreas > This message was sent using IMP, the Internet Messaging Program.
Re: LOG: Re: Retrieve server environment vars before response handler.
Can anybody tell me why that doesn't work when you want to access environment variables set from the process that launches Apache and that you want to access those variables in your stanza in your httpd.conf? I recently had to do this because from what I could see PerlPassEnv doesn't work when you want to access the vars within the hander that's used in perl stanza's in httpd.conf. # repopulate %ENV for (`env`) { next unless /^VAR_/; /(.*)=(.*)/; $ENV{$1} = $2; push @PassEnv, $1; #print "$_\n"; } my $hostname = $ENV{'VAR_HOSTNAME'}; Quoting Fred Moyer <[EMAIL PROTECTED]>: > Accepting to folder lists/perl/mod_perl > This message was sent using IMP, the Internet Messaging Program.
OT: list digest? list adminstrator?
Hi, Subscription requests to the digest version are failing silently, and messages to the list admin are not replied. Any clues? thanks, ! Robert Friberg 0733-839080 ! Developer/Trainer perl,java,dotnet,linux,xml,uml,sql,c/c++,vb ! Ensofus AB http://www.ensofus.se/ ! Miljö Online AB http://www.miljo-online.se/ -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
[ANNOUNCE] HTML::GenerateUtil 1.02
I thought some people on this list might find this useful. http://search.cpan.org/~robm/HTML-GenerateUtil-1.02/ I think the "Context" section probably gives the best overview. --- When creating a web application in perl, you've got a couple of main choices on how to actually generate the HTML that gets output: * Programatically generating the HTML in perl * Using some template system for the HTML and inserting the data calculated in perl as appropriate Your actual application, experience and environment will generally determine which is the best way to. If you go the programatic route, then you generally need some way of generating the actual HTML output in perl. Again, there's generally a couple of ways of doing this. * Just joining together text strings in perl as appropriate. Eg. $link = "$text"; * Or using some function module like CGI Eg. $line = a({ href => $ref }, $text); * More complex object systems like HTML::Table The first seems easy, but it gets harder when you have to manually escape each string to avoid placing special HTML chars (eg <, etc) in strings like $text above. With the CGI, most of this is automatically taken care of, and most strings are automatically escaped to replace special HTML chars with their entity equivalents. While this is nice, CGI is written in pure perl, and can end up being a bit slow, especially if you already have a fast system that generates pages very heavy in tags (eg lots of table elements, links, etc) That's where this module comes it. It provides functions useful for escaping html and generating HTML tags, but it's all written in XS to be very fast. It's also fully UTF-8 aware. --- Comments and suggestions welcome. Rob -- [EMAIL PROTECTED] Sign up at http://fastmail.fm for fast, ad free, IMAP accessible email -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
[MP2 Bug] test case t/apr-ext/uuid.t failuer
ongdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='icc -g', ldflags ='-L/stf/altix/sys/lib -Wl,-rpath,/stf/altix/sys/lib' libpth=/stf/altix/sys/lib /lib /usr/lib libs=-lmalloc -ldb -lnsl -lndbm -lgdbm -ldl -lm -lc -lcrypt -lutil perllibs=-lmalloc -lnsl -ldl -lm -lc -lcrypt -lutil libc=, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.2.4' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared -L/stf/altix/sys/lib -Wl,-rpath,/stf/altix/sys/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_64_BIT_INT USE_64_BIT_ALL USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Built under linux Compiled at Jun 17 2004 20:59:34 %ENV: PERL_LWP_USE_HTTP_10="1" @INC: /stf/altix/sys/perl/lib/5.8/ia64-linux-multi /stf/altix/sys/perl/lib/5.8 /stf/altix/sys/perl/lib/site_perl/5.8/ia64-linux-multi /stf/altix/sys/perl/lib/site_perl/5.8 /stf/altix/sys/perl/lib/site_perl/5.8 /perl/lib/site_perl/5.005 . *** Packages of interest status: Apache::Request: - CGI : 3.05 LWP: 5.53, 5.79 mod_perl : 1.9914 3. This is the core dump trace: (if you get a core dump): No core dump This report was generated by t/REPORT on Fri Jul 2 00:05:50 2004 GMT. -8<-- End Bug Report --8<-- +---++ | Robert E. Bruccoleri, Ph.D. | Phone: 609 818 7251| | Research Fellow | Fax: 609 818 3100| | Applied Genomics | email: [EMAIL PROTECTED]| | Bristol-Myers Squibb Company | Ship: Room 3A-023,| | Mail: HW3-0.03, P.O. Box 5400 | 311 Pennington-Rocky Hill Rd | | Princeton, NJ 08543-5400| Pennington NJ 08534 | +---++ -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Problem with Apache::Session::MySQL
Hi, I have a strange problem with Apache::Session::MySQL. It create a session just fine, but it can't update itself. When I look at MySQL's binary log, I see the initial INSERT but I don't see any UPDATES: INSERT INTO sessions (id, a_session) VALUES ('9176a7b8acbfdc5697059d9a4fd6046a','\0\0\0 9176a7b8acbfdc5697059d9a4fd6046a\0\0\0 _session_id'); DO RELEASE_LOCK("Apache-Session-9176a7b8acbfdc5697059d9a4fd6046a"); DO RELEASE_LOCK("Apache-Session-9176a7b8acbfdc5697059d9a4fd6046a"); DO RELEASE_LOCK("Apache-Session-9176a7b8acbfdc5697059d9a4fd6046a"); DO RELEASE_LOCK("Apache-Session-9176a7b8acbfdc5697059d9a4fd6046a"); DO RELEASE_LOCK("Apache-Session-9176a7b8acbfdc5697059d9a4fd6046a"); The code: require DBI; # DataBase Interface, le "layer" pour se connecter à differentes bases de donnees require CGI; # Le module CGI, qui contient certaines fonctions utiles require Apache; # Le module Apache = mod_perl, l'interpreteur Perl inclu dans Apache require Apache::Session::Mysql; # Un module pour gerer les sessions avec l'aide de MySQL use Date::Format; # Pour des fonctions de date my $session_id = $wquery->path_info(); $session_id =~ s/\///g; ... $session{'lang'} = "fr"; And when I fetch the next page, $session{'lang'} is empty, the only key I have in %sessions is '_session_id'. I use Apache::Session::MySQL 1.01 on Mac OS X Server 10.3.4, with Apache/1.3.29 and mod_perl/1.26. MySQL's version is 4.0.18 on Linux. -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Problem with Apache::Session::MySQL
Le 04-07-14, à 18:03, Perrin Harkins a écrit : On Wed, 2004-07-14 at 17:45, Pascal Robert wrote: I have a strange problem with Apache::Session::MySQL. It create a session just fine, but it can't update itself. Usually this means that either your session object isn't going out of scope or the values you are writing are not at the top level. However, $session{'lang'} would be top-level. What happens if you explicitly untie the session at the end of the request? It works, thanks! -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
[mp1] 64 bit perl/apache and 32 bit shared objects
I'm having a bit of trouble with a 64 bit versions of perl and apache not playing nice with 32 bit shared objects under linux. We have an external shared object binary supplied by a vendor that we can link our XS code against just fine, but when we attempt to actually use the shared methods, perl core dumps. I think the problem is that the conversion from 64-bit T_IVs to ints is 32 bits too long for the shared methods, but I'm not 100% certain I'm right. Anyone ever run into this problem before? Can I solve it with XS? Rob -- Robert Landrum Systems Programmer -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
print rflush sendfile
I am experancing the following undesirable behavior. My code looks somethign like this.. $r->print("Some htmlish bits"); $r->rflush; $r->sendfile("/path/to/somefile"); $r->print("Some more htmlish bits"); $r->rflush; $r->sendfile("/path/to/someotherfile"); which I do twice before I finish the request. The problem is, the Some htmlish bits are showing up after the contents of the file.. at the same time, the someotherfile is showing up after all the htmlish bits. Tested on SuSE 9.0 and 9.1 and cpan says my mod_perl is uptodate. -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: print rflush sendfile
Paint me purple and color me an idiot, nevermind, I found my problem. thanks yall anyway. On Thu, 18 Nov 2004 20:13:19 -0700, Robert Ferney <[EMAIL PROTECTED]> wrote: > I am experancing the following undesirable behavior. > > My code looks somethign like this.. > > $r->print("Some htmlish bits"); > $r->rflush; > $r->sendfile("/path/to/somefile"); > $r->print("Some more htmlish bits"); > $r->rflush; > $r->sendfile("/path/to/someotherfile"); > > which I do twice before I finish the request. > > The problem is, the Some htmlish bits are showing up after the > contents of the file.. at the same time, the someotherfile is showing > up after all the htmlish bits. > > Tested on SuSE 9.0 and 9.1 and cpan says my mod_perl is uptodate. > -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Re: Shopping Cart Software
The question for me is, do they work under Apache2 or are they only working for Apache 1.3 On Sat, 20 Nov 2004 14:05:16 -0800 (PST), Fred Moyer <[EMAIL PROTECTED]> wrote: > > Use clickcartpro its Perl, its easy , and it rocks! > > > > Interchange is also worth taking a look at. > > http://www.icdevgroup.org/ > > > > > -- > Report problems: http://perl.apache.org/bugs/ > Mail list info: http://perl.apache.org/maillist/modperl.html > List etiquette: http://perl.apache.org/maillist/email-etiquette.html > > -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html
[Config] Upgrading, Need stable setup
Hi all, I'm running a lot of mod_perl handlers on a rather old Red Hat Linux, RH 6.0 on intel. Everything has been working fine until now. Server: Apache/1.3.6 (Unix) (Red Hat/Linux) mod_perl/1.21 perl -V output appended at the bottom I have created a handler for embedded perl. Pages with a .pxp extension are parsed and wrapped in an anonymous sub, eval'd and cached. The Apache::Request object is passed as an arg to the sub on invocation. Besides some occasional and seemingly random segfaults the testsites are running fine. Surely there are a few bugs in my code but I think its time to upgrade anyways, maybe then the seggies will disappear. So to the question... Are there any known issues with Redhat 8.0 which ships with perl 5.8.0, httpd 2.0.40 and mod_perl 1.99? Or should I go for something else? mvh, #--- # Robert Friberg perl,java,xml,uml,sql,delphi, # Systemutvecklare c/c++,vb,php,linux,apache # 0733-839080 # # Ensofus AB linuxservrar,serverhosting, # www.ensofus.se internetsystem, Miljö Online #--- [EMAIL PROTECTED] rofr]$ perl -V Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration: Platform: osname=linux, osvers=2.2.1-ac1, archname=i386-linux uname='linux porky.devel.redhat.com 2.2.1-ac1 #1 smp mon feb 1 17:44:44 est 1999 i686 unknown ' hint=recommended, useposix=true, d_sigaction=define usethreads=undef useperlio=undef d_sfio=undef Compiler: cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include' ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include' stdchar='char', d_stdstdio=undef, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt libc=, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Built under linux Compiled at Apr 6 1999 23:34:07 @INC: /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005
[Summary] [Config] Upgrading, Need stable setup
Hello All, Thanks for all the replies. I spent a few hours yesterday installing RH9 on a new box, upgrading perl to 5.8.1, installing apache 1.3.28 and modperl 1.29 from source. No problems at all, just followed the instructions at http://perl.apache.org/docs/1.0/guide/install.html I still got the segfaults though, but I have resolved that issue now. I had an inner sub with a reference to the Apache::Request object. Ouch. mvh, #--- # Robert Friberg perl,java,xml,uml,sql,delphi, # Systemutvecklare c/c++,vb,php,linux,apache # 0733-839080 # # Ensofus AB linuxservrar,serverhosting, # www.ensofus.se internetsystem, Miljo Online #---
RE: [Summary] [Config] Upgrading, Need stable setup
Stas Bekman wrote: > It's probably a good idea to report those segfaults to the > perl5-porters list. Please excuse my ignorance but I would have thought the offensive code was anywhere *except* in the perl interpreter. I was calling methods on an invalid Apache::Request object. Isn't perl just passing a bad memory reference? mvh, #------- # Robert Friberg perl,java,xml,uml,sql,delphi, # Systemutvecklare c/c++,vb,php,linux,apache # 0733-839080 # # Ensofus AB linuxservrar,serverhosting, # www.ensofus.se internetsystem, Miljo Online #--- > -Original Message- > From: Stas Bekman [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 28, 2003 7:18 PM > To: Robert Friberg > Cc: [EMAIL PROTECTED] > Subject: Re: [Summary] [Config] Upgrading, Need stable setup > > > Robert Friberg wrote: > > Hello All, > > > > Thanks for all the replies. I spent a few hours > > yesterday installing RH9 on a new box, upgrading > > perl to 5.8.1, installing apache 1.3.28 and modperl > > 1.29 from source. No problems at all, just followed > > the instructions at > > > >http://perl.apache.org/docs/1.0/guide/install.html > > > > I still got the segfaults though, but I have resolved > > that issue now. I had an inner sub with a reference > > to the Apache::Request object. Ouch. > > It's probably a good idea to report those segfaults to the > perl5-porters list. > Perl shouldn't segfault when something is wrong, but die with an > error message. > __ > 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: [Summary] [Config] Upgrading, Need stable setup
> Without seeing the backtrace I can't tell whether it's a bug in > Apache::Request or Perl. And either way, the bug report should go to perl5-porters list? mvh, #------- # Robert Friberg perl,java,xml,uml,sql,delphi, # Systemutvecklare c/c++,vb,php,linux,apache # 0733-839080 # # Ensofus AB linuxservrar,serverhosting, # www.ensofus.se internetsystem, Miljo Online #--- > -Original Message- > From: Stas Bekman [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 28, 2003 11:55 PM > To: Robert Friberg > Cc: [EMAIL PROTECTED] > Subject: Re: [Summary] [Config] Upgrading, Need stable setup > > > Robert Friberg wrote: > > Stas Bekman wrote: > > > >>It's probably a good idea to report those segfaults to the > >>perl5-porters list. > > > > > > Please excuse my ignorance but I would have thought the offensive > > code was anywhere *except* in the perl interpreter. I was calling > > methods on an invalid Apache::Request object. Isn't perl just > > passing a bad memory reference? > > Well, pure Perl code should *never* segfault, no matter how badly > the program > is written. If it does it's a bug in Perl. > > This is not the case with programs using XS modules. If you get a > segfault > inside the module's XS code, it's a bug in that code and should > be reported to > the author of that module. > > When you get a segfault you need to get the backtrace as explained at > perl.apache.org and look whether it happens in perl or the XS > module, which > will tell you where to report the bug. > > Without seeing the backtrace I can't tell whether it's a bug in > Apache::Request or 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: [Summary] [Config] Upgrading, Need stable setup
Oops, sorry. The answer was in your message. mvh, #--- # Robert Friberg perl,java,xml,uml,sql,delphi, # Systemutvecklare c/c++,vb,php,linux,apache # 0733-839080 # # Ensofus AB linuxservrar,serverhosting, # www.ensofus.se internetsystem, Miljo Online #---
Can't locate loadable object?
Hi all, I just installed from source perl 5.8.1, mod_perl 1.29, apache 1.3.29 and libapreq 1.39 on RH Linux 9. I did the same thing (almost) a couple of weeks ago and it worked fine, this time I cant get my stuff running. New is libapreq, last time I installed only Apache::Request from CPAN. I get the following when trying to 'use Apache::Util' which is up to date according to the CPAN-module. Any clues? Stopping httpd:[FAILED] Starting httpd: [Thu Nov 6 23:52:01 2003] [error] Can't locate loadable object for module Apache::Util in @INC (@INC contains: /home/energi/perllib /home/webs/perllib /usr/local/lib/perl5/5.8.1/i686-linux /usr/local/lib/perl5/5.8.1 /usr/local/lib/perl5/site_perl/5.8.1/i686-linux /usr/local/lib/perl5/site_perl/5.8.1 /usr/local/lib/perl5/site_perl . /usr/local/apache/ /usr/local/apache/lib/perl) at /usr/local/lib/perl5/site_perl/5.8.1/i686-linux/mod_perl.pm line 14 Compilation failed in require at /home/webs/perllib/Ensofus/Pxp.pm line 4. BEGIN failed--compilation aborted at /home/webs/perllib/Ensofus/Pxp.pm line 4. Compilation failed in require at /usr/local/apache//conf/startup.pl line 12. BEGIN failed--compilation aborted at /usr/local/apache//conf/startup.pl line 12. Compilation failed in require at (eval 2) line 1. Syntax error on line 383 of /usr/local/apache/conf/httpd.conf: Can't locate loadable object for module Apache::Util in @INC (@INC contains: /home/energi/perllib /home/webs/perllib /usr/local/lib/perl5/5.8.1/i686-linux /usr/local/lib/perl5/5.8.1 /usr/local/lib/perl5/site_perl/5.8.1/i686-linux /usr/local/lib/perl5/site_perl/5.8.1 /usr/local/lib/perl5/site_perl . /usr/local/apache/ /usr/local/apache/lib/perl) at /usr/local/lib/perl5/site_perl/5.8.1/i686-linux/mod_perl.pm line 14 Compilation failed in require at /home/webs/perllib/Ensofus/Pxp.pm line 4. BEGIN failed--compilation aborted at /home/webs/perllib/Ensofus/Pxp.pm line 4. Compilation failed in require at /usr/local/apache//conf/startup.pl line 12. BEGIN failed--compilation aborted at /usr/local/apache//conf/startup.pl line 12. Compilation failed in require at (eval 2) line 1. mvh, #------- # Robert Friberg perl,java,xml,uml,sql,delphi, # Systemutvecklare c/c++,vb,php,linux,apache # 0733-839080 # # Ensofus AB linuxservrar,serverhosting, # www.ensofus.se internetsystem, Miljö Online #--- -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
RE: Can't locate loadable object?
> What do you get when you run: > find /usr/local/lib/perl5/ | grep Apache/Util I get /usr/local/lib/perl5/site_perl/5.8.1/i686-linux/Apache/Util.pm > You don't tell us anything about your modperl build. I copied and pasted from INSTALL.simple mvh, #--- # Robert Friberg perl,java,xml,uml,sql,delphi, # Systemutvecklare c/c++,vb,php,linux,apache # 0733-839080 # # Ensofus AB linuxservrar,serverhosting, # www.ensofus.se internetsystem, Miljo Online #--- -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
Question about headers and Apache::Filter
Hello I had been trying to use Apache::OutputChain Apache::SSIChain Apache::Registry to allow me to use SSI in the output of my mod_perl programs. The ssi content always wound up at the top of the output. After reading the mailing list it seemed that Apache::RegistryFilter Apache::SSI was the way to go. Well it works great except that the header type is always text/plain so I get the HTML source instead of the rendered page. My setup is as follows PerlModule Apache::DBI PerlModule Apache::Registry PerlModule Apache::SSI PerlModule Apache::FakeSSI PerlModule Apache::Filter PerlModule Apache::RegistryFilter SetHandler perl-script Options +ExecCGI PerlSetVar Filter On PerlHandler Apache::RegistryFilter Apache::SSI #also tried Apache::FakeSSI It seems that PerlSendHeader On has no effect when you are using Apache::RegistryFilter, how can I get the proper headed type sent? Thanks, Robert -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
RE: Question about headers and Apache::Filter
Thanks for the info Perrin, I was able to make it work by adding an AddType. I am still wondering why every example I see with Apache::RegistryFilter and Apache::SSI makes no mention of having to set the header. Robert -Original Message- From: Perrin Harkins [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 5:53 PM To: Robert Knaak Cc: [EMAIL PROTECTED] Subject: Re: Question about headers and Apache::Filter On Fri, 2003-11-14 at 14:24, Robert Knaak wrote: > It seems that PerlSendHeader On has no effect when you are using > Apache::RegistryFilter, how can I get the proper headed type sent? Are you still having trouble with this? It looks to me like you can fix it by adding $r->content_type("text/html") to your scripts, or you can use an AddType directive in httpd.conf if you don't want to edit your scripts. - Perrin -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html
Problems with DBI & modperl on Irix 6.5
Hello, I'm running modperl 1.29 on Apache 1.3.31 with Perl 5.8.2, running on Irix 6.5.25m. When I try to use the Apache::DBI module, I get the following Can't load '/opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/auto/DBI/DBI.so' for module DBI: 71121247:/var/sgi_apache/server/sbin/httpd: rld: Fatal Error: unresolvable symbol in /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/auto/DBI/DBI.so: PL_curstackinfo at /opt/perl-5.8.2/lib/5.8.2/IP27-irix/DynaLoader.pm line 229.\n at /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/DBI.pm line 252\nBEGIN failed--compilation aborted at /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/DBI.pm line 252. Compilation failed in require at /opt/perl-5.8.2/lib/site_perl/5.8.2/Apache/DBI.pm line 7. BEGIN failed--compilation aborted at /opt/perl-5.8.2/lib/site_perl/5.8.2/Apache/DBI.pm line 7. Anyone have any ideas? We'd love to get mod_perl running. Thanks, -- Robert Aspinall NOAA's National Ocean Service CO-OPS/Information Systems Division 1305 East-West Highway Bldg. SSMC4, Station Id 6314 Silver Spring, MD 20910 [EMAIL PROTECTED]
Re: Problems with DBI & modperl on Irix 6.5
Yes, DBI is installed and up to date, as is Apache::DBI. Robert Aspinall NOAA's National Ocean Service CO-OPS/Information Systems Division 1305 East-West Highway Bldg. SSMC4, Station Id 6314 Silver Spring, MD 20910 [EMAIL PROTECTED] Michael Peters wrote: Robert Aspinall wrote: Hello, I'm running modperl 1.29 on Apache 1.3.31 with Perl 5.8.2, running on Irix 6.5.25m. When I try to use the Apache::DBI module, I get the following Can't load '/opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/auto/DBI/DBI.so' for module DBI: 71121247:/var/sgi_apache/server/sbin/httpd: rld: Fatal Error: unresolvable symbol in /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/auto/DBI/DBI.so: PL_curstackinfo at /opt/perl-5.8.2/lib/5.8.2/IP27-irix/DynaLoader.pm line 229.\n at /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/DBI.pm line 252\nBEGIN failed--compilation aborted at /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/DBI.pm line 252. Compilation failed in require at /opt/perl-5.8.2/lib/site_perl/5.8.2/Apache/DBI.pm line 7. BEGIN failed--compilation aborted at /opt/perl-5.8.2/lib/site_perl/5.8.2/Apache/DBI.pm line 7. Do you have DBI successfully installed? Are you using the latest version of Apache::DBI (0.94)? I know that they are currently working on the next release, but I think all of the issues in that case are with mod_perl2 so they shouldn't affect what you're trying to do.
Re: Problems with DBI & modperl on Irix 6.5
A little update: I see these errors when compiling with 'make': cc -n32 -O3 -OPT:Olimit=0:space=ON -I/opt/perl-5.8.2/lib/5.8.2/IP27-irix/CORE -D_BSD_TYPES -D_BSD_TIME -woff 1184,1552 -DLANGUAGE_C -DMOD_PERL_VERSION=\"1.29\" -DMOD_PERL_STRING_VERSION=\"mod_perl/1.29\" -I/var/sgi_apache/server/include -DMOD_PERL -O -DAP_ENABLE_EXCEPTION_HOOK -DIRIX -n32 -DMOD_SSL=208117 -DUSE_HSREGEX -DEAPI -DEAPI_MM -DUSE_EXPAT -I../lib/expat-lite -n32 -mips3 -O -c mod_perl.c && mv mod_perl.o mod_perl.lo cc WARNING: -O conflicts with -O3; using latter value (-O) cc-1185 cc: WARNING File = mod_perl.c, Line = 988 An enumerated type is mixed with another type. r->proxyreq = 1; ^ Specifically the "warning: -O conflicts with -O3; using latter value (-O) That happens after every cc command. I'd love to try compiling modperl with gcc, but even when I softlink cc to gcc, it still insists on using the -n32 flag, which is invalid with gcc. Any ideas, anyone? Robert Aspinall wrote: Hello, I'm running modperl 1.29 on Apache 1.3.31 with Perl 5.8.2, running on Irix 6.5.25m. When I try to use the Apache::DBI module, I get the following Can't load '/opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/auto/DBI/DBI.so' for module DBI: 71121247:/var/sgi_apache/server/sbin/httpd: rld: Fatal Error: unresolvable symbol in /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/auto/DBI/DBI.so: PL_curstackinfo at /opt/perl-5.8.2/lib/5.8.2/IP27-irix/DynaLoader.pm line 229.\n at /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/DBI.pm line 252\nBEGIN failed--compilation aborted at /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/DBI.pm line 252. Compilation failed in require at /opt/perl-5.8.2/lib/site_perl/5.8.2/Apache/DBI.pm line 7. BEGIN failed--compilation aborted at /opt/perl-5.8.2/lib/site_perl/5.8.2/Apache/DBI.pm line 7.
Re: Problems with DBI & modperl on Irix 6.5
ldd DBI.so just returns: libc.so.1 => /usr/lib32/libc.so.1 Robert Aspinall NOAA's National Ocean Service CO-OPS/Information Systems Division 1305 East-West Highway Bldg. SSMC4, Station Id 6314 Silver Spring, MD 20910 [EMAIL PROTECTED] Stas Bekman wrote: [Robert, please don't forget to Reply-All] Robert Aspinall wrote: I saw that article, however, as far as I can tell I'm using the same perl libraries that I compiled modperl with. Right, what about DBI.so, that's the only that fails. Stas Bekman wrote: Robert Aspinall wrote: I'm running modperl 1.29 on Apache 1.3.31 with Perl 5.8.2, running on Irix 6.5.25m. When I try to use the Apache::DBI module, I get the following Can't load '/opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/auto/DBI/DBI.so' for module DBI: 71121247:/var/sgi_apache/server/sbin/httpd: rld: Fatal Error: unresolvable symbol in /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/auto/DBI/DBI.so: PL_curstackinfo at /opt/perl-5.8.2/lib/5.8.2/IP27-irix/DynaLoader.pm Usually that's the case when you get a wrong perl library loaded. (not the one mod_perl was compiled with). Please take a look at: http://perl.apache.org/docs/1.0/guide/troubleshooting.html#_relocation_errors__or__undefined_symbol_
Re: Problems with DBI & modperl on Irix 6.5
I'm not sure what output you're looking for, but if I run ldd on /var/sgi_apache/httpd-outbox/libexec/libperl.so: libm.so => /usr/lib32/libm.so libc.so.1 =>/usr/lib32/libc.so.1 Which file do you want me to ldd as far as the perl lib goes? Robert Aspinall NOAA's National Ocean Service CO-OPS/Information Systems Division 1305 East-West Highway Bldg. SSMC4, Station Id 6314 Silver Spring, MD 20910 [EMAIL PROTECTED] Stas Bekman wrote: Robert Aspinall wrote: ldd DBI.so just returns: libc.so.1 => /usr/lib32/libc.so.1 Hmm, that's bizzare. Was DBI linked statically with perl or something like that? I'm not familiar with Irix, so I'm just guessing. But in this case there should be no DBI.so. How about nuking /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/auto/DBI/DBI.so and DBI.pm, and installing it from scratch? Also please show us, the ldd output of the mod_perl and perl libs (assuming that they are shared libs) Can't load '/opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/auto/DBI/DBI.so' for module DBI: 71121247:/var/sgi_apache/server/sbin/httpd: rld: Fatal Error: unresolvable symbol in /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/auto/DBI/DBI.so: PL_curstackinfo at /opt/perl-5.8.2/lib/5.8.2/IP27-irix/DynaLoader.pm
Re: Problems with DBI & modperl on Irix 6.5
Something I noticed when reinstalling DBI.. it's finding perl 5.008 somewhere on the system, despite invoking cpan with the 5.8 binary. I get this message: Creating DBI::PurePerl test variant: t/zvpp_60preparse.t Creating DBI::PurePerl test variant: t/zvpp_80proxy.t Checking if your kit is complete... Looks good I see you're using perl 5.008002 on IP27-irix, okay. Robert Aspinall NOAA's National Ocean Service CO-OPS/Information Systems Division 1305 East-West Highway Bldg. SSMC4, Station Id 6314 Silver Spring, MD 20910 [EMAIL PROTECTED] Stas Bekman wrote: Robert Aspinall wrote: ldd DBI.so just returns: libc.so.1 => /usr/lib32/libc.so.1 Hmm, that's bizzare. Was DBI linked statically with perl or something like that? I'm not familiar with Irix, so I'm just guessing. But in this case there should be no DBI.so. How about nuking /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/auto/DBI/DBI.so and DBI.pm, and installing it from scratch? Also please show us, the ldd output of the mod_perl and perl libs (assuming that they are shared libs) Can't load '/opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/auto/DBI/DBI.so' for module DBI: 71121247:/var/sgi_apache/server/sbin/httpd: rld: Fatal Error: unresolvable symbol in /opt/perl-5.8.2/lib/site_perl/5.8.2/IP27-irix/auto/DBI/DBI.so: PL_curstackinfo at /opt/perl-5.8.2/lib/5.8.2/IP27-irix/DynaLoader.pm
Re: Problems with DBI & modperl on Irix 6.5
There is more than one perl installed (an unfortunate side effect of IRIX). Any idea how to get cpan to only build using 5.8? Stas Bekman wrote: > Something I noticed when reinstalling DBI.. it's finding perl 5.008 > somewhere on the system, despite invoking cpan with the 5.8 binary. I > get this message: > > Creating DBI::PurePerl test variant: t/zvpp_60preparse.t > Creating DBI::PurePerl test variant: t/zvpp_80proxy.t > Checking if your kit is complete... > Looks good > I see you're using perl 5.008002 on IP27-irix, okay. That could be it. So take a look at the URL I've quoted in first place again and see if you have more than one perl installed.
Re: Problems with DBI & modperl on Irix 6.5
No, when I invoked CPAN I did it as /usr/local/bin/perl -MCPAN -e shell (the location of the perl 5.8 binary) Robert Aspinall NOAA's National Ocean Service CO-OPS/Information Systems Division 1305 East-West Highway Bldg. SSMC4, Station Id 6314 Silver Spring, MD 20910 [EMAIL PROTECTED] Philip M. Gollucci wrote: Robert Aspinall wrote: There is more than one perl installed (an unfortunate side effect of IRIX). Any idea how to get cpan to only build using 5.8? I think it might be as simple as: /full/path/to/perl -MCPAN -e shell cpan> install DBI rather then perl -MCPAN -e shell cpan> install DBI END - What doesn't kill us can only make us stronger. Nothing is impossible. Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198 Consultant / http://p6m7g8.net/Resume/resume.shtml Senior Developer / Liquidity Services, Inc. http://www.liquidityservicesinc.com http://www.liquidation.com http://www.uksurplus.com http://www.govliquidation.com http://www.gowholesale.com
Re: Problems with DBI & modperl on Irix 6.5
You're probably right, I hadn't noticed the signifigant digits were the same. Thanks for the heads up. Now if I could just figure out why modperl refuses to work with DBI.. Robert Aspinall NOAA's National Ocean Service CO-OPS/Information Systems Division 1305 East-West Highway Bldg. SSMC4, Station Id 6314 Silver Spring, MD 20910 [EMAIL PROTECTED] Perrin Harkins wrote: On Wed, 2005-07-06 at 14:40 -0400, Robert Aspinall wrote: Something I noticed when reinstalling DBI.. it's finding perl 5.008 somewhere on the system, despite invoking cpan with the 5.8 binary. Isn't that just how perl version numbers work? I thought 5.8 and 5.008 actually meant the same thing. The next release after 5.005 was 5.6, bumping the significant digit up a couple of decimal places. - Perrin
Re: I need to unsub
I think he was asking what address he subscribed under. It's [EMAIL PROTECTED] Robert Aspinall NOAA's National Ocean Service CO-OPS/Information Systems Division 1305 East-West Highway Bldg. SSMC4, Station Id 6314 Silver Spring, MD 20910 [EMAIL PROTECTED] Stas Bekman wrote: Luinrandir Insight wrote: I have forgotten where I subscribed to this list. could someone please reply with the address so I can unsub? Lou, it's in the headers of the very message you've posted: list-help: <mailto:[EMAIL PROTECTED]> list-unsubscribe: <mailto:[EMAIL PROTECTED]> List-Post: <mailto:modperl@perl.apache.org> List-Id:
how to use mod_perl sections with mod_jk?
So I'm trying to make a great deal of my httpd.conf dynamic based primarily on hostname etc. I have most of it working but I've found that at least in my case I cannot use mod_jk directives in a perl section. Q. Should I be able to use mod_jk directives in a perl section? push @JkWorkerProperty, [qw(worker.myWorker.port $workerPort)]; also I often want to do Apache->module() but how would I do say an Include where the value was set in a perl stanza but the Include will be outside the perl stanza. Failing that can I "Include" static httpd.conf snippests in a perl section with say Apache->include()? Point is the path varies so I want to include where my variable has scope.
Re: urgent help needed
Google for mod_perl book and read it. I'm sure it has the correct steps to get perl and @INC setup correctly.http://modperlbook.org/html/ch03_09.htmlAfter you've loaded the perl module itself you want to change @INC to include where Apache2is. If you want I think you can put that logic in an stanzaOn Jul 31, 2006, at 11:54 PM, philge philip wrote:Dear colleague I am a bioinformatics programmer from India.I need a guidance for configuring mod_perl2.0 in my server. I have Apache.2.0.5.2 and Perl 5.8.5 installed in Fedora 3 operating system. I downloaded mod_perl2.0 version and installed it with the following commands: Perl MakeFfile.PL MP_AP_PREFIX=/apxs path Make Make install Next I added the lines: LoadModule perl_module modules/mod_perl.so PerlModule Apache2 to httpd.conf when I tried restarting the server we got an error like cant locate perl module Apache2.pm module in @INC Though I corrected this error once and when I tried to load Apache2::Request module in the script I got an error like cant locate perl module Apache2::Request.pm in @INC. I tried installing the libapreq2-2.07 module to include Apache2::Request module but I am unable to load it. Please guide me how to load the Apache2.pm module and load Apache2::request module.I have a doubt whether I have to upgrade our Perl version since we got an error while trying with modperl2 rpm version and whether Fedora3 will support higher versions of perl?Kindly guide me please.Its urgent.Yours Sincerely Philge Philip Do you Yahoo!? Get on board. You're invited to try the new Yahoo! Mail Beta.
Re: how to use mod_perl sections with mod_jk?
I found a small discussion on $PerlConfig but where is the documentation for this? For instance I don't know how it interacts with other Perl section syntax within the same Perl section. But are there limitations with using regular Perl section syntax with other modules directives or should that be possible? On Aug 1, 2006, at 12:58 AM, Andreas J. Koenig wrote: On Mon, 31 Jul 2006 23:00:33 -0500, Robert Nicholson <[EMAIL PROTECTED]> said: So I'm trying to make a great deal of my httpd.conf dynamic based primarily on hostname etc. I have most of it working but I've found that at least in my case I cannot use mod_jk directives in a perl section. Q. Should I be able to use mod_jk directives in a perl section? push @JkWorkerProperty, [qw(worker.myWorker.port $workerPort)]; also I often want to do module() but how would I do say an Include where the value was set in a perl stanza but the Include will be outside the perl stanza. Failing that can I "Include" static httpd.conf snippests in a perl section with say Apache-> include()? Point is the path varies so I want to include where my variable has scope. All this works if you use $PerlConfig instead of symbol table manipulations. $PerlConfig is like an include statement for a string. Works fine with apache1 but needs recent SVN for apache2. -- andreas
Re: how to use mod_perl sections with mod_jk?
So can you or somebody else post a complete httpd.conf that makes use of $PerlConfig then? On Aug 1, 2006, at 2:24 PM, Andreas J. Koenig wrote: On Tue, 1 Aug 2006 13:56:31 -0500, [EMAIL PROTECTED] said: That resulted in errors at least in my case. You did read that I said you need SVN recent for apache2? -- andreas
Re: reposting form values
Torsten Foertsch wrote: On Tuesday 28 November 2006 21:31, Patrick Galbraith wrote: Quick question - how does one do a repost (using POST, not GET) form values? This would be in a redirect TransHandler. Your only chance is to proxy the request to the other server. You cannot use a Location header to trigger a POST. You could also pump out HTML and call form.submit() with Javascript. Other than that, Torsten is correct. Use LWP to proxy the post data back to the client. Rob
Re: DBI AutoCommit goes away when db connection is killed
Lev Lvovsky wrote: In testing out persistent connections while using transactions, we've noticed that while in a loop which continuously begins and ends a transaction, killing the persistent connection which Apache::DBI is maintaining causes the still-running handler to report things like: error: DBD driver has not implemented the AutoCommit attribute at /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/DBI.pm line 1668. 1 -> STORE for DBD::mysql::db (DBI::db=HASH(0x9bf49cc)~INNER 'AutoCommit' 0) thr#915dc30 --> do_error Turning off AutoCommit failed error 21 recorded: Turning off AutoCommit failed <-- do_error STORE DBI::db=HASH(0x9bf49cc) 'AutoCommit' => 0 !! ERROR: 21 CLEARED by call to begin_work method -> begin_work for DBD::mysql::db (DBI::db=HASH(0x9b8678c)~0x9bf49cc) thr#915dc30 So, your code is calling begin_work, fetching a value, storing a value, and committing? The store will fail if the database connection goes away, and it'll do so when it attempts communicate with the server to set AutoCommit to 0. You might want to call $dbh->ping before calling your store routine. Either way, the way to make this fault tolerant is with eval. Once you've determined that there's been a fault, and that the fault means that the database is down, try to reconnect. Continue to try to reconnect until the database comes back online. Then retry the original failed transaction. Once you reconnect, the connection is persistent again. At least, that's been my experience with postgresql. Rob
Re: DBI AutoCommit goes away when db connection is killed
Lev Lvovsky wrote: Once you reconnect, the connection is persistent again. At least, that's been my experience with postgresql. This is exactly what I've been thinking to do, but I've not seen anything within Apache::DBI that allows me to reconnect per se. How do I perform that action? Also, forgive this question if it seems a little obtuse, but in the startup.pl file, I do something like this: Apache::DBI->connect_on_init(...) My experience with Apache::DBI has been that it needs no special setup. All I've ever done is: my $dbh; $cnt = 0; while(!$dbh) { eval { $dbh = DBI->connect(); }; if($@) { warn("DB Down: $@"); sleep 5; $cnt++; } last if $cnt > 3; } unless($dbh) { # show user an error page } Rob
Re: Instability at startup for Apache2/mod_perl2 using worker MPM
Perrin Harkins wrote: David Scott wrote: I've built Apache 2.2.3 and mod_perl 2.0.3 with libapreq 2.08 and the worker MPM. There appears to be some kind of race condition at startup that prevents the server from coming up. This only happens once in a while, and can be fixed by some minor configuration or code change (ie, adding a 'print STDERR "foobar\n"' to one of my Perl modules can cause the problem to occur; moving the print statement by one line can fix it). This sounds like a possible issue with your code and threaded perl. It doesn't ring a bell as a general mod_perl issue. Interesting problem. I remember reading about an issue with threading (not specific to apache or mod_perl) that occured when file descriptors were being modified while there were contents in the buffer. Just for giggles, try { local $|=1; use MyModules; ... } Rob
Re: reset multiple cookies
Marc Lambrichs wrote: Date: Sun, 10 Dec 2006 12:50:09 GMT Server: Apache Set-Cookie: auth_tkt=; path=/; domain=main.domain.com; expires=Sun, 10-Dec-2006 11:50:09 GMT Set-Cookie: auth_tkt=; path=/; domain=first.domain.com; expires=Sun, 10-Dec-2006 11:50:09 GMT Set-Cookie: auth_tkt=; path=/; domain=second.domain.com; expires=Sun, 10-Dec-2006 11:50:09 GMT I'm no expert, but it looks like you might be setting expired cookies, in which case the browser will ignore them. Was this your intent? Rob
Re: Forking to an interactive program under mod_perl
Alex Beamish wrote: What I'm trying to do is come up with scaled page images from a PDF on the fly. Thus, I want to launch Ghostscript and then ask for a couple of page images. So, launching Ghostscript and getting the first page might happen on the first request; subsequent requests would come back to the Ghostscript session left running from the first request, and thus would be able to quickly produce the required page image. Suggestions welcome. What you're gonna need is a daemon that lives outside of mod_perl. It's job will be to answer ghost script requests made from within your mod_perl handler, track open files, purge unused files, and generally do all the things you want to do. I don't really see a clean way to do it otherwise. I've never used it, but doing a CPAN search revealed GSAPI, a perl GhostScript interface. That might be a good place to go. Good luck, Rob
Re: Forking to an interactive program under mod_perl
Alex Beamish wrote: I'll deal with multiple documents with some combination of stale timers and LRU slots, but that's not really what I see as the most complicated or difficult part of this problem. For this particular application, my inactivity timer will probably by 10-15 minutes, and I'll expect to have 6-8 documents open at any given time, so it shouldn't be a big drain on memory. And I will probably be able to set something up that signals that a document has been expired as well .. (this is just me thinking out loud) .. Thanks for your feedback .. I think named pipes is my next focus. Sockets will be the way to go on this, rather than pipes. I don't want to say pipes are a dead technology, but by using sockets, you can move your gs application off your web servers (if load ever gets that high) without having to rewrite any code, something that isn't possible with a pipe (not without netcat, anyway). There's probably a good reason for it, but why not just pre-generate all of your page images? Even when new documents are added, a cron could be setup to come along (once a minute even) and convert those PDFs to images. Are these PDFs dynamically generated? Rob
Re: The case of the disappearing plus sign
Chris Schults wrote: It appears that the "+" is getting stripped out at some point as the script is returning results for "water pollution" instead of "water+pollution". Is it possible that Apache is the culprit or should we be looking more closely at our script or rewrite rule? The test would be to hit /cgi-bin/script.pl? with the water+pollution keyword. The problem is most CGI variable processors are going to replace + with a space. I doubt this is an issue with rewrite. You might need to pass the URL encoded string instead of water+pollution... That would be water%2Bpollution. Rob
Re: localhost vs vhost problem
Well.. For one thing, vhost1.turnbui.net isn't a ServerName entry or a ServerAlias entry. I'd start by adding that. Rob turnbui wrote: ServerName ianst.homeip.net DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/iansthtdocs" # ErrorLog logs/ianst-host-error.log # CustomLog logs/ianst-host-access.log common ServerAlias ianst ScriptAlias /cgi-bin/ "C:/Program Files/Apache Software Foundation/Apache2.2/iansthtdocs/cgi-bin/" # Alias /perl/"C:/Program Files/Apache Software Foundation/Apache2.2/iansthtdocs/perl/" # # Alias /asp/"C:/Program Files/Apache Software Foundation/Apache2.2/iansthtdocs/asp/" # PerlModule Apache::ASP SetHandler perl-script # this line stops it finding my /cgi-bin/iansCaptcha.asp file ?? ie prevents SSI's from perl/... PerlHandler Apache::ASP # next 2 go together in place of above - requires Apache/Registry.pm @INC #PerlHandler Apache::Registry #PerlSendHeader On # PerlSetVar Global . PerlSetVar Global c:/tmp PerlSetVar StateDir c:/tmp/asp PerlSetVar CookiePath / #
Re: localhost vs vhost problem
turnbui wrote: Sorry Rob, just my vain attempt to protect the innocent. In fact it is ianst.homeip.net that I am using. Sorry to mislead. Okay. So just to rehash here... ASP does not work at: http://ianst.homeip.net/asp ASP works correctly at: http://localhost/asp localhost isn't a server listed in your VirtualHost section in either ServerName or ServerAlias. That means that the VirtualHost section isn't even a consideration when hitting localhost. Figure out what combination of configuration elements are being used when localhost is accessed and I think you will have found the combination to include in your VirtualHost section. Rob
Re: localhost vs vhost problem
Perrin Harkins wrote: Robert Landrum wrote: localhost isn't a server listed in your VirtualHost section in either ServerName or ServerAlias. That means that the VirtualHost section isn't even a consideration when hitting localhost. Doesn't that mean it just takes the first VirtualHost that appears in the file? Actually, it's been literally 5 years since I've done any named virtualhost stuff, so it could've changed in that time... But as I recall, it will use the global configuration as defined by httpd.conf, not any one specific VirtualHost block. Again, this is based on the default setup (of 5 years hence), which I believe had: Listen *:80 Rob
Re: Bug Report
Snook, Adrian (London) wrote: 3. This is the core dump trace: (if you get a core dump): Core was generated by `/home -k start'. Program terminated with signal 11, Segmentation fault. #0 0x002f201e in free () from /lib/tls/libc.so.6 (gdb) bt full #0 0x002f201e in free () from /lib/tls/libc.so.6 No symbol table info available. #1 0x0121d0a5 in nnfldlc () from /finman- ds1/ora01/app/oracle/product/9.2.0/lib/libclntsh.so.9.0 No symbol table info available. #2 0x0121cad7 in nnflrlc () from /finman- ds1/ora01/app/oracle/product/9.2.0/lib/libclntsh.so.9.0 No symbol table info available. Hmm... Interesting. Everything looks good right up until this point, which I believe is attempting to resolve names. Oracle naming conventions suck. Just a shot in the dark... Try changing tnsnames.ora to connect to the IP address rather than the hostname, if that's what you're using. You should also be able to test this without apache. Just run a script with something like $|=1; while(1) { $dbh = DBI->connect(); $dbh->disconnect; print "Connected\n"; } Rob
Re: Lost ENV variable value .........
Tracy12 wrote: Thanks, If this is the case, How can we preserve the REMOTE_USER value and forward/redirect to the other application ( running on same Apache Server) which is based on the REMOTE_USER environment variable, which is set in my perl module in the first application. I was under the impression $ENV{'REMOTE_USER') variable can be used for such purposes. I think you've got this idea or notion that this is the right way to do whatever it is you're trying to do and are asking questions that don't really make sense to us. Maybe we could help more if we knew what it was you were really trying to do. But if thats not an option... If I wanted to get remote user from one request to the next, I would pass it as a URL parameter. Something like /cgi/rUser.pl?remote_user=foobar&other=options Your other option is to set a cookie containing this user id, or if security is an issue, use a session, with a unique id for the cookie. Rob
Re: Lost ENV variable value .........
Perrin Harkins wrote: After successful authentication we need to pass the control to another application(which is running on the same apache server) which depend on the REMOTE_USER value which we set. That will work fine, as long as your auth handler runs in the same request as the thing that wants to look at REMOTE_USER. If you do an external redirect, that creates a totally separate request from the client. You need to set your handler as the auth handler for the location that you want to protect, not go the auth handler and then redirect to the location. I think what Perrin is saying is that you don't want your authentication handler to perform the location redirect. In fact, you don't want a location redirect at all. You want to return OK if the user is authenticated (i.e. the username and passsword are verified by the CAS service) and AUTH_REQUIRED otherwise. At least that's how it was in MP1 and it's probably pretty much the same in MP2. Rob
Re: Lost ENV variable value .........
Tracy12 wrote: 1) As we dont use the apache basic authentication but our CAS authentication. If the authentication is not successful how can we redirect to the CAS login page. Ah-ha... So CAS authentication is done via a webform of some type, which means that it uses cookies. Am I correct in this? I'm not positive about this, but I think you probably want a PerlAuthzHandler instead. In this handler you would confirm that the user is logged into the CAS system, set the REMOTE_USER environment variable, and return OK. If the user wasn't logged in, then you'd redirect to the CAS login page. 2) As we dont use the basic authentication in apache in the above httpd.conf entry what the values should we give for AuthType , AuthName in the above Location declaration. I think, with PerlAuthzHandler you only need to specify a "Requires valid-user" to make it work. Rob
Re: Port/Sheme information
Tracy12 wrote: How can we retrieve the URL Scheme (http/https ?) from a perl module, Port given that only input parameter is $r should we use my $uri = Apache::URI->parse($r) and $uri->scheme; I use $r->get_server_port. If it's 80 it's http, if it's 443, it's https. Of course, this breaks if you run them on different ports. Rob
Re: Redirects?
Will Fould wrote: I have a strange issue with a particular script that sometimes (often) generates a 302 to another script without a clear reason why. Oddly enough, I simply placed a few "warn('blah')" code snippets to crudely determine from the error log where it was happening in production (because I cannot replicate the issue in development (linux client/local server)) but with the Warn() statements, if seems to no longer happen !! -- any suggestions/clues where I might look? This is the only script that does this under the same location/configuration. Could this be an issue with buffering? The warns might be triggering a buffer flush. $|=1 might solve the issue once the warns are removed. Rob
Re: file descriptor for client socket?
Daniel Risacher wrote: Is it possible to get the file descriptor for the client socket from the RequestRec? I.e. something like $r->FILENO (which doesn't seem to work) or perhaps $r->connection->client_socket->os_sock (os_sock exists in the APR structure in C, but there doesn't seem to be a perl accessor method.) Reason I want to do this... I'm trying write a perl module to pass the connection to another process using File::FDpasser. $fd = fileno(STDOUT); won't work? Is this really what you want to do? I think apache will still terminate the connection (I'm not sure there's away to avoid that). Rob
Re: Session Handling/Set Session attributes
Tracy12 wrote: My perl authentication handler works fine BUT the biggest problem inside my Auth handler I do some resource intenstive tasks and if everything successful set the REMOTE_USER env variable. But for the subsequent requests from the same user (after the initial Authentication is successful) how can I bypass these resource intensive tasks because the user already been authenticated (but I need REMOTE_USER value for subsequent request I would use Apache::Session and store a cookie that says that this user is authenticated. The session would include to be set for REMOTE_USER. The user would only get the session cookie if they had successfully authenticated. It should work fine and will likely solve your performance problem. Rob
Re: Catching errors
Jonathan Mangin wrote: sub handler { my $r = shift; my $req = Apache2::Request->new($r); my $foo; # eval {$foo = $req->param('foo')}; $foo = $req->param('foo'); You might want to make sure $r is really $r. If you configure apache such that you use PerlHandler Foo->handler, I believe the first argument is 'Foo', followed by $r. Rob
Re: mod_perl best practices cleanup
Tracy12 wrote: I tried to declare use vars qw( $SESSION_CLEANUP_COUNTER); and increment within the code doent seem to work, Shoud i increment this in a specific hanlder. You really need to heed the advice of the list and consider using the a cron job to expire old sessions. It's really not that hard to do. #!/usr/bin/perl use strict; my $path = shift; # path to session directory my $exp = shift; # time sessions are valid (in seconds) my $now = time; opendir(DIR,$path) or die "could not open dir: $path: $!"; while(my $file = readdir(DIR)) { my $fp = "$path/$file"; my $mtime = (stat($fp))[9]; if($now > ($mtime + $exp)) { unlink($fp); # remove the file if expired } } closedir(DIR); __END__ I didn't test this, so it probably doesn't work as written. But it should be close enough to give you the idea. All it does is delete files when they have been sitting around for more than a certain number of seconds. Add that to cron as something like * * * * * /path/to/session_remover.pl /path/to/session/dir 3600 That'll check for newly expired sessions every minute and delete any that are older than 3600 seconds (1 hour). Good luck, Rob
Re: Troubleshooting Apache2 Segfaults
Joel Gwynn wrote: Here's my backtrace, any ideas? #0 0xb7a58743 in modperl_dir_config (my_perl=0x81b6eb0, r=0x823ce98, s=0x203a6e6f, key=0x8800c38 "CONFIG_FILE", sv_val=0x0) at modperl_util.c:516 #1 0xb78dae84 in XS_Apache2__RequestRec_dir_config (my_perl=0x81b6eb0, cv=0x82cd074) at RequestUtil.xs:301 I believe the reason it's dumping core is because modperl_dir_config is trying to copy the value requested to the sv_val, which is null. Looks like a bad dir_config call. Are you doing anything funky, like passing in undef, or maybe calling it without an assignment (although that shouldn't cause this error)? Rob
Re: Troubleshooting Apache2 Segfaults
Joel Gwynn wrote: Interesting. I just might be doing that: $config_file = $self->param('r')->dir_config('CONFIG_FILE'); In my section, I have this: PerlSetVar CONFIG_FILE /projects/funnyr_dev/private/config.ini And of course I'm not using flock on that file. Hmmm. Try changing that up... my $r = $self->param('r'); if(defined $r) { $config_file = $r->dir_config('CONFIG_FILE'); } else { # handle no $r } Give that a shot and see if it solves the problem. Rob
Re: Troubleshooting Apache2 Segfaults
Perrin Harkins wrote: My guess is that $self has a lifespan longer than one request, so you are trying to use a $r object from a previous request. Would $r still be defined in that instance? Rob
Re: undefined routines & mod_dbd
Garnier, Jeremie wrote: use Apache2::Module (); # test if an Apache module is loaded if (Apache2::Module::loaded('mod_dbd.c')) { … } But it dones: Undefined subroutine &Apache2::Module::loaded call at… I suspect that this may be because you're not actually running in mod_perl. Aside from that, I don't see any methods actually defined in Apache2::Module::loaded... not even a bootstrap. So it might need to be loaded from something like Apache2. Rob
Re: Where does "MoveNext" belong to?
Patrix Diradja wrote: while(!$rsnya->{EOF}){ my $tab4l = $rsnya->fetchrow_array; print "\$tab4l: $tab4l \n"; $rsnya->movenext; } Not a mod_perl question, per se, but try while(my $tab4l = $rsnya->fetchrow_array) { print "\$tab4l: $tab4l\n"; } Rob
Re: Perl Authentication Handler and Cookie Issue
Sumit Shah wrote: Hello, I have a Mod Perl authentication handler and it needs to retrieve the session id from a cookie. It is unable to retrieve any cookies and I get the following error. It does not even print any of the cookies. I would appreciate any help with this. my $token = $cookies{'SessionID'}->value; chomp($token); $log->error("3. Session ID ==> $token"); You're trying to call a method against a value that may or may not exist. That's a big no-no. if(defined $cookies{'SessionID'}) { $token = $cookies{'SessionID'}->value; } else { $log->error("No SessionID cookie"); } Rob
Re: Server Side Image Maps & libapreq / cgi
Jonathan Vanasco wrote: How can I reliably catch this under libapreq / cgi ? ( the former for current use, the latter just-for-kicks ) As far as libapreq is concerned, I can't find any way -- it seems to be an odd special-case html spec. The short answer is: don't use server side image maps. And yes, the long answer is to parse the URI yourself. I ran into the same issue a few (7?) years ago. Rob
Re: Sry, 1 more question.. Apache2::Reload goofiness
[EMAIL PROTECTED] wrote: This is getting very frustrating, so I guess I should ask about this before I scrap the whole project and go back to CGI. I'm using Apache::Reload during development since I'm constantly making changes to code. However, it does not appear to be working right. Is this a bug that I have to live with or is there something I can do? Apache::Reload is based on timestamps, IIRC. So if you're uploading a file from your machine to another machine, make sure both machines have the same time (down to a few seconds) or else Apache::Reload won't see the changes. Starting and Stopping apache the only absolute way to ensure that changes to modules are loaded that I've found. Perrin will probably disagree. :) Rob
Re: Server Side Image Maps & libapreq / cgi
Jonathan Vanasco wrote: On Feb 20, 2007, at 3:56 PM, Robert Landrum wrote: The short answer is: don't use server side image maps. That's not an option. I need to catch the xy on a gif. And yes, the long answer is to parse the URI yourself. arhh. ok. already doing that , but ok. You can make it a form and us it as a submit. Then it sends the x and y coords as name.x=10&name.y=20. I think. Rob
Re: Perl Authentication Handler and Cookie Issue
Sumit Shah wrote: I printed out the contents of the Cookie attribute in the request header and I can see the cookie present in the header. I read all the contents into a hash and then try to check for its existence. The if(exists($hashMap{'SSOTokenID'})) condition fails. Does it have anything to do with data types? How can I check for its existence? Here is the code snippet: my $cookie = $r->headers_in->{'Cookie'}; my @cookieArray = split(";",$cookie); There's your problem... my @coolieArray = split(/\;\s/,$cookie); All of your hash keys will have a space prepended. Rob
Re: Sample Web Application that uses mod_perl
aqua wrote: Dear Group, Some of you might have tried the mod_perl for the first time and tested with simple web application and it should be there some-where in your system. Could you please post a few. The problem is that it isn't exactly a simple thing. It sounds like you're looking for something as simple as a CGI, but mod_perl is much more than that. One of the things that mod_perl does is "handle" some portion of the request you send to Apache. There are lots of options... In order to do that, you have to configure Apache to pass control to mod_perl. This can be achieved in several ways... Once Apache has handed the request to mod_perl, mod_perl decides what modules to load, what to call, and so on. So you can see, it's not simple. But it is powerful, and worth understanding. If I were in your position, I might try asking questions about the problem I was trying to solve, rather than asking for solutions first. Rob
Re: Error intercept.
Benoit Plessis wrote: $r -> headers_out->set('Content-Length', length $error_page); Hmm... Incident sur l'hebergement
Re: PerlAuthenHandler called twice?
Hadmut Danisch wrote: For some reason the module is called twice for every request. Is this a HEAD/GET problem? Maybe you're seeing the browser doing a HEAD request, then a full GET request? Rob
Re: Using or working around File::MMagic under mod_perl
Mark Stosberg wrote: Hello, Recently I ran into a bug with File::MMagic where it returns inconsistent results under mod_perl. Could it simply be a matter of fixing the use of the DATA handle, as Stats suggest here? http://mail-archives.apache.org/mod_mbox/perl-modperl/200403.mbox/[EMAIL PROTECTED] Yep. It's definitly the problem. The work around is to pass a magic definition file into MMagic when the object is created. Easier said than done. Maybe the best solution is move the DATA section to a variable. It's not as elegant as reading the data from a DATA section, but it's mod_perl compliant. Hmm... You might try adding this to your startup.pl (or whatever is per-loading perl modules). # a bit of a hack use vars qw($magicObject); BEGIN { if($ENV{MOD_PERL}) { # load from $magicObject = File::MMagic->new(); # save it globally { no strict; # save original method *{"File::MMagic::original_new"} = *{"File::MMagic::new"}{CODE}; # replace original method *{"File::MMagic::new"} = sub { return $magicObject; }; } # end no strict } } It's untested. And it probably leaks memory, too. :( Rob
Re: Zend PHP
Martin Moss wrote: I just had a demo of the Zend Platform and framework for php. It's got some really nice stuff, but ultimately the reason we may decide to ditch perl and move to php (h I know booo) will be down to support. OR lackthereof for Perl... I've been writing perl for 10 years now (I know, a newbie :), but in those ten years, there's never been anything for which I've needed to ask "support" for. I've never once encountered a honest *perl* bug. Any questions, about anything, have been answered by the perl book, or perl cookbook. As far as coding is concerned, CPAN has proved to be the most valuable resource. In writing in other languages, I often find myself having to search hi-and-low for source, libraries, or documentation on how to do common, trivial things... Things which are easily found in CPAN. PHP is okay, and has almost the same level of community support as perl (although it kinda feels a bit less organized). The perl/mod_perl community has always been there with helpful advice when I needed assistance. I don't see it going away. I'm sure the Zend cool-aid is tasty, but I'll stick with perl for now... :) Rob
Re: Zend PHP
Martin Moss wrote: Many thanks to you all for your posts, Much food for thought... ultimately the decision is out of my hands, which is why I'm looking for useful perl based alternatives to propose to the powers that be. My favorite perl based alternative is HTML::Mason. Simple, fast, and good, and an ASP/PHP user would feel right at home (for the most part). Rob
Re: UTF8 fun with SOAP::Lite and mod_perl 1.3.33
Drew Wilson wrote: But I cannot figure out WHERE this conversion is being done. I've picked through SOAP::Lite enough to know that unicode conversions are probably more than it knows how to handle. However, SOAP::Data::encode_data uses a regex to munge data. Perhaps there's a conversion happening in the regex engine that breaks the UTF8. Rob
Re: MP1 Security issue
Chris Shiflett wrote: That's a weak defense. If you're a proponent of full disclosure, say so, but don't use ignorance as your defense in the same email where you claim to not be a "dumb guy." I am a dumb guy, and I would have done the exact same thing Randal did. I just don't think about security in terms of secrecy. It's not a full disclosure thing at all, at least for me. Despite the (perceived) violation of protocol, Randal's message did light a fire under the asses of a lot of mod_perl developers, and made known a potential security issue. I'd say that's mission accomplished. Rob
Re: "Insecure dependency in eval while running setgid" error
Fred Moyer wrote: Or maybe this is a bug in getegid where it's not clearing a previous memory state. What platform is this on? sun4-solaris His first post had a list of modules in a stack trace, which is where I grabbed that. I googled, but didn't find anything relevant. :( See if fgrep -r 'perl' * | grep '-T' in you modules directory returns anything. Also make sure PerlTaintCheck On isn't in your config. Also, a lot of times I'll put -T in the shebang line of my handler.pl or startup.pl, which will enable Taint checking. Rob
Re: "Insecure dependency in eval while running setgid" error
[EMAIL PROTECTED] wrote: Unfortunately turning taint mode off isn't an option for me. My application is client facing and so we want to continue to make use of the security mechanism that taint mode gives us. Keep taint mode on in dev, so you can identify your issues in development, then turn in off in prod. Rob
Re: "Insecure dependency in eval while running setgid" error
Perrin Harkins wrote: On 3/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Keep taint mode on in dev, so you can identify your issues in > development, then turn in off in prod. Is that actually the generally recommended approach? It's hard to know for sure that you've tried every code path in dev, even if you do use coverage analysis. Here's the bit that's causing the issue... # DON'T LOOK NOW! - blindly untainting can make you go blind! $block =~ /(.*)/s; $block = $1; $block = eval $block; That's a little bit nasty, but perfectly valid. $block is coming from a document containing some sort of code, I think. I didn't dig too deep. You could add: warn "BLOCK: $block\n"; just above the eval, which will log all the "blocks" that are being eval to figure out which one is giving you the trouble. Rob
Re: "Insecure dependency in eval while running setgid" error
[EMAIL PROTECTED] wrote: I'm hoping tho that if I can create a small test case under mod_perl then that opens up myself/someone-on-the-list trying it with other combinations of perl & mod_perl. If you log the pid in the access file, you should be able to determine the serious of page hits that eventually led to the failure, maybe. Also, do you have any limits on the number of requests a child process can serve? If so, does the error appear only after apache has spawned a new child? Rob
Re: SOPE::Lite / prcessing complex data types at server side
Tobias Regneri wrote: package MyService; sub AddGroupAttributes { ($self, $provider, $group, $attrlist) = @_; ($name, $hashref) = split('=', $attrlist); $params = $$hashref; ... } the variables $provider and $group are set correctly but the hash for the list items is empty. Do I have to override the deserializer (if yes, is there any documentation available) or am I handling the parameters in the wrong way? SOAP lite does some weird things. 0.55 especially. If you aren't using 0.67 (or later), then you might want to upgrade. I would use Data::Dumper; warn(Dumper([EMAIL PROTECTED])); and see what's in the logs. It should be: provider group attrlist[item 0] attrlist[item 1] ... Rob
Re: SOAP::Lite / processing complex data types at server side
Tobias Regneri wrote: Given the following xml structure of the data to process Name1 Val1 Name2 Val2 SOAP::Lite will build the internal representation $VAR1 = [ bless( { 'ListItem' => [ bless( { 'Name' => 'Name1', 'Value' => 'Val1' } ), bless( { 'Name' => 'Name2', 'Value' => 'Val2' } ) ] }, 'List' ) ]; print $VAR1->[0]->{ListItem}->[0]->{Name}."\n"; would print "Name1". # item key value pairs... for my $item (@{$VAR1->[0]->{ListItem}}) { print "$item->{Name} => $item->{Value}\n"; } Rob
Re: 200 vhosts, 5 sets of libs, 2GB RAM, 1 httpd (seeking advice)
Chris Hagglund wrote: The trouble is, as each vhost loads this config file for its plain and SSL vhost directives, the amount of memory being used seems to be going up, and restarting apache is taking longer and longer. Intead of loading it over and over again (twice for vhosts with ssl!) I am hoping to find a way to tell apache to load PROD mp configuration, then load 100 PROD vhosts that will all share it, then load TEST mp configuration, then load 20 vhosts that use those libs, etc, but I am getting error like: 'mod_perl is already running, too late for PerlSwitches' when I am trying to start setting this up. It sounds like you want a two tier architecture. The front end will proxy a set of mod_perl servers running behind it. The front end will be configured to point to either your TEST, DEV, PROD, dev1, or dev2 apache instances. Each apache instance will only load one set of modules. It should reduce the amount of memory being used substantially and speed up apache restarts. Rob
Re: Charts and Graphs
Bill Whillers wrote: I'm wondering what people are using for efficiently generating charts and graphs on the fly from within a mod_perl environment. I've been using GD::Graph for a while but I'm hoping to get a bit more feature-deep. I'm not terribly concerned about getting a bit more complicated if it means better efficiency and/or better control, etc. Not an opensource solution... But we implemented Corda with pretty good success. GD only got us so far before we wanted graphs that were a bit more "Executive-friendly". It ain't easy to use though. But the graphs are hard to beat. Rob
Re: Lock Files - File is permanently locked
Justin Luster wrote: Does anyone know what might be happening? We are only using Apache::Registry in this instance. I can’t see how a lexically scoped file handle that is being locked is not being unlocked once the process ends. The process isn't ending if you're using Apache::Registry. I think you'll need to use Fcntl qw(:flock); flock $FileHandle, LOCK_UN; unless you set the Max child process config option to 1 (in which case, apache::registry would be useless). Also, if you're using child locking like this, you can write the requesting process's PID to the .lock (or whatever) file. Then a cron job could come along and reap your .lock's if the PID is no longer running. Then your file would only ever be locked for at most a minute. Seems like overkill though. Rob
Re: Lock Files - File is permanently locked
Justin Luster wrote: Here is an example of a call to OpenFile(). You will notice that I'm additionally locking the file itself as well as the lock file (I figured it would not hurt to have both methods): my $LockFileHandle = authlib::FileLock("udata_" . $strRespNum . "_lck.cgi", 1); #Read restart question name my ($DataFileHandle, $blnError) = authlib::OpenFile($strDataFileName, "update", 1, 1); authlib::LockMe($DataFileHandle, 1); authlib::RestartQNameWrite($DataFileHandle, $strRestartQName); close $DataFileHandle; close authlib::FileUnLock($LockFileHandle); Seems like an awful lot of code... open(DATAFILE,">$strDataFileName") or die; flock(DATAFILE,LOCK_EX); seek(DATAFILE,0,0); eval { authlib::RestartQNameWrite(\*DATAFILE,$strRestartQName); }; flock(DATAFILE,LOCK_UN); close(DATAFILE); if($@) { die $@; } Code like that has never failed me on Solaris or Linux. I don't write W32 code, so maybe it's more complicated than that. Also, > close authlib::FileUnLock($LockFileHandle); That seems like an error waiting to happen, since FileUnLock doesn't return a file handle. Rob
Re: Lock Files - File is permanently locked
Justin Luster wrote: Seems like an awful lot of code... open(DATAFILE,">$strDataFileName") or die; flock(DATAFILE,LOCK_EX); seek(DATAFILE,0,0); eval { authlib::RestartQNameWrite(\*DATAFILE,$strRestartQName); }; flock(DATAFILE,LOCK_UN); close(DATAFILE); if($@) { die $@; } *sighs* I need to proofread my code samples more. Ignore this cause it completely wrong. The code I cited was "append" code, rather than "rewrite" code. Oh well. Rob
Re: Malformed header from script
michael watson (IAH-C) wrote: Sorry for the confusion The code also actually attempts to print out HTML headers ie " etc" but these DO NOT come through to the webpage - instead, a bunch of special characters are printed out... Right... because the and tags are being (incorrectly) shoved into the Content-type field by apache.. From the command line do: HEAD http://my.web.host.com I bet you'll see Content-Type: or something close to that. Apache is expecting the first two lines of your output to be a content type header. I suspect that the reason you're running into this issue is because the original code was never intended to be run as a Apache::Registry script, and that the content type printing is being controlled by a global variable. i.e. print "Content-type: foo/bar\n\n" if($HEADER_PRINTED == 0); $HEADER_PRINTED = 1; That global variable is never being reset to 0, and thus all requests (except the very first) end up being sent across without a header. I could be wrong, but I would start grepping for 'Content-type' in the code. Rob
Re: Malformed header from script
michael watson (IAH-C) wrote: [Wed Apr 18 09:56:55 2007] [notice] Apache/2.2.4 (Unix) mod_perl/2.0.3 Perl/v5.8.0 configured -- resuming normal operations [Wed Apr 18 09:56:57 2007] [error] [client 149.155.40.20] malformed header from script. Bad header=: mapview [Wed Apr 18 09:56:57 2007] [warn] /perl/Gallus_gallus/mapview did not send an HTTP header [Wed Apr 18 09:57:45 2007] [error] [client 149.155.42.148] malformed header from script. Bad header=: mapview [Wed Apr 18 09:57:45 2007] [warn] /perl/Gallus_gallus/mapview did not send an HTTP header So this is Ensembl were dealing with, correct? I must confess, I don't really know what the Apache::Registry and ModPerl::Registry modules actually do, but the code in question is handled by ModPerl::Registry. From httpd.conf (mostly a perl script!): That's okay. I've never actually used either of them. In the CGI world, when a perl script is called it's read, parsed, compiled, and executed for each request. Then the script terminates. ModPerl::Registry reads, parses, and compiles the perl script once, and just keeps it in memory for any subsequent requests. The caveat is that sometimes global variables don't get reset to their original states because, well, the script doesn't ever exit. $Location{"/perl"}={ SetHandler => 'perl-script', PerlHandler => 'ModPerl::Registry', # Options => '+ExecCGI', allow => 'from all', # PerlSendHeader => 'On', PerlOptions => '+ParseHeaders', }; This all seems right. It should be examining the output of contigview and mapview to determine if there's a content type header, and if not, it will send text/html. I suspect that /perl may not actually be running in mod_perl. I would add a file to /perl called env. #!/usr/bin/perl print "Content-type: text/plain\n\n"; for (keys %ENV) { print "$_ => $ENV{$_}\n"; } That should print out a line like MOD_PERL => 'mod_perl/2.0.3' if it's working correctly. If not, it's a configuration problem. Maybe the /perl location config isn't in the virtual host you're using? Rob
Re: Getting user input during apache startup
Krist van Besien wrote: The code works insofar that it waits 5 seconds and than proceeds with the default I set, but it completely ignores any keypresses I make. It is as if STDIN is not available at the time this code runs. If I replace the ReadKey(5) with a ReadKey(5,STDIN) I get a syntax error. I suspect that apache may be closing STDIN before it reads the config. Maybe. You could try: close(STDIN); # just in case open(STDIN,"/dev/tty"); ReadMode('cbreak'); print "Press a key\n"; while (1) { $key = ReadKey(-1); if($key) { print "got $key\n"; last; } } ReadMode('restore'); Rob
Re: TIF image file
Michael Peters wrote: Vaughn, Terry wrote: I have some TIF files that I transferred from a windows box to a linux box over a Samba connection. I cannot get Apache to display the file.TIF with this simple .htm It's not apache that's having problems. I don't believe TIF images can be displayed by web browsers. That's correct. There are plugins to do this, and I think a new flash jobber that can open and load tifs. You could look into image magick for doing conversions on the fly for things like previewing before downloading. Just a thought... Rob
[mp1] Eval in Mason causes segfault
I've run into a strange error recently and wanted to see if anyone else had come across this. Basically, I have have a set of database handles created as globals in the HTML::Mason::Commands namespace. To use these, we assign them to an object. i.e.: my $obj = new Foo; $obj->{my_dbh} = $my_dbh; ... Sometimes a mason component will need to make use of more than one of these exported global database handles. To achieve this, I did the following... for my $dbhname (qw(some other handles)) { eval "\$obj->{${dbhname}_dbh} = \$${dbhname}_dbh;"; } In essence: $obj->{some_dbh} = $some_dbh; $obj->{other_dbh} = $other_dbh; $obj->{handles_dbh} = $handles_dbh; Randomly this will throw a segfault. Just for kicks, I tried: for my $dbhname (qw(some other handles)) { eval "\$obj->{${dbhname}_dbh} = \$HTML::Mason::Commands::${dbhname}_dbh;"; } Magically, no more segfaults. I'm sure that this issue has probably been fixed in later versions (ours is very old), but just wanted to give a heads up in case someone else ran into this issue. Rob
[mp2] HTML::Mason and Missing content
We're seeing some very strange behavior with HTML::Mason/Apache 2.2/MP2 that only affects a few of our files. I'm able to reproduce it reliably. We have a custom handler method that handles all requests to our site by passing them off to HTML::Mason (with exceptions for images, and the like). On some pages, the first few lines of HTML output are missing. If I add a newline to the very first line of the mason component, all of the content appears (see below). This has led me to believe that the issue is related to headers. Something is eating the first few lines of all out our output up until the the first blank line. Those lines however, do not appear in the header output of the request, though. They just seem to disappear somewhere inside apache2.2. Has anyone seen this problem before? We didn't experience it under MP1. Thanks, Rob - foo.mc: -- START -- Foo File Testing Apache 2.2: <% $now %> <%init> my $now = scalar localtime; <%attr> no_formatting=>1 menubar=>0 navbar=>0 footer=>0 subnav=>0 -- END -- Output: -- START -- Connection: close Date: Mon, 07 Apr 2008 18:41:48 GMT Server: Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.7m mod_perl/2.0.3 Perl/v5.8.7 Content-Type: text/html Client-Date: Mon, 07 Apr 2008 18:41:48 GMT Client-Peer: XXX Client-Response-Num: 1 Client-Transfer-Encoding: chunked - foo_fixed.mc: -- START -- Foo File Testing Apache 2.2: <% $now %> <%init> my $now = scalar localtime; <%attr> no_formatting=>1 menubar=>0 navbar=>0 footer=>0 subnav=>0 -- END -- Output: -- START -- Connection: close Date: Mon, 07 Apr 2008 18:43:04 GMT Server: Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.7m mod_perl/2.0.3 Perl/v5.8.7 Content-Type: text/html Client-Date: Mon, 07 Apr 2008 18:43:04 GMT Client-Peer: XX Client-Response-Num: 1 Client-Transfer-Encoding: chunked Title: Foo File Foo File Testing Apache 2.2: Mon Apr 7 14:43:04 2008 -- END --