Apache::VMonitor not showing requests (might be Apache::Scoreboard problem)

2002-04-04 Thread Jon Molin

Hi list,

I've got some problems with getting Apache::VMonitor showing the
requests, everything but client ip and requests shows. 
when i call server/scoreboard do i get a file, and 'strings
scoreboard|grep -A 1 myip' shows my ip and request (can't find the pid
though) so the info should be there. I've added :
 'REQ="'.$rec->{request}.'"'; #line 373 in Apache::VMonitor
and when i call server/sys-monitor do i get 'REQ=""' foreach row. So it
tries to print but it's all empty.

I guess this is some silly conf thingy i've missed out. I have it
running fine on another system and i can't see the diff in
configuration.
here's a snippet of httpd.conf:

# httpd.conf
PerlFreshRestart On  
Perlrequire /usr/local/apache/conf/startup.pl
PerlModule Apache::Scoreboard


   SetHandler perl-script
   PerlHandler Apache::Status
   order deny,allow
   deny from all
   allow fromlocalhost


   SetHandler perl-script
   PerlHandler Apache::VMonitor
   order deny,allow
   deny from all
   allow from localhost 


   SetHandler perl-script
   PerlHandler Apache::Scoreboard::send
   order deny,allow
   deny from all
   allow from localhost 

# END
and here's the part from startup.pl with Apache::VMonitor:
use Apache::VMonitor();
$Apache::VMonitor::Config{BLINKING} = 1;
$Apache::VMonitor::Config{REFRESH}  = 0;
$Apache::VMonitor::Config{VERBOSE}  = 0;
$Apache::VMonitor::Config{SYSTEM}   = 1;
$Apache::VMonitor::Config{APACHE}   = 1;
$Apache::VMonitor::Config{PROCS}= 1;
$Apache::VMonitor::Config{MOUNT}= 1;
$Apache::VMonitor::Config{FS_USAGE} = 1;
$Apache::VMonitor::Config{SORT_BY}  = 'size';
$Apache::VMonitor::PROC_REGEX = join "|", qw(httpd mysql);
$Apache::VMonitor::Config{PROC_REGEX}  = join "|", qw(httpd mysql);
#END

And here's my system:
Embedded Perl version v5.6.0 for Apache/1.3.23 (Unix) mod_perl/1.26 
$Apache::VMonitor::VERSION = '0.6';
Apache::Scoreboard version: $VERSION = '0.10';

So is there anything obivous I've missed out?

/Jon



Re: Asia To USA Shipping Rates

2002-03-25 Thread Jon Molin

"Vuillemot, Ward W" wrote:
> 
> Not to beat a dead horse...but we all can have an impact on these guys.
> 
> Write a VERY pointed email explaining your position as a web developer.  If
> you do contracting work, convince the company that you _will_ never use
> their product, nor suggest it to any of your *many* customers. . .and will
> further go to any pains to direct traffic to their competitors.  Period.
> 

yeah and then they'll sell our addresses, earn a small amount of money
and fill our inboxes with spam.
do you send mail to 'reply to this address if you wanna be removed too'?
;)

/Jon

> we are the ones with the power. . .we are the GEEKS!  And the NERDS!  I mean
> those two words in the best of light, with the greatest of respect and
> pride.  :D
> 
> Cheers,
> Ward
>



Re: Net::LDAP::Extension

2002-02-27 Thread Jon Molin

Murugan K wrote:
> 
> Hi
>  Can please  you direct me to the   Net::LDAP::Extension
> Documentation.
> 

http://search.cpan.org/search?mode=module&query=Net%3A%3ALDAP%3A%3AExtension

> Thanks in advance.
> 
> Regards
> K.Murugan



Re: Tracing script with problem

2002-01-25 Thread Jon Molin

Stas Bekman wrote:
> 
> It's actually easy, take a look at the Apache::SizeLimit or
> Apache::GTopLimit, look at the cleanup handler that they register. Now
> take this handler and dump whatever you need to the file or error_log
> when you find that the process was taking too much memory.
> 
> Take a look at this code and you will see that it's very simple.
> 

