mod_perl 2 & apache 2?

2001-10-09 Thread Michael Wojcikiewicz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Has anyone tried getting mod_perl to work in Apache v2 (the latest
beta?)... Just a quick try resulted in mod_perl2 trying to compile against
apache 1.3.20... Wasnt mod_perl v2 supposed to be for Apache v2?...

Michael Wojcikiewicz
Perl Developer - Perl Pimps
W: http://www.perlpimps.com/
E: [EMAIL PROTECTED]
P: (514) 235-7900
F: (508) 546-0398


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.5 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7w1JOcQrQUtU6ZNoRAnd1AKDScL9pkf9GX2wPeoeTrRZ6bbwvyQCgsVE1
POR2lXWV7hak1Nf6D0nhquY=
=2TLd
-END PGP SIGNATURE-





Re: Apache VMonitor

2001-10-09 Thread Jason Boxman

On Tuesday 09 October 2001 06:08 am, you wrote:
> Jason Boxman wrote:
> > Hey all!
> >

> Jason,
>
> Since you've already tried to look at the code and play with it, it's
> not a VMonitor's issue, but the Scoreboard's one. I'm running all the
> latest -dev versions of modperl/apache and it works for me.

Yeah, it didn't look like a VMonitor problem.

> > (loading /scoreboard returns three spaces to my browser and nothing
> > else.)
>
> cauze, it returns a *binary* image. Try to grab it instead. On my setup
> it's about 538 bytes long (depends on how many children are running and
> other info, but should be definitely 100+ bytes). Try:
>
>  % lynx --dump http://localhost/status/scoreboard > the_score

Here where it gets weird.  I got a single line of white space, that's it.

jasonb@nebula:~$ lynx --dump http://localhost/scoreboard > the_score
-rw-r--r--1 jasonb   jasonb  8 Oct  9 14:59 the_score

Not quite sure how I could have screwed up installing Scoreboard.

I ran

perl Makefile.PL PREFIX=$HOME
make
make install

No errors at all.

My httpd.conf is setup for Scoreboard as shown in my original email.

Did I mess that up?  Is everyone else's different?

Thanks.

(Basically from the POD docs.)

 
  SetHandler perl-script
  PerlHandler Apache::Scoreboard::send
  order deny,allow
  deny from all
  #same config you have for mod_status
  allow from 127.0.0.1
  allow from 192.168.0.0/255.255.255.0
  





[request] modperl mailing lists searchable archives wanted

2001-10-09 Thread Stas Bekman

Hi folks,

We need your help. There are dozens of [EMAIL PROTECTED] mailing list 
archives, but just a few or none at all of the other modperl lists. Some 
archives are browsable, but their search engines simply suck. e.g. 
marc.theaimsgroup.com I think is the only one that archives 
[EMAIL PROTECTED], but if you try to seach for perl string like 
APR::Table::FETCH it won't find anything. If you search for
get_dir_config it will split it into 'get', 'dir', 'config' and give you 
a zillion matches when you know that there are just a few.

So far http://forum.swarthmore.edu/epigone/modperl has the best search 
engine:

- you can search for anything as is
- makes it easy to link to threads
- relatively fast most of the time

