Custom $SIG{__DIE__} problem (and I'm glad to be back)

2000-04-04 Thread Russell D. Weiss

Hey guys,

Before I start with my problem / question, let me just say that I haven't
been subscribed for a while.  I was doing some heavy mod_perl development
last year, and I was subscribed to the list for a long time.  Eventually,
mail from this list and the other lists I was subscribed to got too great,
so I had to unsubscribe for a while.  I'm really happy to see that the list
is still alive... helping mod_perl developers.  I've consulted the Epigone
archive once or twice in my 'absence' :-).

I've also started on a consulting position for an Internet startup company,
and I've swayed them toward mod_perl!  We're in the process of developing a
very large application using mod_perl.  The only problem they've had is
finding other experience mod_perlers...  but there have been threads on the
list about that sort of thing.

Anyway, this may sound weird, but I have a "wrapper" object which contains
an Apache::Session object.  On odd cases, if a script dies, this object
never gets destroyed.  This seems to only occur in situations where the
script dies because the perl interpreter is pretty darn confused.  For
example, if I include a 'die "blah blah blah";' in the script, the "wrapper"
object does get destroyed, and thus the Session object gets destroyed /
untied.  In odd cases, however, like when the script contains a misplaced
quote or bracket, the object won't be destroyed.

As you may know, it's absolutely critical that the Apache::Session object
goes out of scope -- otherwise the lock on the object never goes away.  Then
we get a 'deadlock' and the Apache processes all get tied up waiting for
this lock to go away (which it never will).  The solution I've thought of is
to create a custom $SIG{'__DIE__'} handler.  By the way, this "wrapper"
object is also a toolbox, used commonly within most of our scripts (it
auto-constructs a Session, handles some of the dirtywork that
Apache::Session doesn't include [cookies, timeout, etc.], and includes other
objects that we often make use of, including CGI and HTML::Template).
Because almost every app uses this "wrapper" object, I'd like to have that
object include the custom die handler in the  object.  Also, this sighandler
needs to be able to run the DESTROY method on the object at hand, so we
undef the Session object (and some of the other objects) and release locks.

So, onto the problem.  Within the constructor for the wrapper object, I want
to do:
 bless $self, $class;
 $main::SIG{'__DIE__'} = $self-custom_die;

And this will work... BUT, as you may know, perl passes the error message as
the FIRST argument.  And, in perl's OO model, when I do the OO call as
above, $self is put into the first argument.  Unfortunately, perl doesn't
simply push the error onto the parameter array, instead it "overwrites" the
error message with the $self object reference.  I've tried different ways of
doing this.  The only way that "works" is a very kludgey way which I really
don't like, because it may cause me to run into errors later and it doesn't
really follow the OO model (a lexical to the package should know nothing
about object instances).

What I speak of is (within the constructor):
$WrapperObj::SelfRef = \$self;  # Very kludgey, I _hate_ this method
$main::SIG{'__DIE__'} = custom_die;

This way, the custom_die sub does get the error message as the 0th element
in the param array... BUT it has to then do something like $self =
${$WrapperObj::SelfRef}; to get the object reference, so it can later do a
$self-DESTROY.  Messy, eh?

Any clues / hints as to how I can do this in a more correct / OO way.  My
goal here is to write a die sighandler that will allow me to explicitly
destroy this object and also output the error the browser (for developers)
rather than to the STDERR.

Thanks in advance,

Russ

Russell Weiss
Founder and Technical Manager
InfoRelay Online Systems, Inc.
http://www.InfoRelay.net/





authdbi

2000-04-04 Thread Adam Gotheridge

how come when I use this example from the docs (in httpd.conf):

Perl
 my($uid,$pwd) = My::dbi_pwd_fetch();
 $Location{'/foo/bar'}-{PerlSetVar} = [
 [ Auth_DBI_username  = $uid ],
 [ Auth_DBI_password  = $pwd ],
 ];
 /Perl

I get:
Undefined subroutine My::dbi_pwd_fetch called at /www/conf/httpd.conf line 969.





Re: Custom $SIG{__DIE__} problem (and I'm glad to be back)

2000-04-04 Thread James G Smith

"Russell D. Weiss" [EMAIL PROTECTED] wrote:

So, onto the problem.  Within the constructor for the wrapper object, I want
to do:
 bless $self, $class;
 $main::SIG{'__DIE__'} = $self-custom_die;

Try

  bless $self, $class;
  $main::SIG{'__DIE__'} = sub { $self-custom_die(@_) };

This will make sure $self is the first argument to custom_die, it
will be the same $self as when the signal handler was called, and
the signal handling mechanism won't have to know about it.
+-
James Smith - [EMAIL PROTECTED] | http://www.jamesmith.com/
[EMAIL PROTECTED] | http://sourcegarden.org/
  [EMAIL PROTECTED]  | http://cis.tamu.edu/systems/opensystems/
+--



[mod_perl audio tutorials] (was Re: [OT slightly] mod_perl developers (do they exist?)

2000-04-04 Thread Stas Bekman

On Thu, 30 Mar 2000, Bakki Kudva wrote:

  If I understand correctly the handouts and possible audio/video records
  belong to the host of the conference. Therefore you should talk to them
  about this issue. It can be ORA, Camelot or any other conference
  organizer.
 
 In that case they would have little incentive to release this material as
 they are in the business of conducting training and tutorials.

That's right

  Another possibility is to organize a training session which will be hosted
  by you for example and then you will be able to make the recording with
  the only permission of the speakers.
 
  Of course if your intention is to make money by selling the recordings,
  you will have to pay a certain percentage to the "artists".
 
 This is not my line of business and so I wasn't thinking of this as a
 for-profit venture. It was more of a community service project in my mind.
 However a nominal charge to recover production costs, (specially if CD-ROMs
 are pressed) speaker's fees etc might be ok. The whole point was to make a
 tutorial available to "the rest of us" and promote further use of mod_perl.
 I wasn't personally planning on profiting from this other than the learning
 experience at the 'feet of the gurus' :)

I've assumed that you didn't want to make a profit, I just said 'if...' :)

  BTW, I think that if you are serious about doing this project, I believe
  that the only way to do that is in the video format. It's hard to imagine
  the slide and see where the speaker points to with his laser on the audio
  recording. Audio format is fine for keynotes, but not for tutorials.
 
 I used to feel the same way until I saw the SUN webcasts and Bruce Eckel's
 "Thinking in Java" course. The slides/audio presentation works very well
 over low bandwidth connections and would be cheaper to setup than a
 streaming video server. Did you check out the links I had in my original
 post? Just imaging that you are in a presentation in a darkened room where
 you can't see the speaker :-)

Well, I've just installed the G2 Player and tried it. Yes it's quite good.
May be you are right and it would work. So are you going to give it a
whirl?

__
Stas Bekman | JAm_pH--Just Another mod_perl Hacker
http://stason.org/  | mod_perl Guide http://perl.apache.org/guide/ 
mailto:[EMAIL PROTECTED]  | http://perl.orghttp://stason.org/TULARC/
http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org
--