Thanks a bunch, I'll look into that.

Another question, do you (or anyone else for that matter) know how the
accesslog works? (and also why it does work like it does) It seems it
prints after the request is done, otherwise could that easily be used
for checking the parameters, and not only loging. 


/Jon

> _
> Stas Bekman JAm_pH  --   Just Another mod_perl Hacker
> http://stason.org/  mod_perl Guide   http://perl.apache.org/guide
> mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
> http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



Tracing script with problem

2002-01-25 Thread Jon Molin

Hi list,

I had problems with a script that went nuts and took 65MB memory and
alot of cpu. To track this script down I thought Apache:VMonitor would
be perfect, unfortenately I ran into some weird promlems (it said there
was an error in mod_perl.h) and i know gcc might be broken on this
machine so I started scratching my head and came to the conclusion that
this 'oneliner' ought to help me track the error down:

find /www/docs -name '*.cgi' -type f -exec perl -pi -e
's:(#!/usr/bin/perl[ w-]*\s*):$1\nprint STDERR "\\nPID=\$\$
SCRIPT=\$ENV{REQUEST_URI} \\n";\n:s;' {} \;

ie, every script now prints it's httpd pid and it's request_uri. So i
just started waiting watching top with excitment and when the 65 MB
httpd process i greped for the pid in the error_log and got the
scriptname and it's arguments. 

Then i reproduced the error on a server with VMonitor to see if what i
missed out. Ok i could see the name of the scrpit but the real problem
was with the query_string, choped after a couple of chars. Now, if i
understand things right (i tried some tweaking on the module) it's not
possible to get more than 64 char. Why is this, and is it really so?

I know I'm no Einstein and i presume thousands of ppl have tried tracing
similar problems, how did you do it? There must be a more effective way
to find it? I know I would've got the script name but since i never
thought it would get the input it got chances are it'd take me a long
time finding the problem if i only knew the name. 

/Jon



Re: Apache and Perl togheter

2002-01-09 Thread Jon Molin

Alan Civita wrote:
> 
> is it possible that i have to do something special
> in compiling apache to activate the perl mode?

have you read at perl.apache.org? or about executing cgi's in apache?

/Jon



Re: Apache and Perl togheter

2002-01-09 Thread Jon Molin

Alan Civita wrote:
> 
> Hello can some help me pelase?
> i've recently installed Apace 1.3.22...i've configured the
> CGI directive to work as well
> but when i try to execute a CGI script written in perl
> that message appears:
> 
> Internal Server Error
> The server encountered an internal error or
> misconfiguration and was unable to complete your request.
> Please contact the server administrator,
> [EMAIL PROTECTED] and inform them of the time the error
> occurred, and anything you might have done that may have
> caused the error.
> More information about this error may be available in the
> server error log

have you checked the error log?

/Jon

> 
> The CGI script is a stupid test " hello world" CGI script
> ...
> 
> Script written in sh script work.
> Can someone solve my problem please...
> Thx to all
> Alan



[OT] eval

2001-12-10 Thread Jon Molin

hi list,

I know this is OT but i don't know what list i should ask this on so i
give it a shot here. If you're very annoyed with this mail me private
with a list  should use.


I'm trying to use eval () with a constants module and it works very
funny, can anyone explain this behavior to me:

i have a module with constants (constants.pm):
##
package constants;
my %month_number = (
'Jan' => '01',
'Feb' => '02',
'Mar' => '03',
'Apr' => '04',
'May' => '05',
'Jun' => '06',
'Jul' => '07',
'Aug' => '08',
'Sep' => '09',
'Oct' => '10',
'Nov' => '11',
'Dec' => '12'
);