I wish they were archiving other modperl lists :(

I've just updated the archives list at 
http://perl.apache.org/#maillists, so here is what we have:

dev@@perl.apache.org - 2.5, but their search engines suck
[EMAIL PROTECTED] - none
[EMAIL PROTECTED] - none
[EMAIL PROTECTED]  - none
[EMAIL PROTECTED]   - 1

If you maintain an archive, with a good search engine or know someone 
who does, please add these lists to the archives. You can pull older 
mbox-file style archives from: http://perl.apache.org/mail/

Please try to send links only for good archives with good search engines.

Thanks a bunch!

_
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/




Apache VMonitor

2001-10-09 Thread Jason Boxman

Hey all!

I'm actually not sure if this is a VMonitor issue or a Scoreboard issue, but 
here's my situation.

I compiled and installed Scoreboard, GTop, and VMonitor.  I load VMonitor in 
my startup.pl file as shown below:

(... Or to jump to the point, the reason for my post is my VMonitor output 
for Apache only shows partial information for the parent process and no 
information for my running children... See config info and output below:)

use lib qw( /home/jasonb/src/webzeus /home/jasonb/local/lib/perl/5.6.1 );
use Apache::Scoreboard ();
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(mysql apache);

I'm running Debian GNU/Linux Woody with Sid's Apache:

[Mon Oct  8 19:30:12 2001] [notice] Apache/1.3.20 (Unix) Debian/GNU 
mod_perl/1.25 configured -- resuming normal operations

My VMonitor config in httpd.conf is as follows:

  
  SetHandler perl-script
  PerlHandler Apache::VMonitor
  

  
  SetHandler perl-script
  PerlHandler Apache::Scoreboard::send
  order deny,allow
  deny from all
  #same config you have for mod_status
  allow from 127.0.0.1
  allow from 192.168.0.0/255.255.255.0
  

(loading /scoreboard returns three spaces to my browser and nothing else.)

When I load /monitor it only returns the parent (par) Apache process and it 
doesn't show any child processes at all.  I've a dozen running, though.


 ##PID M Elapsed LastReq Srvd  Size Share VSize   Rss   Client
Request (first 64 chars)
par: 18987 .   8.3M  8.2M 10.1M  8.3M
Total:  8724K ( 8.3M) size,   8724K ( 8.3M) approx real size (-shared)


##   PID UID   Size Share VSize   Rss TTY  St  Command
 1 18987 root  8.3M  8.2M   10M  8.3M  S   apache 
 2 18988 www-data  8.5M  7.8M   10M  8.5M  R   apache 
 3 18989 www-data  8.4M  8.2M   10M  8.4M  S   apache 
 4 18990 www-data  8.4M  8.2M   10M  8.4M  S   apache
. other httpds 

I hunted through the VMonitor.pm code, just to see if I could figure out 
what's going on...

for (my $i=-1; $iparent($i)->pid;
last unless $pid;
my $proc_mem  = $gtop->proc_mem($pid);
my $size  = $proc_mem->size($pid);

I commented out the "last unless $pid" and printed out $i.  It went through 
256 increments, but the output above remained the same.  It seems like my 
Apache::Scoreboard isn't setup properly.

If anyone has any thoughts, I'd appreciate the help.  VMonitor is a sweet 
module I'd let to get working fully.

Thanks!

-Jason




Re: [request] modperl mailing lists searchable archives wanted

2001-10-09 Thread Stas Bekman

Elizabeth Mattijsen wrote:

> At 05:59 PM 10/9/01 +0800, Stas Bekman wrote:
> 
>> Please try to send links only for good archives with good search engines.
>> Thanks a bunch!
> 
> 
> Still in beta phase, and only containing Perl newsgroups, it nonetheless 
> might be interesting to check out:
> 
>   
> http://news.search.nl/style/search.en/read/category/Programming_Languages 
> http://news.search.nl/style/search.en/read/category/Programming_Languages/Pe 
> rl/list/page1.html
> 
> Currently refreshed 4 times a day, with searching being refreshed once a 
> day.
> 
> The site actually runs ModPerl with Matt Sergeant's LibXML and LibXSLT 
> modules.


That's cool, but I've asked for the links with modperl-foo lists 
archives that I've listed in my original post (we have enough archives 
of the modperl list itself).

Thanks, Elizabeth




-- 


_
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/




Re: [request] modperl mailing lists searchable archives wanted

2001-10-09 Thread Stas Bekman

Geoffrey Young wrote:

>>I've just updated the archives list at 
>>http://perl.apache.org/#maillists, so here is what we have:
>>
>>dev@@perl.apache.org - 2.5, but their search engines suck
>>[EMAIL PROTECTED] - none
>>[EMAIL PROTECTED] - none
>>[EMAIL PROTECTED]  - none
>>[EMAIL PROTECTED]   - 1
>>
> 
> as far as I know, nobody is archiving [EMAIL PROTECTED] either,
> which is also of interest to us mod_perl folks :)

At least: http://www.apachelabs.org/test-dev/

I'll add this link.

_
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/




Both global hanlder and cgi scripts

2001-10-09 Thread Mat

Hi everybody,

   actually i'm working on a website where I want to have the following 
possibilities :
   - a global handler that will treat a request hitting 
http://myhost.com/
   - the ability to have execution of separate cgi scripts like 
http://myhost.com/script.cgi

   I have the following configuration in httpd.conf :
(the AddHandler cgi-script .cgi is set)


   ServerAdmin [EMAIL PROTECTED]
   ServerName  www.myhost.com
   DocumentRoot/home/webmaster/www/myhost.com

   ErrorLog/usr/local/apache/logs/error.log
   CustomLog   /usr/local/apache/logs/access.log common

   ## mod_perl stuff
   PerlTaintCheck  Off
   PerlFreshRestartOn
   PerlRequire /home/webmaster/scripts/startup.pl

   ## allow cgi's here and there
   
   PerlSendHeader Off
   PerlHandler Apache::Registry
   SetHandler perl-script
   Options +ExecCGI
   


   ## handler stuff for the index
   
   SetHandler  perl-script
   PerlHandler TOL::Index
   