RE: Custom $SIG{__DIE__} problem (and I'm glad to be back)

2000-04-04 Thread Russell D. Weiss

Thanks James,

Great little trick It worked!

Thanks for the help,
Russ

Russell Weiss
Founder and Technical Manager
InfoRelay Online Systems, Inc.
http://www.InfoRelay.net/
 


 Try
 
   bless $self, $class;
   $main::SIG{'__DIE__'} = sub { $self-custom_die(@_) };
 
 This will make sure $self is the first argument to custom_die, it
 will be the same $self as when the signal handler was called, and
 the signal handling mechanism won't have to know about it.
 +-
 
 James Smith - [EMAIL PROTECTED] | http://www.jamesmith.com/
 [EMAIL PROTECTED] | http://sourcegarden.org/
   [EMAIL PROTECTED]  | 
 http://cis.tamu.edu/systems/opensystems/
 +-
 -
 



Static linking of GD module

2000-04-04 Thread Roca, Ignasi

Hi,

I prepared a perl5 binary with the GD.pm, the perl5 interface to Thomas
Boutell's gd library, linked static.

From the browser, that means via mod_perl, I request a perl-script
'fills.pl' that requires the GD package, following error is output in the
error_log:

[error] DYNA:Can't load module GD, dynamic loading not available in this
perl.
  (You may need to build a new perl executable which either supports dynamic
loading or has the GD module statically linked into it.)
  at /home/vtx3/apache/htdocs/perl/GD/fills.pl line 3
Compilation failed in require at /home/vtx3/apache/htdocs/perl/GD/fills.pl
line 3. 
BEGIN failed--compilation aborted at
/home/vtx3/apache/htdocs/perl/GD/fills.pl line 3. 

On the other site when I call the perl-script directly with perl5, that is
"perl fills.pl", without apache/mod_perl, it works.

I'm working with perl5.005.63 and and Apache.1.3.9.

Can somebody give me a solution.



Re: Custom $SIG{__DIE__} problem (and I'm glad to be back)

2000-04-04 Thread Randal L. Schwartz

 "James" == James G Smith [EMAIL PROTECTED] writes:

James "Russell D. Weiss" [EMAIL PROTECTED] wrote:
 
 So, onto the problem.  Within the constructor for the wrapper object, I want
 to do:
 bless $self, $class;
 $main::SIG{'__DIE__'} = $self-custom_die;

James Try

James   bless $self, $class;
James   $main::SIG{'__DIE__'} = sub { $self-custom_die(@_) };

James This will make sure $self is the first argument to custom_die, it
James will be the same $self as when the signal handler was called, and
James the signal handling mechanism won't have to know about it.

But ensure that $self is a lexical ("my") variable.  If it's a package
variable (even with local()) this will not work, because a closure
reference will not get made.  You also don't need the $main:: because
%SIG (actually *SIG) is forced to main::.

Just another couple of Perl tips from someone who wrangles Perl all day
every day... :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: cgi script efficiently invoking another cgi script

2000-04-04 Thread darren chamberlain

BT ([EMAIL PROTECTED]) said something to this effect:
 Assume you roughly have a one-to-one between scripts and web pages.
 How do you write a script to display its own web page or efficiently
 invoke another script/page?  Redirect is slow.  Can you exec, i.e.
 can a cgi script exec another in it's own place?
 
 For example:
 Suppose you write a "login" script/screen in a cgi file, to display
 and verify (and possibly redisplay) a web page for login information.
 On successful login, you want it to set some cookies and invoke
 another script/screen.  A redirect seems extremely inefficient.
 
 I find this situation pops up all over the place.  How do other
 people deal with this?  Just redirect?

I don't think you can do this in CGI, but when using the mod_perl API, 
you can call $r-internal_redirect( '/target/uri' ). This
is how Apache handles ErrorDocument generation; the URI in the
location box is unchanged, there is no second request (as far
as the browser is concerned), and the output of the second
handler gets sent to the browser.

darren


-- 
There is nothing so easy but that it becomes difficult when you do it
reluctantly.
-- Publius Terentius Afer (Terence)



[ANNOUNCE] Apache::DebugInfo_0.02

2000-04-04 Thread Geoffrey Young

oops, there was a pretty major bug in the first release that required an IP
list in order to get any output (whoops)...

sorry for the inconvienence (but probably nobody is using it anyway :)  To
make up for it, pnotes now supports complex data structures via Data::Dumper

--Geoff

The URL

http://users.laserlink.net/~gyoung/modules/Apache-DebugInfo_0.02.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/G/GE/GEOFF/Apache-DebugInfo_0.02.tar.gz
  size: 5247 bytes
   md5: b9be1eef0b02addc562875805540fe80

Changes:

Revision history for Perl extension Apache::DebugInfo.

0.01  4.3.2000
- original version
- many kudos and gratitude to those who offered
  their suggestions and improvements prior to
  the first release:
Ask Bjoern Hansen
Graham Barr
René Seindal

0.02  4.4.2000
- fixed bug in ip match that required an ip address
  to check against
- added Data::Dumper support to pnotes - not as pretty
  as the stuff before, but it now supports complex
  data structures and is less bulky  
  Suggested by René Seindal
- minor pod and documentation changes



authenticated user

2000-04-04 Thread Adam Gotheridge

How do I get the username someone entered in a http authentication prompt?

I got authDBI working, but I can't figure out hot to access the user name which
was passed so that I can use it in further sql-dml statements.




RE: authenticated user

2000-04-04 Thread Eric Cholet

 How do I get the username someone entered in a http authentication prompt?
 
 I got authDBI working, but I can't figure out hot to access the user name which
 was passed so that I can use it in further sql-dml statements.
 

$r-connection-user(), or $ENV{REMOTE_USER} if you're in CGI emulation

--
Eric




Re: authenticated user

2000-04-04 Thread Michael Finke

On Tue, 04 Apr 2000, Adam Gotheridge wrote:
 How do I get the username someone entered in a http authentication prompt?
 
 I got authDBI working, but I can't figure out hot to access the user name which
 was passed so that I can use it in further sql-dml statements.

Try this:
my $r = shift;

my ($res, $sent_pwd) = $r-get_basic_auth_pw;
return $res if $res; #decline if not Basic

my $user = $r-connection-user;

It works well for me, even if it might not be the most efficient way.  It's
probably cribbed out of the eagle book, I never claimed it was original
 -- 
Michael Finke
ScreamDesign.Com
(978)-579-0898 X240



modperl 1.22 and NameWithVirtualHost not working properly

2000-04-04 Thread Jason Terry

#you may define Perl*Handler subroutines here too
print "Making Apache::Registry scripts global . . .";
$Apache::Registry::NameWithVirtualHost = 0;
print "Done.\nLoading admin.cgi . . . . . . . . . . . . . ";
my $r = Apache::RegistryLoader-new;
$r-handler("/cgi-bin/admin.cgi", "/home/vshopper/public_html/cgi-bin/admin.cgi");
print "Done.\n";

The above is a portion of my startup.pl when I run it from
Apache/1.3.11 (Unix)
mod_perl/1.21
PHP/3.0.14
mod_ssl/2.5.0
OpenSSL/0.9.4
it works like it should

However, when I run it from
Apache/1.3.12 (Unix)
mod_perl/1.22
PHP/3.0.15
mod_ssl/2.6.2
OpenSSL/0.9.5a-beta1
It seems to partially ignore the NameWithVirtualHost.  It loads the script without the 
virtual hosts properly.  However, when
someone actually tries to run admin.cgi from a virtual hosts it re-compiles the script 
into the child again under it's the virtual
server.

Does anybody know why it worked in 1.21 but doesn't work in 1.22?

Thanks in advance
-Jason




Re: [mod_perl audio tutorials] (was Re: [OT slightly] mod_perl developers (do they exist?)

2000-04-04 Thread Bakki Kudva

 Stas Bekman  wrote on Tuesday, April 04, 2000 2:59 AM :

 Well, I've just installed the G2 Player and tried it. Yes it's quite good.
 May be you are right and it would work. So are you going to give it a
 whirl?

I'd love to give it a try. Couple of starting points.

1. Conferences will not be a good source for the material. So we'll have to
find an alternative. We may have to compile this incrementally, slide by
slide. The slides/audio files can be created by the author, (who can be the
'guru'? Would you have the time to do it?) or I can have some one just read
from a script.

2. I am not sure what the SUN site uses at the server side. We can do ours
using mod_perl ofcourse unless something like it already exists. I like the
"last slide", "next slide" buttons to which we may be able to add "last
chapter#", "next chapter#"  buttons to make the presentation more
interactive. With some help I would be willing to roll this out myself. My
web site is at Verio. So mod_perl won't be possible there, though I would
have loved to host the site there. If we can do it with CGI may be it can be
hosted there. The simplest way to put audio would have been with the
bgsound tag and .wav, or .au files. Unfortunately this works only for IE.
Don't know if Netscape v4.72 supports it yet. Any ideas here?

bakki

Bakki Kudva
Navaco
(Electronic Document Management Solutions)
phone: (814) 833-2592
fax:  (603) 947-5747
http://www.navaco.com/





Looking for mod perl developers desperately (fwd)

2000-04-04 Thread Jeffrey W. Baker


Forwarded without comment -jwb

-- Forwarded message --
Date: Tue, 4 Apr 2000 11:35:53 -0400
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Looking for mod perl developers desperately

Jeffrey,

I am looking for a team of 5 developers with one architect type who could
help design and implement an enterprise level high profile e-commerce site.


Thanks,
Rex





Re: [mod_perl audio tutorials] (was Re: [OT slightly] mod_perldevelopers (do they exist?)

2000-04-04 Thread Jeffrey W. Baker

On Tue, 4 Apr 2000, Bakki Kudva wrote:

  Stas Bekman  wrote on Tuesday, April 04, 2000 2:59 AM :
 
  Well, I've just installed the G2 Player and tried it. Yes it's quite good.
  May be you are right and it would work. So are you going to give it a
  whirl?
 
 I'd love to give it a try. Couple of starting points.
 
 1. Conferences will not be a good source for the material. So we'll have to
 find an alternative. We may have to compile this incrementally, slide by
 slide. The slides/audio files can be created by the author, (who can be the
 'guru'? Would you have the time to do it?) or I can have some one just read
 from a script.
 
 2. I am not sure what the SUN site uses at the server side. We can do ours
 using mod_perl ofcourse unless something like it already exists. I like the
 "last slide", "next slide" buttons to which we may be able to add "last
 chapter#", "next chapter#"  buttons to make the presentation more
 interactive. With some help I would be willing to roll this out myself. My
 web site is at Verio. So mod_perl won't be possible there, though I would
 have loved to host the site there. If we can do it with CGI may be it can be
 hosted there. The simplest way to put audio would have been with the
 bgsound tag and .wav, or .au files. Unfortunately this works only for IE.
 Don't know if Netscape v4.72 supports it yet. Any ideas here?

Looking through the w3c site, I don't see the element bgsound
*anywhere*.  Hopefully Netscape does not and will never support such an
abomination.

Consider just this once that HTML is not the preferred way to deliver this
kind of content.  Perhaps the tutorial could be in the form of an MP3
file, with instructions to turn to the next slide periodically.  The slide
could be HTML scaffolds around an image.  Anyway, this has the advantage
of following standards and also allowing the user the freedom to move the
audio stream and slides independently.

-jwb




Sharing memory between Apache processes

2000-04-04 Thread Flemming Mahler Larsen

Hi,

We've been moving several small "CGI powered sites" to mod_perl and the
results has been quite terrific. Based on this we're about to move our
first large (large in size and heavy traffic) site from an Oracle
Application Server to mod_perl. We're using our own custom
"HTML::Template"-like module and reading all templates in to the memory
during the server start-up (these are placed in a hash structure in a
"project-speciffic"-module name space).

It seems as this has the effect that each server process keeps its own
copy of the templates. I would like to avoid this by using some sort of
shared memory between the server processes. Does any of you have any
experience in this field (or even better examples of how to do it)?

TIA,
Flemming
--
Flemming Mahler Larsen, Tele Danmark Internet
http://projekt.tele.dk.net/about/mahler.html // +45 3917 9013





Re: Sharing memory between Apache processes

2000-04-04 Thread Vivek Khera

 "FML" == Flemming Mahler Larsen [EMAIL PROTECTED] writes:

FML It seems as this has the effect that each server process keeps its own
FML copy of the templates. I would like to avoid this by using some sort of
FML shared memory between the server processes. Does any of you have any
FML experience in this field (or even better examples of how to do it)?

If that's the case then there's something wrong with your OS' virtual
memory system or it is really ancient.

If you preload the information at server start time, the forked off
children *should* share the same physical memory pages until they
modify them (copy on write.)  Your OS may report the memory used for
each child, giving the illusion that more memory is used.  The only
way to really tell is to figure out how much of the memory is in
shared pages.  That's a highly os-dependent thing, and you have not
yet shared those details with us.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-301-545-6996
PGP  MIME spoken herehttp://www.kciLink.com/home/khera/



Re: Sharing memory between Apache processes

2000-04-04 Thread Drew Taylor

Flemming,

Check out IPC::SharedCache (uses IPC::ShareLite(?) underneath) by Sam
Tregar, author of HTML::Template. It does exactly what the name implies.
I believe the most recent version is 1.3, but check out your local CPAN
mirror for the latest copy. The documentation is rather good IMHO and it
is used by HTML::Template for a shared cache.

Flemming Mahler Larsen wrote:
 
 Hi,
 
 We've been moving several small "CGI powered sites" to mod_perl and the
 results has been quite terrific. Based on this we're about to move our
 first large (large in size and heavy traffic) site from an Oracle
 Application Server to mod_perl. We're using our own custom
 "HTML::Template"-like module and reading all templates in to the memory
 during the server start-up (these are placed in a hash structure in a
 "project-speciffic"-module name space).
 
 It seems as this has the effect that each server process keeps its own
 copy of the templates. I would like to avoid this by using some sort of
 shared memory between the server processes. Does any of you have any
 experience in this field (or even better examples of how to do it)?


-- 
Drew Taylor
Vialogix Communications, Inc.
501 N. College Street
Charlotte, NC 28202
704.370.0550
http://www.vialogix.com



RE: Sharing memory between Apache processes

2000-04-04 Thread Russell D. Weiss


 It seems as this has the effect that each server process keeps its own
 copy of the templates. I would like to avoid this by using some sort of
 shared memory between the server processes. Does any of you have any
 experience in this field (or even better examples of how to do it)?

A good package for this is IPC::Shareable.  You can store info in semaphores
and share it between processes.

Another approach would be to use something like Apache::Session with a
common session ID of '0' or something of that short.  Apache::Session has no
problem storing complex data structures, and by having each script tie to
session with ID '0', you access a common data store.  I think the
Apache::Session docs talk a little bit about using the package to create
this type of shared memory store.

Hope this helps,
Russell Weiss
Founder and Technical Manager
InfoRelay Online Systems, Inc.
http://www.InfoRelay.net/





Re: Sharing memory between Apache processes

2000-04-04 Thread JoshNarins

 It seems as this has the effect that each server process keeps its own
 copy of the templates. I would like to avoid this by using some sort of
 shared memory between the server processes. Does any of you have any
 experience in this field (or even better examples of how to do it)?

A good package for this is IPC::Shareable.  You can store info in semaphores
and share it between processes.

Except that I don't think you can you use shared memory (the semaphores are 
just
flags) across multiple web servers, and I have been wrong before.



RE: modperl 1.22 and NameWithVirtualHost not working properly

2000-04-04 Thread Geoffrey Young

well, there has been some NameWithVirtualHost work going on to solve a
related problem - perhaps the behavior you used to see is changing due to
that?

at any rate, check out the new RegistryLoader docs - you can now compile
scripts with the vhost stuff in them:

 $r-handler($uri, $filename, $virtual_hostname);

HTH

--Geoff

 -Original Message-
 From: Jason Terry [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 04, 2000 11:45 AM
 To: [EMAIL PROTECTED]
 Subject: modperl 1.22 and NameWithVirtualHost not working properly
 
 
 #you may define Perl*Handler subroutines here too
 print "Making Apache::Registry scripts global . . .";
 $Apache::Registry::NameWithVirtualHost = 0;
 print "Done.\nLoading admin.cgi . . . . . . . . . . . . . ";
 my $r = Apache::RegistryLoader-new;
 $r-handler("/cgi-bin/admin.cgi", 
 "/home/vshopper/public_html/cgi-bin/admin.cgi");
 print "Done.\n";
 
 The above is a portion of my startup.pl when I run it from
 Apache/1.3.11 (Unix)
 mod_perl/1.21
 PHP/3.0.14
 mod_ssl/2.5.0
 OpenSSL/0.9.4
 it works like it should
 
 However, when I run it from
 Apache/1.3.12 (Unix)
 mod_perl/1.22
 PHP/3.0.15
 mod_ssl/2.6.2
 OpenSSL/0.9.5a-beta1
 It seems to partially ignore the NameWithVirtualHost.  It 
 loads the script without the virtual hosts properly.  However, when
 someone actually tries to run admin.cgi from a virtual hosts 
 it re-compiles the script into the child again under it's the virtual
 server.
 
 Does anybody know why it worked in 1.21 but doesn't work in 1.22?
 
 Thanks in advance
 -Jason
 



Re: modperl 1.22 and NameWithVirtualHost not working properly

2000-04-04 Thread Jason Terry

But, I don't want the virtual host information included.  ALL of my scripts on 
this web server are GLOBAL and in order to save
memory I only want to have one copy loaded and shared for multiple virtual hosts.

It used to be that if you set
$Apache::Registry::NameWithVirtualHost = 0;

Then mod_perl would ignore the virtual host an use the same script for all users.  
However with 1.22 it doesn't seem to be doing
that anymore.

- Original Message -
From: "Geoffrey Young" [EMAIL PROTECTED]
To: "'Jason Terry'" [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, April 04, 2000 10:31 AM
Subject: RE: modperl 1.22 and NameWithVirtualHost not working properly


 well, there has been some NameWithVirtualHost work going on to solve a
 related problem - perhaps the behavior you used to see is changing due to
 that?

 at any rate, check out the new RegistryLoader docs - you can now compile
 scripts with the vhost stuff in them:

  $r-handler($uri, $filename, $virtual_hostname);

 HTH

 --Geoff

  -Original Message-
  From: Jason Terry [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, April 04, 2000 11:45 AM
  To: [EMAIL PROTECTED]
  Subject: modperl 1.22 and NameWithVirtualHost not working properly
 
 
  #you may define Perl*Handler subroutines here too
  print "Making Apache::Registry scripts global . . .";
  $Apache::Registry::NameWithVirtualHost = 0;
  print "Done.\nLoading admin.cgi . . . . . . . . . . . . . ";
  my $r = Apache::RegistryLoader-new;
  $r-handler("/cgi-bin/admin.cgi",
  "/home/vshopper/public_html/cgi-bin/admin.cgi");
  print "Done.\n";
 
  The above is a portion of my startup.pl when I run it from
  Apache/1.3.11 (Unix)
  mod_perl/1.21
  PHP/3.0.14
  mod_ssl/2.5.0
  OpenSSL/0.9.4
  it works like it should
 
  However, when I run it from
  Apache/1.3.12 (Unix)
  mod_perl/1.22
  PHP/3.0.15
  mod_ssl/2.6.2
  OpenSSL/0.9.5a-beta1
  It seems to partially ignore the NameWithVirtualHost.  It
  loads the script without the virtual hosts properly.  However, when
  someone actually tries to run admin.cgi from a virtual hosts
  it re-compiles the script into the child again under it's the virtual
  server.
 
  Does anybody know why it worked in 1.21 but doesn't work in 1.22?
 
  Thanks in advance
  -Jason
 




Re: Sharing memory between Apache processes

2000-04-04 Thread Roger Grayson

Flemming Mahler Larsen wrote:
 
 Hi,
 
 We've been moving several small "CGI powered sites" to mod_perl and the
 results has been quite terrific. Based on this we're about to move our
 first large (large in size and heavy traffic) site from an Oracle
 Application Server to mod_perl. We're using our own custom
 "HTML::Template"-like module and reading all templates in to the memory
 during the server start-up (these are placed in a hash structure in a
 "project-speciffic"-module name space).
 
 It seems as this has the effect that each server process keeps its own
 copy of the templates. I would like to avoid this by using some sort of
 shared memory between the server processes. Does any of you have any
 experience in this field (or even better examples of how to do it)?
 
 TIA,
 Flemming
 --
 Flemming Mahler Larsen, Tele Danmark Internet
 http://projekt.tele.dk.net/about/mahler.html // +45 3917 9013

Check  HTML::Template - it has a IPC shared cache feature implemented with 
IPC::ShareLite.
-- 
...
Roger Grayson - Software Developer
Physical Verification Runset Center
System-on-a-chip Design Technology - Motorola, Inc. - Austin TX
Phone#(work): (512)996-7302 
email: [EMAIL PROTECTED]
...



RE: modperl 1.22 and NameWithVirtualHost not working properly

2000-04-04 Thread Geoffrey Young

whoops - sorry for misunderstanding - I'll look into it and see if I see the
same thing.

are you preloading Apache::Registry (either using PerlModule or in a
startup.pl?)

 -Original Message-
 From: Jason Terry [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 04, 2000 12:42 PM
 To: Geoffrey Young; [EMAIL PROTECTED]
 Subject: Re: modperl 1.22 and NameWithVirtualHost not working properly
 
 
 But, I don't want the virtual host information included.  
 ALL of my scripts on this web server are GLOBAL and in order to save
 memory I only want to have one copy loaded and shared for 
 multiple virtual hosts.
 
 It used to be that if you set
 $Apache::Registry::NameWithVirtualHost = 0;
 
 Then mod_perl would ignore the virtual host an use the same 
 script for all users.  However with 1.22 it doesn't seem to be doing
 that anymore.
 
 - Original Message -
 From: "Geoffrey Young" [EMAIL PROTECTED]
 To: "'Jason Terry'" [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Tuesday, April 04, 2000 10:31 AM
 Subject: RE: modperl 1.22 and NameWithVirtualHost not working properly
 
 
  well, there has been some NameWithVirtualHost work going on 
 to solve a
  related problem - perhaps the behavior you used to see is 
 changing due to
  that?
 
  at any rate, check out the new RegistryLoader docs - you 
 can now compile
  scripts with the vhost stuff in them:
 
   $r-handler($uri, $filename, $virtual_hostname);
 
  HTH
 
  --Geoff
 
   -Original Message-
   From: Jason Terry [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, April 04, 2000 11:45 AM
   To: [EMAIL PROTECTED]
   Subject: modperl 1.22 and NameWithVirtualHost not working properly
  
  
   #you may define Perl*Handler subroutines here too
   print "Making Apache::Registry scripts global . . .";
   $Apache::Registry::NameWithVirtualHost = 0;
   print "Done.\nLoading admin.cgi . . . . . . . . . . . . . ";
   my $r = Apache::RegistryLoader-new;
   $r-handler("/cgi-bin/admin.cgi",
   "/home/vshopper/public_html/cgi-bin/admin.cgi");
   print "Done.\n";
  
   The above is a portion of my startup.pl when I run it from
   Apache/1.3.11 (Unix)
   mod_perl/1.21
   PHP/3.0.14
   mod_ssl/2.5.0
   OpenSSL/0.9.4
   it works like it should
  
   However, when I run it from
   Apache/1.3.12 (Unix)
   mod_perl/1.22
   PHP/3.0.15
   mod_ssl/2.6.2
   OpenSSL/0.9.5a-beta1
   It seems to partially ignore the NameWithVirtualHost.  It
   loads the script without the virtual hosts properly.  
 However, when
   someone actually tries to run admin.cgi from a virtual hosts
   it re-compiles the script into the child again under it's 
 the virtual
   server.
  
   Does anybody know why it worked in 1.21 but doesn't work in 1.22?
  
   Thanks in advance
   -Jason
  
 



Re: authenticated user

2000-04-04 Thread Roger Grayson

Adam Gotheridge wrote:
 
 How do I get the username someone entered in a http authentication prompt?
 
 I got authDBI working, but I can't figure out hot to access the user name which
 was passed so that I can use it in further sql-dml statements.

sub handler {
   my $r = shift;
   my $user_id = $r-connection-user;
   
}
-- 
...
Roger Grayson - Software Developer
Physical Verification Runset Center
System-on-a-chip Design Technology - Motorola, Inc. - Austin TX
Phone#(work): (512)996-7302 
email: [EMAIL PROTECTED]
...



authDBI connect on init?

2000-04-04 Thread Adam Gotheridge

Is there anyway to get AuthDBI to connect on initialization of the web server
like you can with "DBI-connect_on_init(...)"?






RE: modperl 1.22 and NameWithVirtualHost not working properly

2000-04-04 Thread Geoffrey Young

yup - I see the same thing if I use a vhost setup...

Doug - looks like in trying to fix that pest some undesired behavior has
been introduced (ack!).  I imagine that sharing scripts is probably more
important that a fix that still doesn't work?

 :)

--Geoff

 -Original Message-
 From: Jason Terry [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 04, 2000 12:55 PM
 To: Geoffrey Young; [EMAIL PROTECTED]
 Subject: Re: modperl 1.22 and NameWithVirtualHost not working properly
 
 
 Yes, I am preloading it.
 Below is my entire startup.pl none of the script load globally
 and please note that it does work in 1.21 but not in 1.22
 
 
 
 #load perl modules of your choice here
 #this code is interpreted *once* when the server starts
 use Apache::Status ();
 use Apache::Registry ();
 use Devel::Symdump ();
 use Apache::RegistryLoader ();
 use CGI ();
 use LWP::UserAgent ();
 #use Apache::DBI ();
 #use DBI ();
 
 print "\n";
 #you may define Perl*Handler subroutines here too 
 print "Making Apache::Registry scripts global . . .";
 $Apache::Registry::NameWithVirtualHost = 0;
 print "Done.\nLoading admin.cgi . . . . . . . . . . . . . ";
 my $r = Apache::RegistryLoader-new;
 $r-handler("/cgi-bin/admin.cgi", 
 "/home/vshopper/public_html/cgi-bin/admin.cgi");
 print "Done.\nLoading cart.cgi . . . . . . . . . . . . . .";
 my $s = Apache::RegistryLoader-new;
 $s-handler("/cgi-bin/cart.cgi" , 
 "/home/vshopper/public_html/cgi-bin/cart.cgi");
 #print "Done.\nLoading cart_jason.cgi . . . . . . . . . . . . . .";
 #my $t = Apache::RegistryLoader-new;
 #$t-handler("/cgi-bin/cart_jason.cgi" , 
 "/home/vshopper/public_html/cgi-bin/cart_jason.cgi");
 print "Done.\n";
 
 1; #return true value
 
 
 
 
 
 
 
 
 
 
 
 
 - Original Message - 
 From: "Geoffrey Young" [EMAIL PROTECTED]
 To: "'Jason Terry'" [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Tuesday, April 04, 2000 10:47 AM
 Subject: RE: modperl 1.22 and NameWithVirtualHost not working properly
 
 
  whoops - sorry for misunderstanding - I'll look into it and 
 see if I see the
  same thing.
  
  are you preloading Apache::Registry (either using PerlModule or in a
  startup.pl?)
  
   -Original Message-
   From: Jason Terry [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, April 04, 2000 12:42 PM
   To: Geoffrey Young; [EMAIL PROTECTED]
   Subject: Re: modperl 1.22 and NameWithVirtualHost not 
 working properly
   
   
   But, I don't want the virtual host information included.  
   ALL of my scripts on this web server are GLOBAL and in 
 order to save
   memory I only want to have one copy loaded and shared for 
   multiple virtual hosts.
   
   It used to be that if you set
   $Apache::Registry::NameWithVirtualHost = 0;
   
   Then mod_perl would ignore the virtual host an use the same 
   script for all users.  However with 1.22 it doesn't seem 
 to be doing
   that anymore.
   
   - Original Message -
   From: "Geoffrey Young" [EMAIL PROTECTED]
   To: "'Jason Terry'" [EMAIL PROTECTED]; [EMAIL PROTECTED]
   Sent: Tuesday, April 04, 2000 10:31 AM
   Subject: RE: modperl 1.22 and NameWithVirtualHost not 
 working properly
   
   
well, there has been some NameWithVirtualHost work going on 
   to solve a
related problem - perhaps the behavior you used to see is 
   changing due to
that?
   
at any rate, check out the new RegistryLoader docs - you 
   can now compile
scripts with the vhost stuff in them:
   
 $r-handler($uri, $filename, $virtual_hostname);
   
HTH
   
--Geoff
   
 -Original Message-
 From: Jason Terry [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 04, 2000 11:45 AM
 To: [EMAIL PROTECTED]
 Subject: modperl 1.22 and NameWithVirtualHost not 
 working properly


 #you may define Perl*Handler subroutines here too
 print "Making Apache::Registry scripts global . . .";
 $Apache::Registry::NameWithVirtualHost = 0;
 print "Done.\nLoading admin.cgi . . . . . . . . . . . . . ";
 my $r = Apache::RegistryLoader-new;
 $r-handler("/cgi-bin/admin.cgi",
 "/home/vshopper/public_html/cgi-bin/admin.cgi");
 print "Done.\n";

 The above is a portion of my startup.pl when I run it from
 Apache/1.3.11 (Unix)
 mod_perl/1.21
 PHP/3.0.14
 mod_ssl/2.5.0
 OpenSSL/0.9.4
 it works like it should

 However, when I run it from
 Apache/1.3.12 (Unix)
 mod_perl/1.22
 PHP/3.0.15
 mod_ssl/2.6.2
 OpenSSL/0.9.5a-beta1
 It seems to partially ignore the NameWithVirtualHost.  It
 loads the script without the virtual hosts properly.  
   However, when
 someone actually tries to run admin.cgi from a virtual hosts
 it re-compiles the script into the child again under it's 
   the virtual
 server.

 Does anybody know why it worked in 1.21 but doesn't 
 work in 1.22?

 Thanks in advance
 -Jason

  
 



Re: [mod_perl audio tutorials]

2000-04-04 Thread Bakki Kudva

Jeffrey W. Baker wrote on Tuesday, April 04, 2000 12:04 PM:

 Consider just this once that HTML is not the preferred way to deliver this
 kind of content.  Perhaps the tutorial could be in the form of an MP3
 file, with instructions to turn to the next slide periodically.  The slide
 could be HTML scaffolds around an image.  Anyway, this has the advantage
 of following standards and also allowing the user the freedom to move the
 audio stream and slides independently.

I like the idea of using MP3 but not being MP3 savy wan't sure that clients
support streaming MP3. Also the encoding would have to be at less than
33kbps so it will play properly over modem lines. The slide/chapter info
could be encoded into the ID3 tags and users could request any slide from
the playlist. I'll have to dig a bit into Mike Oliphant's Grip or LAME to do
the encoding. I am wondering if icecast software would work well for this
application.

bakki


Bakki Kudva
Navaco
(Electronic Document Management Solutions)
phone: (814) 833-2592
fax:  (603) 947-5747
http://www.navaco.com/




Re: Sharing memory between Apache processes

2000-04-04 Thread Matt Carothers



On Tue, 4 Apr 2000 [EMAIL PROTECTED] wrote:

 A good package for this is IPC::Shareable.  You can store info in semaphores
 and share it between processes.
 
 Except that I don't think you can you use shared memory (the semaphores are 
 just flags) across multiple web servers, and I have been wrong before.
 
You can share memory segments between web servers with no trouble.
Depending on how you implement the storage, you may run into difficulties
with your operating system, though.  For instance, all the BSD derivatives 
I've investigated (FreeBSD, OpenBSD, and BSDi so far) only have 32 shared
segments and 10 semaphores compiled into the kernel by default.  In
contrast, the Linux kernel ships with 128 of each.

- Matt




Re: Bug#61231: mod_perl segfaults child-processes in combination with XML::Parser::Expat

2000-04-04 Thread Daniel Jacobowitz

[mod_perl people - any comment?  Please keep the Cc: list to the Debian
bug tracking system.]

On Tue, Mar 28, 2000 at 12:50:45PM +0200, [EMAIL PROTECTED] wrote:
 Package: libapache-mod-perl
 Version: 1.21.2309-1
 Severity: Important
 
 When using the XML::Parser::Expat under mod_perl, this causes segmentation
 faults (quite random?) in the child-processes of httpd.
 The error message in the error.log of apache is:
 "[notice] child pid 28177 exit signal Segmentation fault (11)"
 
 This can be repreduced with the following script,
 run under mod_perl, just wait a while, and monitor the error.log (takes a
 while, multiple request will speed up):

It's very random, but I can reproduce this.  However, I can also
reproduce it with apache-perl (statically linked).  It seems extremely
unlikely to me that this is the DSO code's fault, therefore.

Here's a backtrace:


(gdb) bt
#0  0x400f8b59 in free () from /lib/libc.so.6
#1  0x400f89ed in free () from /lib/libc.so.6
#2  0x4026eb7a in Perl_safefree () from /usr/lib/apache/1.3/mod_perl.so
#3  0x4027fcb9 in Perl_sv_setsv () from /usr/lib/apache/1.3/mod_perl.so
#4  0x402782dc in Perl_pp_sassign () from /usr/lib/apache/1.3/mod_perl.so
#5  0x402a8440 in Perl_runops_standard () from /usr/lib/apache/1.3/mod_perl.so
#6  0x4024c0a9 in perl_call_sv () from /usr/lib/apache/1.3/mod_perl.so
#7  0x4023201e in perl_call_handler () from /usr/lib/apache/1.3/mod_perl.so
#8  0x402318cc in perl_run_stacked_handlers ()
   from /usr/lib/apache/1.3/mod_perl.so
#9  0x402302cf in perl_handler () from /usr/lib/apache/1.3/mod_perl.so
#10 0x8053e64 in ap_invoke_handler (r=0x826e23c) at http_config.c:508
#11 0x80625ec in process_request_internal (r=0x826e23c) at http_request.c:1214
#12 0x8062648 in ap_process_request (r=0x826e23c) at http_request.c:1230
#13 0x805c439 in child_main (child_num_arg=0) at http_main.c:4122
#14 0x805c5cc in make_child (s=0x8099c24, slot=0, now=954874778)
at http_main.c:4235
#15 0x805c6e9 in startup_children (number_to_start=5) at http_main.c:4317
#16 0x805cb9b in standalone_main (argc=2, argv=0xbdc4) at http_main.c:4605
#17 0x805d24d in main (argc=2, argv=0xbdc4) at http_main.c:4933


Very interesting.  I'll look at this further.



Dan

/\  /\
|   Daniel Jacobowitz|__|SCS Class of 2002   |
|   Debian GNU/Linux Developer__Carnegie Mellon University   |
| [EMAIL PROTECTED] |  |   [EMAIL PROTECTED]  |
\/  \/



Re: authDBI connect on init?

2000-04-04 Thread Leslie Mikesell

According to Adam Gotheridge:
 Is there anyway to get AuthDBI to connect on initialization of the web server
 like you can with "DBI-connect_on_init(...)"?

AuthDBI uses DBI, so all you have to do is use Apache::DBI
and make sure the connect string is exactly the same.

  Les Mikesell
   [EMAIL PROTECTED]



Re: [mod_perl audio tutorials]

2000-04-04 Thread Jeffrey W. Baker

On Tue, 4 Apr 2000, Bakki Kudva wrote:

 Jeffrey W. Baker wrote on Tuesday, April 04, 2000 12:04 PM:
 
  Consider just this once that HTML is not the preferred way to deliver this
  kind of content.  Perhaps the tutorial could be in the form of an MP3
  file, with instructions to turn to the next slide periodically.  The slide
  could be HTML scaffolds around an image.  Anyway, this has the advantage
  of following standards and also allowing the user the freedom to move the
  audio stream and slides independently.
 
 I like the idea of using MP3 but not being MP3 savy wan't sure that clients
 support streaming MP3. Also the encoding would have to be at less than
 33kbps so it will play properly over modem lines. The slide/chapter info
 could be encoded into the ID3 tags and users could request any slide from
 the playlist. I'll have to dig a bit into Mike Oliphant's Grip or LAME to do
 the encoding. I am wondering if icecast software would work well for this
 application.

For voice, you can use very low bitrates with MP3 encoding and still get
acceptable output.  The other nice thing about MP3 is that the clients
don't HAVE to stream it.  They can darn well save it locally if that is
more convenient.  However, all clients that I have used do support
streaming.

-jwb




RE: Re: Segfault on DBI-Connect

2000-04-04 Thread Valter Mazzola



From: James G Smith [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
CC: Valter Mazzola [EMAIL PROTECTED], Doug MacEachern 
[EMAIL PROTECTED]
Subject: Re: Segfault on DBI-Connect
Date: Mon, 03 Apr 2000 00:13:14 -0500

Doug MacEachern [EMAIL PROTECTED] wrote:
 On Sat, 1 Apr 2000, Valter Mazzola wrote:
 
  i've a mod_perl script that connect to a mysql db, but sometimes it 
segfault
  on DBI-connect. i'm using Apache::Registry  Apache::DBI for 
persistend db
  connection, use strict and the script it's a package. i've read the 
docs but
  probably i'm missing something.
 
 if you could provide info the SUPPORT doc asks for (including 
stacktrace),
 that would help.

Definitely.  I remember running into something like this before.
I searched the list archives, but couldn't find it -- reminds me
to make the subject meaningful :)

If I remember correctly, this was a problem that could be traced
to the DBD::mysql module.  Specifically, the DBD::mysql::db::_login
call (lines 104-160 of DBD/mysql.pm).  But it's been at least half
a year since then, so take this as a rough guide as to where you
might want to look.
+
thank you for your answer, i'll look into

A NOTE:
Will be wonderful to have more mod_perl debug info when similar  events 
happens without to becoming too crazy with
setting up a decent debug ... specially for newbies .. like me.

it's difficult to do a thing like Velocigen, instead of having mod_perl 
crashing apache when things goes wrong (due to inexperienced people...like 
me?)

__
Get Your Private, Free Email at http://www.hotmail.com




Re: Bug#61231: mod_perl segfaults child-processes in combination with XML::Parser::Expat

2000-04-04 Thread Daniel Jacobowitz

Something, presumably XML::Parser::Expat, is corrupting malloc's and
perl's data structures randomly.  Running under MALLOC_CHECK_=2 has a
high probability of showing this.  It also occasionally cores in
Perl_sv_upgrade - the SV is hopelessly mangled:

(gdb) p *sv
$17 = {sv_any = 0x83e58955, sv_refcnt = 2203260140, sv_flags = 821518397}
(gdb) where
#0  0x402a5b95 in Perl_sv_upgrade (sv=0x4029d868, mt=136780768) at sv.c:823
#1  0x402a5810 in Perl_sv_upgrade (sv=0x4029d868, mt=136780768) at sv.c:732
#2  0x4029d93d in Perl_pp_or () at pp_hot.c:235
#3  0x4025c266 in Perl_moreswitches (s=0x81a14a4 "PZ\n\b\001") at perl.c:1641
#4  0x4024061e in perl_create_request_config ()
   from /usr/lib/apache/1.3/mod_perl.so
#5  0x4023fcf1 in perl_config_getch () from /usr/lib/apache/1.3/mod_perl.so
#6  0x4023de1f in perl_fixup () from /usr/lib/apache/1.3/mod_perl.so
#7  0x8053e64 in ap_invoke_handler (r=0x8289a7c) at http_config.c:508
#8  0x80625ec in process_request_internal (r=0x8289a7c) at http_request.c:1214
#9  0x8062648 in ap_process_request (r=0x8289a7c) at http_request.c:1230
#10 0x805c439 in child_main (child_num_arg=0) at http_main.c:4122
#11 0x805c5cc in make_child (s=0x8099c2c, slot=0, now=954878307)
at http_main.c:4235
#12 0x805c6e9 in startup_children (number_to_start=5) at http_main.c:4317
#13 0x805cb9b in standalone_main (argc=2, argv=0xbdb4) at http_main.c:4605
#14 0x805d24d in main (argc=2, argv=0xbdb4) at http_main.c:4933



However, I don't think that's a reliable stack trace.  The stack seems damaged.


On Tue, Mar 28, 2000 at 12:50:45PM +0200, [EMAIL PROTECTED] wrote:
 Package: libapache-mod-perl
 Version: 1.21.2309-1
 Severity: Important
 
 When using the XML::Parser::Expat under mod_perl, this causes segmentation
 faults (quite random?) in the child-processes of httpd.
 The error message in the error.log of apache is:
 "[notice] child pid 28177 exit signal Segmentation fault (11)"
 
 This can be repreduced with the following script,
 run under mod_perl, just wait a while, and monitor the error.log (takes a
 while, multiple request will speed up):
 
 --- cut here -
 #!/usr/bin/perl -w
 
 use XML::Parser::Expat;
 use strict;
 
 main();
 
 # bug creater under mod_perl, just results in some simple html
 
 sub main()
 {
 my $problemXP = new XML::Parser::Expat;
 $problemXP-setHandlers(Start = \Start, End = \End, Char = \Text);
 print "Content-type: text/html\n\n";
 $problemXP-parse("html\nmeta http-equiv='refresh' content='1'/\nbodysome 
text/body\n/html\n");
 $problemXP-release();
 }
 
 sub Start($$) {
 my $caller = shift;
 my $tag = shift;
 print "" . $tag;
 print " " . $_[0] . "='" . $_[1] . "'" if $#_ ge 1;  # add attributes
 print " " . $_[2] . "='" . $_[3] . "'" if $#_ ge 3;  # add attributes
 print "\n" unless $tag =~ /\s/;
 }
 
 sub End($$) {
 my $caller = shift;
 my $etag = shift;
 print "/" . $etag . "\n" unless $etag =~ /\s/;
 }
 
 sub Text($$) {
 my $caller = shift;
 my $text = shift;
 print $text . "\n" unless $text =~ /\s/;
 }
 --- cut here -
 
 
 I guess this is caused by a memory-leak or a problem related to loading
 Perl *.so (see bug #48069)
 
 Related packages (frozen/potato, 27 march 2000):
 - libapache-mod-perl  1.21.2309-1
 - apache-common   1.3.9-12
 - apache-ssl  1.3.9.10 + 1.37-1
 - libxml-parser-perl  2.27-2
 - perl-5.005  5.005.03-6
 - perl-5.005-base 5.005.03-6
 - libmime-base64-perl 2.11-2
 - libdevel-symdump-perl   2.00-4
 - data-dumper 2.09-1
 - liburi-perl 1.04-2
 - libc6   2.1.3-7
 - libdb2  2.4.14-9
 - libgdbmg1   1.7.3-26.2
 
 kernel 2.2.14 (i586 and i686)
 libc-2.1.3.so
 
 * ( didn't encouter with slink, but i am not sure, used CPAN
 instead of libxml-parser-perl.deb...)
 
 
 
 used configuration:
 
 httpd.conf:
 LoadModule config_log_module /usr/lib/apache/1.3/mod_log_config_ssl.so
 LoadModule mime_module /usr/lib/apache/1.3/mod_mime_ssl.so
 LoadModule negotiation_module /usr/lib/apache/1.3/mod_negotiation.so
 LoadModule status_module /usr/lib/apache/1.3/mod_status.so
 LoadModule includes_module /usr/lib/apache/1.3/mod_include.so
 LoadModule autoindex_module /usr/lib/apache/1.3/mod_autoindex.so
 LoadModule dir_module /usr/lib/apache/1.3/mod_dir.so
 LoadModule cgi_module /usr/lib/apache/1.3/mod_cgi.so
 LoadModule userdir_module /usr/lib/apache/1.3/mod_userdir.so
 LoadModule alias_module /usr/lib/apache/1.3/mod_alias.so
 LoadModule rewrite_module /usr/lib/apache/1.3/mod_rewrite.so
 LoadModule access_module /usr/lib/apache/1.3/mod_access.so
 LoadModule auth_module /usr/lib/apache/1.3/mod_auth_ssl.so
 LoadModule expires_module /usr/lib/apache/1.3/mod_expires.so
 LoadModule unique_id_module /usr/lib/apache/1.3/mod_unique_id.so
 LoadModule setenvif_module /usr/lib/apache/1.3/mod_setenvif.so
 

Apache::DBI problem..

2000-04-04 Thread Niral Trivedi

All..

I am new to mod_perl so, please forgive me if this questions sounds
stupid..

I have successfully installed mod_perl 1.22 and Apache 1.3.12 under
BSD/OS BSDI 3.1 And able to run normal cgi script... But problem occurs
while I am trying to run script with DBI..

I have successfully installed Apache::DBI from CPAN site which is
version 0.87

When I am trying to start Apache after installing Apache::DBI, I am
getting following errors:
--
Syntax error on line 935 of
/zen/home/niral/Apache/apache/conf/httpd.conf:
Can't load '/usr/local/lib/perl5/site_perl/i386-bsdos/auto/DBI/DBI.o'
for module DBI: can't resolve undefined symbols: Inappropriate file type
or format at /usr/local/lib/perl5/i386-bsdos/5.00401/DynaLoader.pm line
155.

 at /usr/local/lib/perl5/site_perl/DBI.pm line 158
BEGIN failed--compilation aborted at
/usr/local/lib/perl5/site_perl/DBI.pm line 158.
BEGIN failed--compilation aborted at
/usr/local/lib/perl5/site_perl/Apache/DBI.pm line 4.

./apachectl start: httpd could not be started
---
following is the snippets from my httpd.conf file:
---
Alias /perl/  /zen/home/niral/Apache/apache/test/
#PerlRequire /zen/home/niral/Apache/apache/conf/startup.pl
PerlModule Apache::DBI ### This is line 935

Location /perl
SetHandler  perl-script
PerlHandler Apache::Registry
PerlSendHeader On
Options ExecCGI
/Location

Location /perl-status
SetHandler  perl-script
PerlHandler Apache::Status
/Location
]
I have tried to do this using startup.pl file as well.. but getting same
error.. 

After searching different mailing lists, I have found that this is very
common problem for users on RedHat Linux... But couldn't find anything
for BSDI 

I also found one link to
http://perl.apache.org/guide/troubleshooting.html#Can_t_load_auto_DBI_DBI_so_
but don't know how to check that thing?? I mean how can you check that
all modules are compiled with same perl version

Please give me some idea on this..

Thanks in advance for your help..

Niral
-- 
Regards...

Niral K. Trivedi, Planet Access Network Inc.
Email : [EMAIL PROTECTED]
Phone : 973-691-4704 x134



panic: POPSTACK, Callback called exit and Apache::Session's die seems to be resurrecting itself

2000-04-04 Thread sang

Hi,

Can someone help me out here?

Apache_1.3.12
mod_perl 1.21_03
Apache-Session-1.03 ( Database and deamon locker for storing and locking
sessions )

-- code snippet --
sub getSESSION {
my $self = shift;
my $sid = shift;
my %SESSION;
eval {tie %SESSION, 'Apache::Session::DBI', $sid;} if ($sid);
if (! $sid || $@ ) {
eval {tie %SESSION, 'Apache::Session::DBI', undef;};
}
return \%SESSION;
}

So if I pass what I know to be a bogus non-null session id (no longer a
valid id in the database) it tries the first eval. Based on my understanding
of the Apache::Session docs, it should die (shouldn't it?), which should
result in $@ being non-null and the first eval should return undef. Then I
should be able to call another eval block requesting a new session.

Is this right and if so, why am I getting the following messages in the log
file?

panic: POPSTACK
Callback called exit.

for each httpd process.

I looked at the eval documentation and I've tried using Carp, localizing
$SIG{__DIE__) within the eval, but at this point I'm utterly confused and am
not sure what is really the cause of the problem.  I think that it has
something to do with the way perl's die function is being called within this
eval because I don't have this problem when the session id I pass is a valid
one.

Help.

thank you,
Sang




Re: modperl 1.22 and NameWithVirtualHost not working properly

2000-04-04 Thread Doug MacEachern

On Tue, 4 Apr 2000, Jason Terry wrote:

 But, I don't want the virtual host information included.  ALL of my scripts on 
this web server are GLOBAL and in order to save
 memory I only want to have one copy loaded and shared for multiple virtual hosts.
 
 It used to be that if you set
 $Apache::Registry::NameWithVirtualHost = 0;
 
 Then mod_perl would ignore the virtual host an use the same script for all users.  
However with 1.22 it doesn't seem to be doing
 that anymore.

you can get the old behavior by backing out the 1.22 change, with this
patch.  i'll give this problem some attention for 1.23, which i plan to
release soonish.

--- mod_perl.c  2000/03/04 00:34:21 1.99
+++ mod_perl.c  2000/03/02 20:21:03 1.98
@@ -782,8 +782,10 @@
 SAVETMPS;
 
 if((nwvh = ApachePerlRun_name_with_virtualhost())) {
-   SAVESPTR(nwvh);
-   sv_setiv(nwvh, r-server-is_virtual);
+   if(!r-server-is_virtual) {
+   SAVESPTR(nwvh);
+   sv_setiv(nwvh, 0);
+   }
 }
 
 if (gv) {





RE: Segmentation Fault: RedHat 6.[01] / Apache 1.3.12 / mod_perl 1.22 / perl 5.005_03 / IE 5

2000-04-04 Thread Doug MacEachern

On Mon, 3 Apr 2000, Vivek Khera wrote:
 
 What if someone sets PerlFreshRestart No and has DSO enabled?  Then
 they don't get what they think they do.

right, the docs should be updated to reflect that.





Custom $SIG{__DIE__} in an object...

2000-04-04 Thread Russell D. Weiss

Hey guys,

This relates somewhat to the message that I sent last night / early this
morning.

I have a custom $SIG{__DIE__} handler defined within an object.  Upon a die,
this handler runs the object's DESTROY method.  As I stated in my earlier
message, I'm doing this because the object contains an Apache::Session
object.  Sometimes the calling script would die and the wrapper object which
holds a Session object was not undef'd.  Because of this, the Session
wouldn't go out of scope, and the session would stay locked forever (and
Apache processes 'hang' because they sit there waiting for the lock to go
away, but it doesn't).

Anyway, I realize now that when the calling script does NOT die, my object
is now not undef'd, even if I have an explicit undef at the end of the
script.  Why is this?  I figure that it must be because there's still a
reference to the object that's in scope and 'alive'... this reference is
within the custom sighandler...  After all, I set $SIG{__DIE__} to a sub
that contains $self references.

What I'm doing is setting $main::SIG{'__DIE__'} to this anonymous
subroutine...  I'm pretty sure that this sighandler is also sticking with
the process that it runs on.  For example, I'll run the script once...
later, a script that does not use this 'wrapper' object dies and calls the
custom sighandler... Why should it?  Shouldn't the sighandler revert to
CORE::die() at the end?  On that note, I even tried changing DESTROY (of the
wrapper object) to re-set the sighandler to the CORE::die() function.  Of
course this doesn't work because DESTROY is never even being executed :-(.

Any ideas?  These scoping issues can be tricky...

Thanks,
Russ

Russell Weiss
Founder and Technical Manager
InfoRelay Online Systems, Inc.
http://www.InfoRelay.net/





Re: Apache::Filter headers

2000-04-04 Thread Doug MacEachern

 does mod_perl automatically send headers for PerlHandler routines?  I know
 when to use it with Registry stuff, but as I move to handlers for lots of
 stuff I see that PerlHandlers seem ok without it.

no, mod_perl will only send headers (by calling ap_send_http_header) if
you have PerlSendHeader On.





Re: [mod_perl audio tutorials]

2000-04-04 Thread Stas Bekman

On Tue, 4 Apr 2000, Bakki Kudva wrote:

 Jeffrey W. Baker wrote on Tuesday, April 04, 2000 12:04 PM:
 
  Consider just this once that HTML is not the preferred way to deliver this
  kind of content.  Perhaps the tutorial could be in the form of an MP3
  file, with instructions to turn to the next slide periodically.  The slide
  could be HTML scaffolds around an image.  Anyway, this has the advantage
  of following standards and also allowing the user the freedom to move the
  audio stream and slides independently.
 
 I like the idea of using MP3 but not being MP3 savy wan't sure that clients
 support streaming MP3. Also the encoding would have to be at less than
 33kbps so it will play properly over modem lines. The slide/chapter info
 could be encoded into the ID3 tags and users could request any slide from
 the playlist. I'll have to dig a bit into Mike Oliphant's Grip or LAME to do
 the encoding. I am wondering if icecast software would work well for this
 application.

See the last TPJ article by Lincoln Stein about mp3/streaming/icecast and
mod_perl.

Grip doesn't do the encoding it's merely a wav reader plus a nice
interface to the encoding tools. 

__
Stas Bekman | JAm_pH--Just Another mod_perl Hacker
http://stason.org/  | mod_perl Guide http://perl.apache.org/guide/ 
mailto:[EMAIL PROTECTED]  | http://perl.orghttp://stason.org/TULARC/
http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org
--




Re: 1.22_01-dev: Modification of a read-only value ...

2000-04-04 Thread Doug MacEachern

 No, this doesn't fixed the problem. I applied your patch to current cvs

hmm, does the problem go away if you add this to httpd.conf:

PerlModule Apache::Table

?  that's my only suspect, since the first time you access $r-headers_in
it will 'require Apache::Table', which might confuse the stack pointer.





RE: Segmentation Fault: RedHat 6.[01] / Apache 1.3.12 / mod_perl 1.22 / perl 5.005_03 / IE 5

2000-04-04 Thread Vivek Khera

 "DM" == Doug MacEachern [EMAIL PROTECTED] writes:

DM On Mon, 3 Apr 2000, Vivek Khera wrote:
 What if someone sets PerlFreshRestart No and has DSO enabled?  Then
 they don't get what they think they do.

DM right, the docs should be updated to reflect that.

Why not disable this command similarly to how the SSI command is disabled
when we go DSO?






Re: Another Error in Apache::ASP and Perl 5.6.0

2000-04-04 Thread Yu Di

Hi, I did compile it statically. But currently for my program, I always
get such errors.

My Apache is 1.3.12, Perl is 5.6.0, mod_perl is 1.22.

The relevant part in my httpd.conf is:

Files ~ "\.mpl$"
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
/Files

Directory /home/myaccount/public_html
Files ~ "\.htm$"
SetHandler perl-script
PerlHandler Apache::ASP
PerlSetVar Global /tmp
/Files
/Directory

Files ~ "\.asp$"
SetHandler perl-script
PerlHandler Apache::ASP
PerlSetVar Global /tmp
/Files


My program is:
%
unless ($Application-{Config})
{
open CONFIGURE, "my.conf" or die "Can't open
configuration
.";
my $config = undef; 
while (CONFIGURE)
{
my ($name, $value) = ($_ =~ /(\w+)\s*=\s*(.+)$/);
$config-{$name} = $value;
$Application-{Config} = $config;
}
close CONFIGURE;
}
%
!--#include file="homepage.htm"--

This program has been tested under Perl5.005_03, Apache 1.3.11, mod_perl
1.21 on another machine. my.conf is a configuration file for this program. 

Lynx will report "Alert!: Unexpected network read error; connection
aborted." while I try to connect to it, and the server error log will show
a "[Tue Apr  4 16:36:22 2000] [notice] child pid 964 exit signal
Segmentation fault (11)".

I have changed ASP.pm as I wrote last time, for if I did not do so, I will
get other error messages.

So is it that Apache::ASP is currently not compatible with Perl 5.6?

Di, Yu
4.4
~
On Mon, 3 Apr 2000, Joshua Chamas wrote:

 Yu Di wrote:
  
  Hi, after I reported the last error, I found that Apache::ASP was still
  not working correctly, as when I try to access an ASP file, sometimes the
  server will report
  "[notice] child pid 561 exit signal Segmentation fault (11)"
  and the file will not be able to be accessed.
  
  Is this an error of Apache::ASP?
  
  Di, Yu
  4.2
 
 
 No idea what the problem is, as I have not seen this before.
 If this is linux, try to statically compile your apache/modperl,
 no DSO, LoadModule stuff.
 
 -- Joshua
 _
 Joshua Chamas Chamas Enterprises Inc.
 NodeWorks  free web link monitoring Huntington Beach, CA  USA 
 http://www.nodeworks.com1-714-625-4051
 




Re: Error in Apache::ASP with Perl 5.6.0

2000-04-04 Thread Yu Di

Hi, there was an error with my mailbox and I can't open your mail and test
the patch, could you please send it again? Thank you!

Di, Yu
4.4




Re: [ANNOUNCE] Apache::DebugInfo_0.02

2000-04-04 Thread Ken Williams

[EMAIL PROTECTED] (Geoffrey Young) wrote:
sorry for the inconvienence (but probably nobody is using it anyway :)  To
make up for it, pnotes now supports complex data structures via Data::Dumper

Is this really true?  I thought pnotes supported complex data structures simply
because it can store any scalar, which can be a reference to complex structures
or whatever.  No Data::Dumper needed.  

But I haven't read the source to see whether this is actually true.


  ------
  Ken Williams Last Bastion of Euclidity
  [EMAIL PROTECTED]The Math Forum





Re: Bug#61231: mod_perl segfaults child-processes in combinationwith XML::Parser::Expat

2000-04-04 Thread Doug MacEachern

On Tue, 4 Apr 2000, Daniel Jacobowitz wrote:

 [mod_perl people - any comment?  Please keep the Cc: list to the Debian
 bug tracking system.]
 
  When using the XML::Parser::Expat under mod_perl, this causes segmentation
  faults (quite random?) in the child-processes of httpd.
  The error message in the error.log of apache is:
  "[notice] child pid 28177 exit signal Segmentation fault (11)"

yeah, try configuring Apache with:
RULE_EXPAT=no

otherwise, the symbols in XML::Parser clash with apache's.  i've suggested
several times that the XML::Parser author should consider making those
symbols static or use a different prefix, but no idea if that's happened
or not.




Re: Segfault on DBI-Connect

2000-04-04 Thread richard

I've been seeing the same segfault-on-connect problem with Apache 1.2.12
+ mod_perl 1.22 + DBI 1.13 + Msql-Mysql-modules 1.2211.  The segfault is
due to a null first argument being passed to mysql_real_connect().

Running Apache with a -X argument yields the following backtrace when my
mod_perl module does a DBI-connect (str, username, passwd, { options }).
Note the null mysql argument 
|
V
#0  0x80ef5b7 in mysql_real_connect (mysql=0x0, 
host=0x8a99db8 "hostname.brown.edu", user=0x8a9b550 "username", 
passwd=0x8a9b568 "password", db=0x8a99e40 "databasename", port=3306, 
unix_socket=0x0, client_flag=0) at libmysql.c:1125
#1  0x402d01fd in mysql_dr_connect ()
   from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so
#2  0x402d0540 in _MyLogin ()
   from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so

The mysql_real_connect routine does a set_sigpipe(mysql), which triggers
the segfault.

This problem has only come up since I upgraded Apache/mod_perl from
1.3.9/1.21 to 1.3.12/1.22.

Richard Goerwitz




panic: POPSTACK, Callback called exit and Apache::Session's die seems to be resurrecting itself

2000-04-04 Thread Sang Han

Hi,

Can someone help me out here?

Apache_1.3.12
mod_perl 1.21_03
Apache-Session-1.03 ( Database and deamon locker for storing and locking
sessions )

-- code snippet --
sub getSESSION {
my $self = shift;
my $sid = shift;
my %SESSION;
eval {tie %SESSION, 'Apache::Session::DBI', $sid;} if ($sid);
if (! $sid || $@ ) {
eval {tie %SESSION, 'Apache::Session::DBI', undef;};
}
return \%SESSION;
}

So if I pass what I know to be a bogus non-null session id (no longer a
valid id in the database) it tries the first eval. Based on my understanding
of the Apache::Session docs, it should die (shouldn't it?), which should
result in $@ being non-null and the first eval should return undef. Then I
should be able to call another eval block requesting a new session.

Is this right and if so, why am I getting the following messages in the log
file?

panic: POPSTACK
Callback called exit.

for each httpd process.

I looked at the eval documentation and I've tried using Carp, localizing
$SIG{__DIE__) within the eval, but at this point I'm utterly confused and am
not sure what is really the cause of the problem.  I think that it has
something to do with the way perl's die function is being called within this
eval because I don't have this problem when the session id I pass is a valid
one.

Help.

thank you,
Sang




Re: Another Error in Apache::ASP and Perl 5.6.0

2000-04-04 Thread Doug MacEachern

On Tue, 4 Apr 2000, Yu Di wrote:

 Hi, I did compile it statically. But currently for my program, I always
 get such errors.
 
 My Apache is 1.3.12, Perl is 5.6.0, mod_perl is 1.22.
 
 The relevant part in my httpd.conf is:

any difference if you pre-load:

PerlModule Apache::Registry Apache::ASP

?




[slightly OT] redhat linux 6.1

2000-04-04 Thread Bryan McGuire



Has anyone built RPMsfor redhat 6.1 with 
apache/1.3.9 and mod_perl 1.2.2 where DSO actually works. If not, I would like 
to know how to do it.It's a shame that redhat linux 6.1is 
shipping with a broken mod_perl, and I believe it would help the cause for 
mod_perlif linux 6.1 users could simply download an easy to use, drop-in 
replacement for the apparently broken mod_perl-1.21-2.i386.rpm 



Re: Error in Apache::ASP with Perl 5.6.0

2000-04-04 Thread Doug MacEachern

On Tue, 4 Apr 2000, Yu Di wrote:

 Hi, there was an error with my mailbox and I can't open your mail and test
 the patch, could you please send it again? Thank you!

sure..

--- src/modules/perl/mod_perl.c 2000/03/30 19:34:13 1.110
+++ src/modules/perl/mod_perl.c 2000/03/30 19:35:25
@@ -1557,6 +1557,7 @@
if(stash) /* check again */
is_method = perl_handler_ismethod(stash, method);
 #endif
+   SPAGAIN; /* reset stack pointer after require() */
}

if(!is_method  !defined_sub) {






Re: Another Error in Apache::ASP and Perl 5.6.0

2000-04-04 Thread Yu Di

I added that before my "Files ~ "\.mpl$"", no change.
BTW, the Apache::Registry test program always worked correctly.

Di, Yu
4.4

On Tue, 4 Apr 2000, Doug MacEachern wrote:

 On Tue, 4 Apr 2000, Yu Di wrote:
 
  Hi, I did compile it statically. But currently for my program, I always
  get such errors.
  
  My Apache is 1.3.12, Perl is 5.6.0, mod_perl is 1.22.
  
  The relevant part in my httpd.conf is:
 
 any difference if you pre-load:
 
 PerlModule Apache::Registry Apache::ASP
 
 ?
 
 




Re: 1.22_01-dev: Modification of a read-only value ...

2000-04-04 Thread Oleg Bartunov

On Tue, 4 Apr 2000, Doug MacEachern wrote:

 Date: Tue, 4 Apr 2000 14:27:28 -0700 (PDT)
 From: Doug MacEachern [EMAIL PROTECTED]
 To: Oleg Bartunov [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: 1.22_01-dev: Modification of a read-only value ...
 
  No, this doesn't fixed the problem. I applied your patch to current cvs
 
 hmm, does the problem go away if you add this to httpd.conf:
 
 PerlModule Apache::Table

Yes ! It works now after I add Apache::Table to my startup.pl

 
 ?  that's my only suspect, since the first time you access $r-headers_in
 it will 'require Apache::Table', which might confuse the stack pointer.
 

Got that, why it worked before :0)

Oleg

 

_
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: [EMAIL PROTECTED], http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83




RE: Set DocumentRoot from modperl

2000-04-04 Thread Karyn Ulriksen

Which handler would be appropriate to do the cleanup on this?

-Original Message-
From: Doug MacEachern [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 02, 2000 10:39 PM
To: Serge Serge Barbosa Da Torre
Cc: [EMAIL PROTECTED]
Subject: Re: Set DocumentRoot from modperl


there have been several requests for the ability to modify the
DocumentRoot, i reckon it's about time we allow that.

caveats:
if you want the DocumentRoot to be reset to the original value after the
request is over, you'll have to do that yourself, something like:
my $old_docroot = $r-document_root;
$r-register_cleanup(sub { shift-document_root($old_docroot) });

the lifetime of conf-ap_document_root is longer than that of r-pool, so
it can't be used to allocate the string copy.
we could use the server pool, which isn't destroyed until the server is
restarted, but then each time you set document_root, the server would
"leak" memory.
to workaround, the new document_root is saved in a Perl variable
$Apache::Server::DocumentRoot

--- src/modules/perl/Apache.xs  2000/04/03 04:48:52 1.92
+++ src/modules/perl/Apache.xs  2000/04/03 05:36:56
@@ -783,8 +783,26 @@
 Apacher
 
 const char *
-document_root(r)
+document_root(r, ...)
 Apacher
+
+PREINIT:
+core_server_config *conf;
+
+CODE:
+conf = (core_server_config *)
+  get_module_config(r-server-module_config, core_module);
+
+RETVAL = conf-ap_document_root;
+
+if (items  1) {
+SV *doc_root = perl_get_sv("Apache::Server::DocumentRoot", TRUE);
+sv_setsv(doc_root, ST(1));
+conf-ap_document_root = SvPVX(doc_root);
+}
+
+OUTPUT:
+RETVAL



Re: panic: POPSTACK, Callback called exit and Apache::Session'sdie seems to be resurrecting itself

2000-04-04 Thread Matt Carothers



On Tue, 4 Apr 2000, Sang Han wrote:

 Hi,
 
 Can someone help me out here?
... 
 panic: POPSTACK
 Callback called exit.

Something in your module is calling Perl's exit() instead of $r-exit.

http:[EMAIL PROTECTED]

- Matt




Re: [slightly OT] redhat linux 6.1

2000-04-04 Thread Buddy Lee Haystack

I haven't built any rpms myself, but I am using Redhat v6.1, Apache v1.3.9-8, perl 
v5.00503-6, and mod_perl v1.21-2. They were all downloaded from RedHat's FTP site as 
rpms, and worked fine after installation. I think many people encounter difficulty in
correctly modifying the httpd.conf file after installing mod_perl. 

If you wish, I can send you my httpd.conf file which also contains entries for the 
Apache DBI module.

You may also want to have a look at:
http://perl.apache.org/guide/index.html




 Bryan McGuire wrote:
 
 Has anyone built RPMs for redhat 6.1 with apache/1.3.9 and mod_perl 1.2.2 where DSO 
actually works. If not, I would like to know how to do it.  It's a shame that redhat 
linux 6.1 is shipping with a broken mod_perl, and I believe it would help the cause
 for mod_perl if linux 6.1 users could simply download an easy to use, drop-in 
replacement for the apparently broken mod_perl-1.21-2.i386.rpm



Turning off experimental threads in mod_perl

2000-04-04 Thread Chris Mason

How do I keep mod_perl from trying to use the experimental thread
feature in perl, even when I built perl with that option?  Is this
possible?  See the build error that I get below.

I'm using mod_perl 1.22, perl 5.005_63, and apache 1.3.12.

Please cc any replies to me, as I don't regularly read this list. 

Thanks for making cool stuff.

-c

I get the following build error:
cc -I. -I../../include -I../../include/regex
-I../../include/.././os/unix -DLINUX=2 -DUSE_HSREGEX -DUSE_EXPAT
-I../lib/expat-lite -DNO_DL_NEEDED -DMOD_PERL  `/usr/local/bin/perl
-MExtUtils::Embed -e ccopts` -DNO_PERL_DISPATCH  
-DNO_PERL_POST_READ_REQUEST -DNO_PERL_TRANS -DNO_PERL_HEADER_PARSER
-DNO_PERL_ACCESS -DNO_PERL_AUTHEN -DNO_PERL_AUTHZ -DNO_PERL_TYPE 
-DNO_PERL_FIXUP  -DNO_PERL_LOG  -DNO_PERL_INIT -DNO_PERL_CLEANUP
-DNO_PERL_RESTART -DNO_PERL_STACKED_HANDLERS -DNO_PERL_SECTIONS
-DNO_PERL_METHOD_HANDLERS -DNO_PERL_SSI -DNO_PERL_DIRECTIVE_HANDLERS 
-DMOD_PERL_VERSION=\"1.22\"  -I./os/unix -I../../include -c
mod_perl.c -o mod_perl.o
mod_perl.c: In function `perl_call_handler':
mod_perl.c:1627: `thr' undeclared (first use in this function)
mod_perl.c:1627: (Each undeclared identifier is reported only once
mod_perl.c:1627: for each function it appears in.)
make[3]: *** [mod_perl.o] Error 1
make[2]: *** [all] Error 1
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/usr/local/src/apache_1.3.12/src'
make: *** [apache_httpd] Error 2


Some information about my environment:

cmason@crisp:/usr/local/src/perl5.005_63 perl -v

This is perl, version 5.005_63 built for i686-linux-thread

Copyright 1987-1999, Larry Wall

Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5.0 source
kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'.  If you have access to
the
Internet, point your browser at http://www.perl.com/, the Perl Home
Page.

cmason@crisp:/usr/local/src/perl5.005_63 perl -V
Summary of my perl5 (revision 5.0 version 5 subversion 63)
configuration:
  Platform:
osname=linux, osvers=2.2.14, archname=i686-linux-thread
uname='linux crisp 2.2.14 #9 tue mar 28 12:36:33 est 2000 i686
unknown '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=define useperlio=undef d_sfio=undef
use64bits=undef usemultiplicity=undef
  Compiler:
cc='cc', optimize='-O5', gccversion=egcs-2.91.66 19990314/Linux
(egcs-1.1.2 
release)
cppflags='-D_REENTRANT -Dbool=char -DHAS_BOOL -fno-strict-aliasing
-I/usr/lo
cal/include'
ccflags ='-D_REENTRANT -Dbool=char -DHAS_BOOL -fno-strict-aliasing
-I/usr/lo
cal/include'
stdchar='char', d_stdstdio=define, 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 -lpthread -lc -lposix -lcrypt
libc=/lib/libc-2.1.2.so, 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): 
  Compile-time options: USE_THREADS PERL_IMPLICIT_CONTEXT
  Built under linux
  Compiled at Apr  3 2000 23:36:30
  @INC:
/usr/local/lib/perl5/5.00563/i686-linux-thread
/usr/local/lib/perl5/5.00563
/usr/local/lib/site_perl/5.00563/i686-linux-thread
/usr/local/lib/site_perl
.


-- 
[ Christopher Mason[EMAIL PROTECTED]  
http://ash.rem.cmu.edu/ ]
[ "Don't you see?! We're actors--we're the opposite of people!"
-Stoppard ]



RE: Set DocumentRoot from modperl

2000-04-04 Thread Doug MacEachern

On Tue, 4 Apr 2000, Karyn Ulriksen wrote:

 Which handler would be appropriate to do the cleanup on this?

you register the cleanup function from whatever handler changes
document_root.  that'll happen at the same time as PerlCleanupHandler,
which is after PerlLogHandler.

 my $old_docroot = $r-document_root;
 $r-register_cleanup(sub { shift-document_root($old_docroot) });




Re: Another Error in Apache::ASP and Perl 5.6.0

2000-04-04 Thread Joshua Chamas

Yu Di wrote:
 
 This program has been tested under Perl5.005_03, Apache 1.3.11, mod_perl
 1.21 on another machine. my.conf is a configuration file for this program.
 
 Lynx will report "Alert!: Unexpected network read error; connection
 aborted." while I try to connect to it, and the server error log will show
 a "[Tue Apr  4 16:36:22 2000] [notice] child pid 964 exit signal
 Segmentation fault (11)".
 
 I have changed ASP.pm as I wrote last time, for if I did not do so, I will
 get other error messages.
 
 So is it that Apache::ASP is currently not compatible with Perl 5.6?
 

Nothing in your program seemed particularly odd, and
I have not tested Apache::ASP under 5.6, nor may I for
a while.  Because Apache::ASP uses so many modules to 
do its job, it may be tough to track this down, but
I suspect an interaction with MLDBM  SDBM_File is 
at work here because you have so much $Application-{Config}
writing going on. 

Can you print out in different parts of your program and
isolate the line that causes the segfault?

--Joshua

_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks  free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051



Re: dumb beginner question

2000-04-04 Thread Jeff Beard


http://perl.apache.org/guide/performance.html#Persistent_DB_Connections

The answers to most beginner questions are in the guide as well.

--Jeff

At 05:28 PM 4/4/00, Adam Gotheridge wrote:
I have been using zope for a while and while it is cool, I really like the
speed/power/ease-of-use of perl so I would like to mimick some of the more
important functions I saw in zope and I can't figure it out.

One of the cool zope things was that you made one db connection object and 
then
all database interaction referenced that connection object. If you had to 
change
the connection string, it was in one place.

How can I do something like that in modperl? I am thinking I should be able to
just create a one-line connection string in a a file at the base of a 
site, and
then include that file in all perl pages. That takes care of the one place to
change it problem, but I am not getting it.

Something like
con.txt
my $dbh ||= DBI-connect("dbi:Oracle:host=red.home.com;sid=RED", 'scott',
'tiger') || die "Can't connect to : DBI-errstr";

and then in the cgi file say somthing like:
include(con.txt)

There must be an easy way to do this!

Thanks



Jeff Beard
___
Web:www.cyberxape.com
Phone:  303.443.9339
Location:   Boulder, CO, USA





Errors with mod_perl as a DSO

2000-04-04 Thread Drew Degentesh

I have mod perl installed as a DSO. I can confirm this (I think) by:

--
% telnet localhost 80
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
HEAD / HTTP/1.0

HTTP/1.1 200 OK
Date: Tue, 04 Apr 2000 18:01:21 GMT
Server: Apache/1.3.12 (Unix)  (Red Hat/Linux) PHP/4.0RC1 mod_perl/1.22
Last-Modified: Sat, 18 Mar 2000 14:21:16 GMT
ETag: "c0002-799-38d390dc"
Accept-Ranges: bytes
Content-Length: 1945
Connection: close
Content-Type: text/html

Connection closed by foreign host.
--

Unfortunately, even the simplest of scripts bombs out... Consider:

--
# login.pl
#!/usr/bin/perl
use Apache() || die "cant use apache()";
--

% perl ./login.pl
cant use apache() at ./login.pl line 3.
BEGIN failed--compilation aborted at ./login.pl line 3.
--


Any ideas as to what gives? I know that the defacto answer is to run
mod_perl as a static library..but that's really not an option in my case...

Help is appreciated.

Drew Degentesh
[EMAIL PROTECTED]




Re: [RFC] holding a mod_perl conference

2000-04-04 Thread Ken Williams

[EMAIL PROTECTED] (Doug MacEachern) wrote:
i'll share my thoughts on this that we discussed at ApacheCon.
i'm not sure about a dedicated "mod_perl conference" standing on it's own
two feet.  at least, not at the production level of ApacheCon or oracon,
but maybe something like YAPC.  

I second that (actually, I think I firsted it, so maybe you second it =).

if stas' idea were to spawn into another conference, i think the
"Scripting languages for WebDev" idea is too broad.  

Right, I don't think we want to get into all the various commercial products
that are available with their own little GUIs and whatnot.  Apache seems like a
good limiting factor for topical inclusion.

sure, there might be some overlap with ApacheCon and oracon, but if it's
scheduled at the right time, in the right place, i think it could work out
quite well.

*That* I second.  The big thing we need now is an organizer (like Kevin Lenzo
did for YAPC 1999) and a venue - best if someone can be both.

I'd volunteer, but (a) my planning skills are legendarily bad, (b) my teaching
gig eats all my time, and (c) I have no venue.  Otherwise I'd jump at the
chance.  Perhaps I could help someone out if they want to be the main person?


  ------
  Ken Williams Last Bastion of Euclidity
  [EMAIL PROTECTED]The Math Forum





advice/techniques: script control over page transitions

2000-04-04 Thread BT

I've generally created a cgi script per page.  Is that a mistake?
(I embed the perl in my html so I can edit pages with an html editor)

I need a better technique for invoking traversals to other pages.
Right now all I can do is a redirect (internal or external).
How do you organize things so that from within a script you can either
display the associated page or invoke any other page/script instead?

- just do redirects?
- put all page generation in subroutines in one big .pm?
- something else (I hope)?


Example:  My main "home" page has links to "login" and "register"
scripts/pages, both of which eventually lead to a "user" page.
With no parameters the login script displays an empty login form.
Called with get/post parameters it processes the form data;
on failure it redisplays the login form with a warning,
on success it should take you to the "user" page (my problem).
How would YOU organize this?

There are lots of tutorials on the net, but I haven't seen anything
about organization between multiple pages. 

(sorry, this is a clarified repost)



Re: Errors with mod_perl as a DSO

2000-04-04 Thread Vivek Khera

 "DD" == Drew Degentesh [EMAIL PROTECTED] writes:

DD Unfortunately, even the simplest of scripts bombs out... Consider:

DD --
DD # login.pl
DD #!/usr/bin/perl
DD use Apache() || die "cant use apache()";
DD --

DD % perl ./login.pl
DD cant use apache() at ./login.pl line 3.
DD BEGIN failed--compilation aborted at ./login.pl line 3.
DD --

You can't use your perl program to run mod_perl programs; you need to
use mod_perl to run them, and that's part of your httpd.




mod_perl cookbook

2000-04-04 Thread James G Smith

This might be a bit premature, but here goes...

Something I've wanted to have for a long time was a cookbook for 
mod_perl.  It is nice to go to the _Perl Cookbook_ (O'Reilly) and 
look up a solution to a problem without having to spend a day or 
even an hour or two trying to figure it out.  Before long, the 
_Perl Cookbook_ does pay for itself in saved time.

So... I've started assembling some bits and pieces to make a 
cookbook for mod_perl.  Some of the solutions I've found from my 
own coding, some from the list, and some from various books and 
other on-line resources.  I still have three years of list 
archives to sift through.

This is by no means meant to replicate information readily 
available in other resources such as the _Perl Cookbook_, the 
Eagle book, or Stas's mod_perl Guide.  This is meant to compliment 
them.  So don't expect to read anything in the cookbook and learn 
the answers to any great mod_perl mysteries.

Nor is the cookbook in any way complete.  I have tried to enumerate 
some of the areas for which I would like to see recipes and have 
tried to put a few together.  Most of these are incomplete, mainly 
lacking a discussion.  Out of 28 recipes, 5 can be considered some-
what complete.

The cookbook can be found at

 http://www.jamesmith.com/cookbook/

Let me know what recipes (as broad or specific as you like) you 
would like to see included.  Other comments are welcome also.
Not all the recipes have been tested recently, though I want to
get to that soon.  Keep in mind that the ordering and
content is subject to change at any time, though the recipes
themselves are bookmarkable.
+--
James Smith - [EMAIL PROTECTED] | http://www.jamesmith.com/
[EMAIL PROTECTED] | http://sourcegarden.org/
  [EMAIL PROTECTED]  | http://cis.tamu.edu/systems/opensystems/
+--



Selective Aliasing

2000-04-04 Thread Chris


Is there anything 'Bad (tm)' about creating a selective typeglob alias in
one package to a lexical that is definitely going to go out of scope in a
second package? It seems to work, but I feel like I may be missing 
something...

For example, consider two packages, A and B. B has a subroutine which
executes the following (B knows about A):

sub foobar {
  my $lexval = 'foo';
  *A::bar = \$lexval;
}

My concern is that B::foobar is going to get called possibly multiple
times (it is okay that $A::bar is getting overwritten each
time B::foobar gets called.) Since $A::bar ends up holding the only
reference to $lexval once B::foobar exits, is the refcount decremented and
the first instance of $lexval cleaned up properly when B::foobar gets
called a second time, overwriting $A::bar?

--Chris




Re: mod_perl (DSO) dumping core with perl 5.6.0

2000-04-04 Thread Stephen Zander

 "Doug" == Doug MacEachern [EMAIL PROTECTED] writes:
Doug won't performance suffer in that case?  i "benchmarked" Perl
Doug malloc vs. system malloc under solaris once, there were far
Doug more syscalls to brk() with system malloc.

Ilya has claimed for about 18 mths now that usemymalloc=y is the Right
Thing to do on Solaris and that previous assertions that Solaris'
malloc is better are no longer true.  He claims that perl's malloc is
tuned to perl's memory usage patterns resultinging in the lower
overhead and supposedly greater speed.

That said, I still don't run that way. :)

-- 
Stephen

"And what do we burn apart from witches?"... "More witches!"



Re: Apache::VMonitor

2000-04-04 Thread Doug MacEachern

On Tue, 4 Apr 2000, Paul G. Weiss wrote:

 Has anyone succeeded in building this for Solaris?  This sounds
 like an interesting module and I'd like to be able to use it.

you'll have a whole lot of trouble with libgtop under solaris.  last i
tried with 1.0.2-ish, i had to patch the libgtop sources to get things
kinda-sorta working.  another release a few months ago stated that it
broke solaris support in a big way.  i haven't tried recently, i would
suggest checking out:
http://home-of-linux.org/gnome/libgtop/

try building and running some of the examples/ before going any further.





Re: Apache::VMonitor

2000-04-04 Thread Stas Bekman

 Has anyone succeeded in building this for Solaris?  This sounds
 like an interesting module and I'd like to be able to use it.

Apache::VMonitor relies on GTop, GTop in turn relies on libgtop C lib.  So
if you get C lib compiled on Solaris, you get the rest working.  See
http://home-of-linux.org/gnome/libgtop/ for more info. 

__
Stas Bekman | JAm_pH--Just Another mod_perl Hacker
http://stason.org/  | mod_perl Guide http://perl.apache.org/guide/ 
mailto:[EMAIL PROTECTED]  | http://perl.orghttp://stason.org/TULARC/
http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org
--