Re: problem with mod_perl 2.0 + apache 2.0 and proxyreq

2003-08-26 Thread Stas Bekman
John Chiu wrote:
Thanks in advance. I've tried all the archives and google'd but I have 
not found anything that would help.

 

I'm running RH 8.0, httpd-2.0.40-11.5 and mod_perl-1.99_05-3 from the 
RedHat distribution. I'm trying to create a small proxy module that will 
check a non-proxy request and depending on "stuff" dynamically transform 
it into a proxy request using mod_proxy.
1.99_05 is a way too old. Lots of bugs were fixed since that release. Upgrade 
to at least 1.99_09 or better the current cvs. 1.99_10 will be released as 
soon as perl-5.8.1 is released.

I'm following the example in Chapter 7 (page 370) of the "Writing Apache 
Modules with Perl and C". I know that the book is based on the older 
apache 1.3 server and associated mod_perl. However, I have not found 
anything in my readings to indicate that this would not work any more.

my $r =3D shift;
[... code snipped ...]

BTW, you mailer has mangled the source code, s/=/=3D/

Additionally, a 502 Bad Gateway error was encountered while trying to 
use an ErrorDocument to handle the request.

 

The apache error log indicates (with some debugging) that it is looping 
on the "GET" of goodbye.html. Additional debuging indicates that 
$r->proxyreq is always 0, so it's looping. My questions are:

 

1.Did sometime change in apache 2 or mod_perl 2 so that you cannot

set proxyreq anymore: ie. $r->proxyreq(1).

2.How do you set proxyreq if $r->proxyreq(1) is not the correct

method?

3.Is the logic wrong in this proxy example?
How can we possible know what the problem is if you don't show the relevant 
configuration section? Most likely you have a broken configuration and should 
advise first the mod_proxy documentation.
http://httpd.apache.org/docs-2.0/mod/mod_proxy.html

To make sure that the problem is not in mod_perl, I've added a new 
modules/proxy test to the mp2 test suite, based on that example from the eagle 
book. Try it and if you succeed to break it, then we will fix it. You will 
need to retrieve the cvs version in order to get it.
http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution
(note: I have just committed the test, so if you use the snapshot, which is 
updated every 6 hours, it may not be there, so use the normal cvs checkout)

__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html


Re: Problem with mod_perl and subroutines in multiple files.

2003-03-04 Thread Stas Bekman
Benjamin Grabkowitz wrote:
I am a new Perl developer and just found out about the great benefits of
mod_perl. 
I see that you try to work with mod_perl 2.0. So here is a bit of advice:

mod_perl 2.0 (1.99_0x) while getting better every day, still has quite a few 
bugs, so you may want to start with the stable mod_perl 1.0 (1.27) instead and 
then move on to 2.0 when the time comes.

If you do want to stick with mp2, (and we do want people to start using it to 
expose the bugs as early as possible), please make sure to use the latest cvs 
version, since what you use is a way too old and lots of bugs were fixed since 
1.99_05. See:
http://perl.apache.org/download/source.html#mod_perl_2_0

Finally regarding your original question, you probably need to read this:
http://perl.apache.org/docs/1.0/guide/porting.html#Name_collisions_with_Modules_and_libs
and may be spend some time around http://perl.apache.org/docs/1.0/guide/ for 
your own good ;)

I had a Perl cgi script that ran fine. It consisted of 1 main.pl file
and multiple subroutines that each had their own file in a directory
called libs (it is in the same directory as main.pl). When I got
mod_perl properly configured (or to what I thought was properly
configured), I got strange errors like:
ModPerl::PerlRun: Not a CODE reference at /var/www/cgi-bin/main.pl line
31.
__
Stas BekmanJAm_pH --> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: problem with mod_perl and scripts .... please help!!!

2001-04-19 Thread Vivek Khera

> "aa" == abhishek agrawal <[EMAIL PROTECTED]> writes:

aa>i am sure that i have installed the module Date::Calc properly using 
aa>ppm. I dont know why is it giving this error. Is their some problem 
aa>using Activeperl and modperl together?

Obviously not, though.  What happens when you run

perl -MDate::Calc -e 'print $Date::Calc::VERSION'

on a command line?  Is that the same perl you had when you built
mod_perl?


-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/



Re: Problem with mod_perl module!!!

2000-11-29 Thread Ask Bjoern Hansen

On Wed, 29 Nov 2000, Edmar Edilton da Silva wrote:

> I have a problem with the Apache::DBI and mod_perl modules that
> don't work together, before I thought that the problem was in the
> Apache::DBI. But, now I know that the problem is in the mod_perl because
> it also doesn't work when I try loading the CGI.pm module in the
> "startup.pl file". The conclusion is that when I don't load any module
> in the "startup.pl" file the perl scripts are ran correctly, but when I
> load some module the child processes (httpds) of the apache are not
> created. Thus, when a script is requested the server returns a message
> saying that the connection was refused.

Sounds like your server didn't even start. Are you sure you compiled
mod_perl into apache correctly? Check http://perl.apache.org/guide/
for instructions on how to figure that out.


  - ask

-- 
ask bjoern hansen - 
more than 70M impressions per day, 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Problem with mod_perl module!!!

2000-11-29 Thread G.W. Haywood

Hi there,

On Wed, 29 Nov 2000, Edmar Edilton da Silva wrote:

> How can I know if a perl script is being ran under mod_perl?

http://perl.apache.org/guide

73,
Ged.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Problem with mod_perl

2000-06-01 Thread Greg Estep


On Fri, 26 May 2000, Eugene S. Panenko wrote:

> Hi all,
>
> Sorry if it is an incorrect list to ask...
>
> I have a strange problem with mod_perl. I've tested mod_perl using a very
> simple scripts (one of them is attached). The network load is emulated via
LAN
> using a special proggy. The problem is: under load above 20 requests per
second
> after working some time (about 15-30 sec) Apache daemon stopts accepting
new
> connections and blocks forever (without -X option httpd at this moment
begin
> forking until it eats all resources) . I've found that the problem exists
> only when scripts use modules (tested with CGI v 2.46, IPC::Shareable, our
own
> modules).  Test scripts without modules work fine even under load of 200
> requests per second.


Without knowing too much about your apache config. files, machine specs,
etc. I am guessing that your Apache MaxClients is still set at 150 (the
out-of-the-box value).

When apache receives a request that it cannot immediately handle (all of the
pre-forked process are busy) it will fork another one (up to MaxClients).
Eventually, you will run out of physical memory and begin to hit your swap
space.  When this happens, it takes longer to handle a request.  That causes
more requests to back up in the queue, so apache forks some more processes
to handle the load. These new processes increase the amount of swapping that
needs to be done, and the situation gets out of control.

How many subprocesses you can support depends upon the size of your httpd
process's text and data segments.  I have seen several mod_perl applications
increase the size of an httpd process to over 10 Mbytes.  If you set
MaxClients to a number that can be safely stored in physical memory
(adjusting for the OS and other processes running on the machine, of course)
you might eliminate your problem.

--
Greg Estep <[EMAIL PROTECTED]>




Re: Problem with mod_perl

2000-06-01 Thread Doug MacEachern

On Fri, 26 May 2000, Eugene S. Panenko wrote:

> Hi all,
> 
> Sorry if it is an incorrect list to ask...
> 
> I have a strange problem with mod_perl. I've tested mod_perl using a very
> simple scripts (one of them is attached). The network load is emulated via LAN
> using a special proggy. The problem is: under load above 20 requests per second
> after working some time (about 15-30 sec) Apache daemon stopts accepting new
> connections and blocks forever (without -X option httpd at this moment begin
> forking until it eats all resources) . I've found that the problem exists
> only when scripts use modules (tested with CGI v 2.46, IPC::Shareable, our own
> modules).  Test scripts without modules work fine even under load of 200
> requests per second.

what are the frozen server doing if you strace them?

does it make a difference if you move 'my(%accessed)' inside your 'sub
Main'?  you should do that anyhow to avoid the 'variable won't stay
shared' problem.




Re: Problem with mod_perl

2000-05-27 Thread Ged Haywood

Hi there,

On Fri, 26 May 2000, Eugene S. Panenko wrote:

> The problem is: under load above 20 requests per second after
> working some time (about 15-30 sec) Apache daemon stopts accepting
> new connections and blocks forever (without -X option httpd at this
> moment begin forking until it eats all resources)

How much RAM in the machines?

73,
Ged.




Re: Problem with mod_perl processes spinning

1999-08-13 Thread Greg Stark

*** From dbi-users -- To unsubscribe, see the end of this message. ***


Greg Stark <[EMAIL PROTECTED]> writes:

> We're seeing httpd processes spinning with 100% cpu utilization and no system
> calls in truss. This is on Solaris 2.5.1 and everything was working dandy
> until minutes ago.
> 
> Is this name service related or are the "ns" stuff redherrings?
> 
> What signal handler could frame 27 be? could this be a bad race condition and
> a nonreentrant signal handler?

Here's a simpler backtrace that seems to be what's happening consistently now,
it's always in the Oracle libs so I've CC'd the DBD::Oracle list. What are
these ns* functions? Is there a debugging version of the library containing
them around or buildable?

#0  0xeed88174 in nscpxrecon ()
#1  0xeed7750c in nspsend ()
#2  0xeed65438 in nsdofls ()
#3  0xeed65858 in nsdoacts ()
#4  0xeed63d6c in nsdo ()
#5  0xeed88258 in nscpxrecon ()
#6  0xeed7592c in nsprecv ()
#7  0xeed7a6cc in nsrdr ()
#8  0xeed62b80 in nsdo ()
#9  0xeed35b20 in nioqrc ()
#10 0xeeec4b7c in ttcdrv ()
#11 0xeed3dbb4 in nioqwa ()
#12 0xeecc9a58 in upirtrc ()
#13 0xeecffd08 in kpurcsc ()
#14 0xeed23fc0 in kpuexecv8 ()
#15 0xeed269dc in kpuexec ()
#16 0xeed072bc in OCIStmtExecute ()
#17 0xef46c61c in ora_st_execute ()
#18 0xef468638 in XS_DBD__Oracle__st_execute ()
#19 0xef5381dc in XS_DBI_dispatch ()
#20 0xd69b0 in ?? ()
#21 0x1104b8 in ?? ()
#22 0x98734 in ?? ()
#23 0x305f8 in ?? ()
#24 0x300cc in ?? ()
#25 0x2f114 in ?? ()
#26 0x676e0 in ?? ()
#27 0x82ba8 in ?? ()
#28 0x82c28 in ?? ()
#29 0x770a8 in ?? ()
#30 0x773fc in ?? ()
#31 0x77914 in ?? ()
#32 0x78074 in ?? ()
#33 0x78950 in ?? ()

-- 
greg


--
To unsubscribe from this list, please visit: http://www.isc.org/dbi-lists.html
If you are without web access, or if you are having trouble with the web page,
please send mail to [EMAIL PROTECTED] with the subject line of
'unsubscribe'.
--