so when the "/" is hit my module takes over and display the page 
perfectly. But when  I try to call the cgi scripts, it displays my code 
and doesn't execute it.

I searched the archive for this problem and found the following post 
http://groups.yahoo.com/group/modperl/message/33720 which talks about 
using FilesMatch, I tried but it didn't work.

I'd like not to use a specific directory to put my scripts in (with 
Alias or Script Alias directives) and like to know if there is a simple 
of doing what i want.

Thanks.

   Mat

ps: i'm using apache 1.3.20, mod_perl 1.26, perl 5.6.1, no messages in 
error logs.




Re: [request] modperl mailing lists searchable archives wanted

2001-10-09 Thread Elizabeth Mattijsen

At 05:59 PM 10/9/01 +0800, Stas Bekman wrote:
>Please try to send links only for good archives with good search engines.
>Thanks a bunch!

Still in beta phase, and only containing Perl newsgroups, it nonetheless 
might be interesting to check out:

   http://news.search.nl/style/search.en/read/category/Programming_Languages 
http://news.search.nl/style/search.en/read/category/Programming_Languages/Pe 
rl/list/page1.html

Currently refreshed 4 times a day, with searching being refreshed once a day.

The site actually runs ModPerl with Matt Sergeant's LibXML and LibXSLT modules.




Elizabeth Mattijsen

Note: I am the main developer of this website, so I am prejudiced  ;-)




Re: Redirections after printing content

2001-10-09 Thread Andrew Ho

Hans,

HP>I'am new to the list, and i've been looking for a solution for
HP>buffering, in order to decide to make a redirect after the printing of
HP>HTML content. It seems that $| don't work fot this.

Whether or not you have $| on, you will want to explicitly control whether
output is sent if you may want to do a redirect at some point in your
code. There are two simple ways to rearrange your code to do this from a
mod_perl handler or Apache::Registry scripts.

The first is to determine what all the cases are where you would do a
redirect. Then put this code up front, before you output anything.

The second method would be to organize your code so that instead of using
print or calling $r->print(), you accumulate your output into a variable.
At the end of your handler() or Apache::Registry script, you can either
redirect, or print the accumulated output.

Humbly,

Andrew

--
Andrew Ho   http://www.tellme.com/   [EMAIL PROTECTED]
Engineer   [EMAIL PROTECTED]  Voice 650-930-9062
Tellme Networks, Inc.   1-800-555-TELLFax 650-930-9101
--




Re: how to catch a killed task?

2001-10-09 Thread Christoph Bergmann

Perrin Harkins wrote:
> 
> > Perrin Harkins wrote:
> > >
> > > I believe the limiting done by BSD::Resource is pretty harsh and may
> > > actually be at the kernel level.  I don't think you can catch the signal
> and
> > > deal with it yourself.  What you should do is use Apache::SizeLimit to
> > > handle your size constraints, and just use BSD::Resource for extreme
> cases,
> > > i.e. out of control servers in tight loops.
> > >
> >
> > Thanks for your answer, but (I think) I need BSD::Resource because I
> > allow users to write their own scripts (executed with reval from the
> > Safe-Module) and they can write infinite loops or consume memory as they
> > want - Apache::SizeLimit is not harsh enough for this ;-)
> 
> Correct, which is why I said to use both.  SizeLimit catches normal growth,
> and BSD::Resource catches emergencies.  You set the limit for BSD::Resource
> higher than the one for SizeLimit.
> - Perrin

Oops, sorry, I overlooked that. Yes that makes sense...

Best regards,

Christoph Bergmann



RE: [request] modperl mailing lists searchable archives wanted

2001-10-09 Thread Geoffrey Young


> 
> I've just updated the archives list at 
> http://perl.apache.org/#maillists, so here is what we have:
> 
> dev@@perl.apache.org - 2.5, but their search engines suck
> [EMAIL PROTECTED] - none
> [EMAIL PROTECTED] - none
> [EMAIL PROTECTED]  - none
> [EMAIL PROTECTED]   - 1

as far as I know, nobody is archiving [EMAIL PROTECTED] either,
which is also of interest to us mod_perl folks :)

--Geoff



Re: What hourly rate to charge for programming?

2001-10-09 Thread Daniel Aldham

> Hello,
> Many factors are to be taken into account to establish a base line.
> As you say, experience is one. It determines the experience
> you will provide your client with: your ability to solve
> their problems, to meet their requirements, to react to constraints, be technical or
> not, to innovate, etc...
> 
[snip]

