You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Flavio D' Amore <fd...@datamat.it> on 2001/09/14 17:53:59 UTC
Environment variable $ENV{MOD_PERL}
Hi,
im reading on mod_perl and Relational Databases
(http://apache.org/guide/databases.html), Introduction, that persistent
database connections needs to have set $ENV{MOD_PERL} in order to execute
CGI perl script
via mod_perl and not via normal CGI.
What's the right value for that variable and where i've to set it
(httpd.conf or Unix environment?)?
By and thanks in advance
-------------------------------
Fl@vio D' Amore
DATAMAT S.p.A.
Via Laurentina 760
00143 Rome - Italy
DATASIM - Product Support
Phone: +39-06-50.27.4350
Re: Environment variable $ENV{MOD_PERL}
Posted by Robin Berjon <ro...@knowscape.com>.
On Friday 14 September 2001 17:53, Flavio D' Amore wrote:
> im reading on mod_perl and Relational Databases
> (http://apache.org/guide/databases.html), Introduction, that persistent
> database connections needs to have set $ENV{MOD_PERL} in order to execute
> CGI perl script via mod_perl and not via normal CGI.
>
> What's the right value for that variable and where i've to set it
> (httpd.conf or Unix environment?)?
mod_perl will take care for you to set it and to set it properly. That's the
way to know that you're running under mod_perl.
--
_______________________________________________________________________
Robin Berjon <ro...@knowscape.com> -- CTO
k n o w s c a p e : // venture knowledge agency www.knowscape.com
-----------------------------------------------------------------------
An eye for an eye will make the whole world blind. -- Mahatma Gandhi
Re:Environment variable $ENV{MOD_PERL}
Posted by Mike Miller <mm...@crusoe.net>.
On Friday, September 14, 2001, Medi Montaseri wrote the
following about "Environment variable $ENV{MOD_PERL}"
MM> and there is no way that I know of that one can tell, if we do
MM> indeed have a persistant connection or have simply required some
MM> dumb packages...
logging into the database and monitoring connections in use seems to
me to be one way to do it ...
Best Regards,
Mike Miller
mmiller@crusoe.net
Re: Environment variable $ENV{MOD_PERL}
Posted by Medi Montaseri <me...@CyberShell.com>.
Thank you for everyone's support....
My problem was that I was reading suggestions like "don't change your CGI
script as Apache::DBI persistance connection is fully transparent..."
too literally....
The pre-requsite to this mod_perl is to have your CGI scripts run under
a special mod_perl directory....yes, I read that in the Eagle book, but
in Chapter 2, and by the time I got to the meating things, had forgotton
this prereq....
Note to Author of Apache::DBI, could you please add a brief comment in
this regard to your "Configuration" section. Also, in your document,
you keep referring to eg/startup.pl. I don't think we get that with just
a binary (or RPM install)...
Anyways...overall I was at fault for not re-re-read documents....
On Sat, 15 Sep 2001, Stas Bekman wrote:
> On Fri, 14 Sep 2001, Medi Montaseri wrote:
>
> > These documents are very confusing....on one hand the document the other
> > caller mentioned does explicitly talk about two conditions should exists.
> > Note A AND B. And then we hear that that is not really true...And even
> > Apache::DBI.pm itslef does not talk about it and there is no way that I
> > know of that one can tell, if we do indeed have a persistant connection or
> > have simply required some dumb packages...
> >
> > We appreciate the technology such package authors bring to us...but please
> > regard the documentation part as important as other parts...
> > We are doing out best to keep the Perl and open source flag up, but we
> > can not read source code all day long, our Microsoftish developers are way
> > ahead of us with their fancy IDEs....
>
> As Andrew said, you just need to learn how to find your way around. I
> believe it's still easier than trying to get somebody on the support call
> to explain it to you. The cool thing is that once you know your way
> around, you don't need anybody else to help yourself. I admit that the
> initial overhead may be longer but it's only in the beginning.
>
> Back to your problem. What I've suggested is that may be you aren not
> running mod_perl at all [read: you run mod_cgi]! Try to put into your
> startup.pl:
>
> die "not running under mod_perl" unless $ENV{MOD_PERL};
>
> > On Sat, 15 Sep 2001, Stas Bekman wrote:
> >
> > > On Fri, 14 Sep 2001, Flavio D' Amore wrote:
> > >
> > > > Hi,
> > > > im reading on mod_perl and Relational Databases
> > > > (http://apache.org/guide/databases.html), Introduction, that persistent
> > > > database connections needs to have set $ENV{MOD_PERL} in order to execute
> > > > CGI perl script
> > > > via mod_perl and not via normal CGI.
> > > >
> > > > What's the right value for that variable and where i've to set it
> > > > (httpd.conf or Unix environment?)?
> > >
> > > mod_perl does this for you. You shouldn't mess with it yourself.
> > >
> > > Hmm, may be you don't run under mod_perl even if you think you are?
> > >
> > >
> > >
> > >
> > > _____________________________________________________________________
> > > Stas Bekman JAm_pH -- Just Another mod_perl Hacker
> > > http://stason.org/ mod_perl Guide http://perl.apache.org/guide
> > > mailto:stas@stason.org http://apachetoday.com http://eXtropia.com/
> > > http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
> > >
> > >
> > >
> >
> > --
> > -------------------------------------------------------------------------
> > Medi Montaseri medi@CyberShell.com
> > Unix Distributed Systems Engineer HTTP://www.CyberShell.com
> > CyberShell Engineering
> > -------------------------------------------------------------------------
> >
>
>
>
> _____________________________________________________________________
> Stas Bekman JAm_pH -- Just Another mod_perl Hacker
> http://stason.org/ mod_perl Guide http://perl.apache.org/guide
> mailto:stas@stason.org http://apachetoday.com http://eXtropia.com/
> http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
>
>
>
--
-------------------------------------------------------------------------
Medi Montaseri medi@CyberShell.com
Unix Distributed Systems Engineer HTTP://www.CyberShell.com
CyberShell Engineering
-------------------------------------------------------------------------
Re: Environment variable $ENV{MOD_PERL}
Posted by Stas Bekman <st...@stason.org>.
On Fri, 14 Sep 2001, Medi Montaseri wrote:
> These documents are very confusing....on one hand the document the other
> caller mentioned does explicitly talk about two conditions should exists.
> Note A AND B. And then we hear that that is not really true...And even
> Apache::DBI.pm itslef does not talk about it and there is no way that I
> know of that one can tell, if we do indeed have a persistant connection or
> have simply required some dumb packages...
>
> We appreciate the technology such package authors bring to us...but please
> regard the documentation part as important as other parts...
> We are doing out best to keep the Perl and open source flag up, but we
> can not read source code all day long, our Microsoftish developers are way
> ahead of us with their fancy IDEs....
As Andrew said, you just need to learn how to find your way around. I
believe it's still easier than trying to get somebody on the support call
to explain it to you. The cool thing is that once you know your way
around, you don't need anybody else to help yourself. I admit that the
initial overhead may be longer but it's only in the beginning.
Back to your problem. What I've suggested is that may be you aren not
running mod_perl at all [read: you run mod_cgi]! Try to put into your
startup.pl:
die "not running under mod_perl" unless $ENV{MOD_PERL};
> On Sat, 15 Sep 2001, Stas Bekman wrote:
>
> > On Fri, 14 Sep 2001, Flavio D' Amore wrote:
> >
> > > Hi,
> > > im reading on mod_perl and Relational Databases
> > > (http://apache.org/guide/databases.html), Introduction, that persistent
> > > database connections needs to have set $ENV{MOD_PERL} in order to execute
> > > CGI perl script
> > > via mod_perl and not via normal CGI.
> > >
> > > What's the right value for that variable and where i've to set it
> > > (httpd.conf or Unix environment?)?
> >
> > mod_perl does this for you. You shouldn't mess with it yourself.
> >
> > Hmm, may be you don't run under mod_perl even if you think you are?
> >
> >
> >
> >
> > _____________________________________________________________________
> > Stas Bekman JAm_pH -- Just Another mod_perl Hacker
> > http://stason.org/ mod_perl Guide http://perl.apache.org/guide
> > mailto:stas@stason.org http://apachetoday.com http://eXtropia.com/
> > http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
> >
> >
> >
>
> --
> -------------------------------------------------------------------------
> Medi Montaseri medi@CyberShell.com
> Unix Distributed Systems Engineer HTTP://www.CyberShell.com
> CyberShell Engineering
> -------------------------------------------------------------------------
>
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:stas@stason.org http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: Environment variable $ENV{MOD_PERL}
Posted by Andrew Ho <an...@tellme.com>.
Hello,
MM>And even Apache::DBI.pm itslef does not talk about it and there is no
MM>way that I know of that one can tell, if we do indeed have a persistant
MM>connection or have simply required some dumb packages...
The documentation mentions that you can use Apache::Status to check on
statistics about Apache::DBI. This is directly from perldoc Apache::DBI.
Three clicks into the mod_perl guide gives you this:
http://perl.apache.org/guide/databases.html#Debugging_Apache_DBI
Which is about how to turn on debugging information from Apache::DBI.
Do these things not work for you? If so, tell us and we can perhaps help
you further.
By the way, you will likely receive more polite and helpful replies if you
do not persist in calling technology that many of us rely on for
production sites "dumb."
MM>We appreciate the technology such package authors bring to us...but
MM>please regard the documentation part as important as other parts... We
MM>are doing out best to keep the Perl and open source flag up, but we can
MM>not read source code all day long, our Microsoftish developers are way
MM>ahead of us with their fancy IDEs....
Use what works for you and your situation. You shouldn't be using Perl and
open source software if you really want to be using a Microsoft language
and its related IDE.
That being said, point out the relevant documentation pieces that are
missing--I think you just missed what you needed in this case--to the
authors and this list! Then we can all help fill in the pieces.
Humbly,
Andrew
----------------------------------------------------------------------
Andrew Ho http://www.tellme.com/ andrew@tellme.com
Engineer info@tellme.com Voice 650-930-9062
Tellme Networks, Inc. 1-800-555-TELL Fax 650-930-9101
----------------------------------------------------------------------
Re: Environment variable $ENV{MOD_PERL}
Posted by Medi Montaseri <me...@CyberShell.com>.
These documents are very confusing....on one hand the document the other
caller mentioned does explicitly talk about two conditions should exists.
Note A AND B. And then we hear that that is not really true...And even
Apache::DBI.pm itslef does not talk about it and there is no way that I
know of that one can tell, if we do indeed have a persistant connection or
have simply required some dumb packages...
We appreciate the technology such package authors bring to us...but please
regard the documentation part as important as other parts...
We are doing out best to keep the Perl and open source flag up, but we
can not read source code all day long, our Microsoftish developers are way
ahead of us with their fancy IDEs....
On Sat, 15 Sep 2001, Stas Bekman wrote:
> On Fri, 14 Sep 2001, Flavio D' Amore wrote:
>
> > Hi,
> > im reading on mod_perl and Relational Databases
> > (http://apache.org/guide/databases.html), Introduction, that persistent
> > database connections needs to have set $ENV{MOD_PERL} in order to execute
> > CGI perl script
> > via mod_perl and not via normal CGI.
> >
> > What's the right value for that variable and where i've to set it
> > (httpd.conf or Unix environment?)?
>
> mod_perl does this for you. You shouldn't mess with it yourself.
>
> Hmm, may be you don't run under mod_perl even if you think you are?
>
>
>
>
> _____________________________________________________________________
> Stas Bekman JAm_pH -- Just Another mod_perl Hacker
> http://stason.org/ mod_perl Guide http://perl.apache.org/guide
> mailto:stas@stason.org http://apachetoday.com http://eXtropia.com/
> http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
>
>
>
--
-------------------------------------------------------------------------
Medi Montaseri medi@CyberShell.com
Unix Distributed Systems Engineer HTTP://www.CyberShell.com
CyberShell Engineering
-------------------------------------------------------------------------
Re: Environment variable $ENV{MOD_PERL}
Posted by Stas Bekman <st...@stason.org>.
On Fri, 14 Sep 2001, Flavio D' Amore wrote:
> Hi,
> im reading on mod_perl and Relational Databases
> (http://apache.org/guide/databases.html), Introduction, that persistent
> database connections needs to have set $ENV{MOD_PERL} in order to execute
> CGI perl script
> via mod_perl and not via normal CGI.
>
> What's the right value for that variable and where i've to set it
> (httpd.conf or Unix environment?)?
mod_perl does this for you. You shouldn't mess with it yourself.
Hmm, may be you don't run under mod_perl even if you think you are?
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:stas@stason.org http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/