sub get_constant
{
my $name = shift;
my $ret = ();
 "$month_number{Dec}\n"; #<-- ODD ROW
eval '$ret = \\%month_number';
print "$_ -> $ret->{$_}\n" foreach (keys %{$ret}); # just to trace
print "$ret=$ret->{Dec}\n";# just to trace
return $ret;
}
1;
#EOF

and a dummyscript constant.pl:

use constants;
my $bla = &constants::get_constant ('%month_number');
#EOF


when i run the script with row (<--- ODD ROW) it workds fine:
bash-2.04$ perl constant.pl 
Oct -> 10
Dec -> 12
Mar -> 03
Feb -> 02
Jan -> 01
Nov -> 11
May -> 05
Aug -> 08
Sep -> 09
Jul -> 07
Apr -> 04
Jun -> 06
HASH(0x80f8270)=12

but if i remove that line i get:
bash-2.04$ perl constant.pl 
HASH(0x80f8270)=


ie it doesn't seems to find the variable...This seems like vodoo to me.
Can anyone explain or point me to a place with an explanation?


/Jon



Re: [modperl site design challenge] please vote

2001-12-04 Thread Jon Molin

Hans Poo wrote:

[snip]
>> voting at http://www.tohubohu.net/cgi/mpchallenge
[snip]
> Please, can you send the address of the three designs?

did you try clicking the links with the names?

http://domm.zsi.at/modperl-site-domm/
http://www.quantumfx.com/modperl_site/
http://www.apache.org/~stas/site/candidates/allan-juul/

/Jon



Re: [OT] FW: OWASP Update

2001-10-29 Thread Jon Molin

only me that get 404 Not Found ? 
both on http://www.owasp.org/projects/cov/index.htm and
http://www.owasp.org

is this the beginning of a new word? the site has been modperled :)

/jon



Matt Sergeant wrote:
> 
> Not sure if this should really be considered off topic, as it should be
> required reading. Anyway, go to owasp *now*, and read all the COV's you can
> get through. These should be required knowledge for any web developer, and
> the site seems to have detailed the various possible vulnerabilities really
> well.
> 
> http://www.owasp.org/projects/cov/index.htm
> 
> (and no, I'm not affiliated in any way - just excited to see all this stuff
> explicitly detailed so succinctly).

 snip



Re: Touble getting apache going...

2001-09-10 Thread Jon Molin

Tim J Spriggs wrote:
> 
> I am running Debian Linux(Woody) and installed apache-perl and all of the
> supporting libraries. Whenever Apache is run I get the error message:
> 
> ---
> [Mon Sep 10 16:50:03 2001] [error] Can't locate Apache.pm in @INC (@INC
> contains: /usr/local/lib/perl/5.6.1 /usr/local/share/perl/5.6.1
> /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.6.1 /usr/share/perl/5.6.1
> /usr/local/lib/site_perl /usr/lib/perl5/5.6 /usr/lib/perl5/5.005 .
> /etc/apache/ /etc/apache/lib/perl) at (eval 1) line 3.
> ---
> 
> If I goto the /usr/share/perl/5.6.1/CGI where Apache.pm is located and
> try to start apache it simply says apache cannot be started and in the
> logfile it says:

might not be this but shouldn't you have '/usr/share/perl/5.6.1/CGI' in
your @INC to? 

> 
> ---
> Apache.pm failed to load!.
> ---
> 
> Thank you in advance for any help given.
> 
> -Tim([EMAIL PROTECTED])



Re: tracing memory problem

2001-09-07 Thread Jon Molin

Stas Bekman wrote:
> 
> On Fri, 7 Sep 2001, Jon Molin wrote:
> 
> > Hi list,
> >
> > I have a memory leak in a script or module, the problem is that i've
> > resently added many scripts and modules and can't easily isolate the
> > problem. Is there a way besides strace to see what the httpd process is
> > up to?
> >  9869 httpd  0   0 21188  19M  2424 S   0 12.2  3.8   0:13 httpd
> > doesn't help me too much...
> 
> Please explain what do you mean by 'what the httpd process is up to'?
> 