I agree experience should be a factor. But more important is your personal
workload. I typically charge $100/hr, and get it. I have a few customers 
that think this is too high. I have told a couple that I will work
for $75 or $80, when I have the time. So if work is slow, I work
for the lower rate. When I have more work than I can handle, I only
work for $100, and the $75 /hr clients have to wait. They don't like
it, but hey, that's how the market economy works. I don't especially
like working for $75 either, but will take the work if that is all I 
have. 


-- 
Danny Aldham Providing Certified Internetworking Solutions to Business
www.postino.com  E-Mail, Web Servers, Web Databases, SQL PHP & Perl



Re: how to catch a killed task?

2001-10-09 Thread Christoph Bergmann

Stas Bekman wrote:
> 
> Christoph Bergmann wrote:
> 
> > hi...
> >
> > i use BSD::Resource to limit the ressources of the apache tasks. this
> > works fine but now i want to clean up afterwards but i don't know how to
> > catch a killed task... here is what i tried with signals:
> >
> > ...
> >
> 
> Does the following help? (Look at the register_cleanup method)
> 
> http://thingy.kcilink.com/modperlguide/debug/Safe_Resource_Locking_and_Cleanu.html
> 

thanks, this works. while playing around with it I found $SIG{__DIE__}
in your mod_perl guide which fits even better to my needs (I have read
about the problems as well but I think its ok for me) because the
connection is still open and I can print out information about what has
happened.

one more question: after processing the sub given to $SIG{__DIE__}
apache prints out an "internal server error" - how can I avoid/suppress
this?


best regards,

christoph bergmann



Re: Redirections after printing content

2001-10-09 Thread Hans Poo

Andrew Ho wrote:

> Hans,
>
> HP>I'am new to the list, and i've been looking for a solution for
> HP>buffering, in order to decide to make a redirect after the printing of
> HP>HTML content. It seems that $| don't work fot this.
>
> Whether or not you have $| on, you will want to explicitly control whether
> output is sent if you may want to do a redirect at some point in your
> code. There are two simple ways to rearrange your code to do this from a
> mod_perl handler or Apache::Registry scripts.
>
> The first is to determine what all the cases are where you would do a
> redirect. Then put this code up front, before you output anything.
>
> The second method would be to organize your code so that instead of using
> print or calling $r->print(), you accumulate your output into a variable.
> At the end of your handler() or Apache::Registry script, you can either
> redirect, or print the accumulated output.
>
> Humbly,
>
> Andrew
>
> --
> Andrew Ho   http://www.tellme.com/   [EMAIL PROTECTED]
> Engineer   [EMAIL PROTECTED]  Voice 650-930-9062
> Tellme Networks, Inc.   1-800-555-TELLFax 650-930-9101
> --

Thank you Andrew

I was already aware of the solutions you gave me, and it's comfortable to
listen another programmer who seems exactly the same.

I was expecting to find something new inside mod_perl to do the job. Actually
i keep the redirection code in top of the application and it's not a clean
solution. Put a wraper around the print statement seems the cleaner solution
after all.

I don't want to reinvent the wheel and finally decided to use Apache::ASP
with it's buffering capabilities.

Hans Poo


begin:vcard 
n:Poo;Hans
tel;cell:09-3318955
tel;work:2327992
x-mozilla-html:FALSE
url:www.namb.cl
org:New Art Media & Business;System Administration
adr:;;El Bosque Sur 77 Of.1		;Santiago;RM;na;Chile
version:2.1
email;internet:[EMAIL PROTECTED]
x-mozilla-cpt:;0
fn:Hans Poo
end:vcard



Re: how to catch a killed task?

2001-10-09 Thread Perrin Harkins

> Perrin Harkins wrote:
> >
> > I believe the limiting done by BSD::Resource is pretty harsh and may
> > actually be at the kernel level.  I don't think you can catch the signal
and
> > deal with it yourself.  What you should do is use Apache::SizeLimit to
> > handle your size constraints, and just use BSD::Resource for extreme
cases,
> > i.e. out of control servers in tight loops.
> >
>
> Thanks for your answer, but (I think) I need BSD::Resource because I
> allow users to write their own scripts (executed with reval from the
> Safe-Module) and they can write infinite loops or consume memory as they
> want - Apache::SizeLimit is not harsh enough for this ;-)

Correct, which is why I said to use both.  SizeLimit catches normal growth,
and BSD::Resource catches emergencies.  You set the limit for BSD::Resource
higher than the one for SizeLimit.
- Perrin




Re: how to catch a killed task?

2001-10-09 Thread Christoph Bergmann

Perrin Harkins wrote:
> 
> I believe the limiting done by BSD::Resource is pretty harsh and may
> actually be at the kernel level.  I don't think you can catch the signal and
> deal with it yourself.  What you should do is use Apache::SizeLimit to
> handle your size constraints, and just use BSD::Resource for extreme cases,
> i.e. out of control servers in tight loops.
> 

Thanks for your answer, but (I think) I need BSD::Resource because I
allow users to write their own scripts (executed with reval from the
Safe-Module) and they can write infinite loops or consume memory as they
want - Apache::SizeLimit is not harsh enough for this ;-)

Best regards,

Christoph Bergmann



Re: [request] modperl mailing lists searchable archives wanted

2001-10-09 Thread Bill Moseley

Hi Stas,

I just updated the search site for Apache.org with a newer version of
swish.  The context highlighting is a bit silly, but that can be fixed.
I'm only caching the first 15K of text from each page for context
highlighting.

http://search.apache.org

It seems reasonably fast (it's not running under mod_perl currently, but
could -- if mod_perl was in that server ;).

It takes about eight or nine minutes to reindex ~35,000 docs on *.apache.org
so the mod_perl list (and others) shouldn't too much trouble, I'd think,
with smaller numbers and smaller content.

It doesn't do incremental indexing at this point, which is a draw back, but
indexing is so fast it normally doesn't matter (and there's an easy
work-around for something like a mailing list to pickup new messages as
they come in during the day).

Swish-e can also call a perl program which feeds docs to swish.  That makes
it easy to parse the email into fields for something like:

  http://swish-e.org/Discussion/search/swish.cgi

which looks a lot like the Apache search site...

But, what would be needed is a good threaded mail archiver, which there are
many to pick from, I'd expect.

>Some 
>archives are browsable, but their search engines simply suck. e.g. 
>marc.theaimsgroup.com I think is the only one that archives 
>[EMAIL PROTECTED], but if you try to seach for perl string like 
>APR::Table::FETCH it won't find anything. If you search for
>get_dir_config it will split it into 'get', 'dir', 'config' and give you 
>a zillion matches when you know that there are just a few.

On swish you could say ":" and "_" are part of words and those would index
as full words.  Or, just simply search for phrase: "get_dir_config" and it
would search for the phrase "get dir config" which would probably find what
you want.

Maybe : and _ are ok in words, but you have to think carefully about
others.  It's more flexible to split the words and use phrases in many cases.



Bill Moseley
mailto:[EMAIL PROTECTED]



Re: unsubscibe

2001-10-09 Thread Stas Bekman

Pavel Antonov wrote:

> unsubscibe


the unsubscrive instructions are in the mail headers of *every* message you receive 
from this list. even this one :)



_
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/




Re: Apache VMonitor

2001-10-09 Thread Stas Bekman

Jason Boxman wrote:

> Hey all!
> 
> I'm actually not sure if this is a VMonitor issue or a Scoreboard issue, but 
> here's my situation.


> (... Or to jump to the point, the reason for my post is my VMonitor output 
> for Apache only shows partial information for the parent process and no 
> information for my running children... See config info and output below:)


Jason,

Since you've already tried to look at the code and play with it, it's 
not a VMonitor's issue, but the Scoreboard's one. I'm running all the 
latest -dev versions of modperl/apache and it works for me.


> (loading /scoreboard returns three spaces to my browser and nothing else.)


cauze, it returns a *binary* image. Try to grab it instead. On my setup 
it's about 538 bytes long (depends on how many children are running and 
other info, but should be definitely 100+ bytes). Try:

 % lynx --dump http://localhost/status/scoreboard > the_score



> I hunted through the VMonitor.pm code, just to see if I could figure out 
> what's going on...
> 
> for (my $i=-1; $i # handle the parent case
> my $pid = ($i==-1) ? getppid() : $image->parent($i)->pid;
> last unless $pid;
> my $proc_mem  = $gtop->proc_mem($pid);
> my $size  = $proc_mem->size($pid);
> 
> I commented out the "last unless $pid" and printed out $i.  It went through 
> 256 increments, but the output above remained the same.  It seems like my 
> Apache::Scoreboard isn't setup properly.


As you can see you can write a simple script that will reproduce your 
bug outside of VMonitor.


> If anyone has any thoughts, I'd appreciate the help.  VMonitor is a sweet 
> module I'd let to get working fully.


:)

_
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/




unsubscibe

2001-10-09 Thread Pavel Antonov

unsubscibe