sorry, what i meant was what script was accessed by the httpd process.
That's the first problem, locating what set of scripts(modules) it can
be and after that start looking...


> It's not an easy task to find the offending code that causes memory leaks.
> Using GTop.pm for easier memory debugging printing helps a lot,
> Devel::Peek is useful too, try also Devel::Leak and their Apache::
> friends: Apache::Peek and Apache::Leak. You can find some notes on using
> these in the mod_perl guide. Apache::VMonitor can be very useful too.
> 
> Otherwise you will probably have to play the halving game: remove half of
> your modules/scripts and test. If nothing comes up return a half  of the
> removed half, and so on. It's not always working like that, since some
> code may leak when it interacts with some specific code.
> 
> In the meantime, use Apache::SizeLimit to prevent the processes from
> growing. See the guide or the manpage for the details.

ok, i'll look into that. I've been using RLimitMEM and RLimitCPU in
httpd.conf:
RLimitMEM 15728640  15728640 
RLimitCPU 600   600
and haven't got them to work very good:
10314 httpd 13   0 67824  66M  5572 R   0 17.9 13.1   4:19 httpd
10313 httpd 13   0 69984  68M  5580 R   0 17.7 13.5   4:33 httpd

but i guess that's fairly OT on the mod_perl list. 

Thanks for the quick reply!
/Jon

> _
> Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
> http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
> mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
> http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



tracing memory problem

2001-09-07 Thread Jon Molin

Hi list,

I have a memory leak in a script or module, the problem is that i've
resently added many scripts and modules and can't easily isolate the
problem. Is there a way besides strace to see what the httpd process is
up to?
 9869 httpd  0   0 21188  19M  2424 S   0 12.2  3.8   0:13 httpd
doesn't help me too much...

/Jon



Re: using mod_perl

2001-08-24 Thread Jon Molin

try looking at
http://perl.apache.org/

/jon

[EMAIL PROTECTED] wrote:
> 
> Hi! I am wondering if anyone could tell me how to actually run
> modperl on my webserver i have perl modules installed to run without
> modperl and dont know how to invoke the process to get them working
> can anyone help?
> jason



perlmagick and leaking memory

2001-08-21 Thread Jon Molin

Hi list,

I've done a scripts that builds an calender and colours the days with
different colours depending on the status of the day. I've got 6 colours
and one to just fill out so the month starts with the correct day, ie
i've got 6 * 31 + 1 = 187 images and each is about 70 bytes so a
calender is 6 times 7 of these little sqaures, about 3k. 

Now this little script handling this tiny amount of data runs amok and
grows and grows untill i restart apache brutaly, I guess I've done
something very wrong but I can't figure out what, nor can I find any
info about this. Here's what the program looks like:


my $image_obj = Image::Magick->new;
my $images = $image_obj->Read (@days); # an array with 49 filnames
my $montage = $image_obj->Montage (
   mode => 'Concatenate',
   background =>'#ff',
   tile => '7x7',
   frame => '1x1',
   gravity => 'center',
   );

$montage->Crop ('138x118'); #fixing the size

print "Content-Type: image/gif\n\n" ;
$montage->Write();# the image doesn't come out out unless i use Write
before
print $montage->ImageToBlob();

undef $montage;
undef $images;
undef $image_obj;


Anyone see any obvious mistakes?

I also tried putting this before the undef's but it didn't do any
difference:
for (my $i = 0; $i <= 48; $i++)
{
undef $image_obj->[$i];
}

/Jon



Apache::DBI

2000-11-13 Thread Jon Molin

I'm considering using Apache::DBI but before I'd want to benchmark to
see
if I gain anything. To do this I just made a script that
connects/disconnects
10 times. Then I tried running ab with -n 1. The output confused me
a bit
there where only 0.9 secs difference, and it was good old DBI who won,
without
Apache::DBI. 
Am I doing something wrong? I've added 'PerlModule Apache::DBI' in
httpd.conf and as I could understand it wasn't it nessicery to add
anything else...

/Jon