Re: mod_perl 2.x vs. mod_perl 1.x benchmarks

2002-09-19 Thread Ask Bjoern Hansen

On Wed, 18 Sep 2002, Josh Chamas wrote:

[...]
 So I run it again with ServerTokens Min, and get the same results. :)
 Still something different on the mod_perl headers, looks like mod_perl
 2.x is setting Content-Length where it didn't use to.

The details evade me, but I recall something about how the buckets
work in the httpd that makes httpd 2.0 always know (and set) the
Content-Length.

There was discussion about changing it; but I don't remember the
outcome.

(yes, it has (had?) some implications for how data can be streamed
from the proxy in such a setup, which was the reason for changing
it.  Indeed it could be that it was only affecting the proxy.  Did I
mention that I forgot the details?).  :-)


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




Not a subroutine name... (was Re: problem with $r-push_handlers())

2002-09-19 Thread Marcin Kasperski

  mod_perl_push_handlers: Not a subroutine name or CODE reference!

 I have observed similar problem myself. I got the same error when I
 wrote in my startup.pl
 
 Apache-push_handlers(PerlChildInitHandler,
 \MyApp::Main::on_child_init);
 
 when I replaced it with 
 
 Apache-push_handlers(PerlChildInitHandler,
 sub { MyApp::Main::on_child_init(); });
 
 it works as expected.

It is probably worth noting, that in my opinion the first syntax
should work and there is something wrong in mod_perl code...

Is it something 'well known' or 'by design'?



Upgrading frontend apache - is it worth it?

2002-09-19 Thread Marcin Kasperski

I use well known configuration 'thin apacheproxy proxying fat mod_perl
apache'. Currently I use apache1 and for now I do not plan upgrading
mod_perl server to apache2. But I think about upgrading the frontend
apache to apache2 - mainly because I hope that multithreaded proxy can
be a bit more efficient and less memory consuming than the
multiprocess proxy.

So the question: is it really worth doing? Has anyone performed
similar upgrade or compared proxying efficiency of apache1 with
apache2? Can the analysis be influenced by using proxy to decode SSL
too?

Thanks in advance for your replies.

-- 
( Marcin Kasperski   | For waterfall, milestones are commitments. For itera- )
( http://www.mk.w.pl |  tive development, they are decision points. (Martin) )
()
( Porady dla twrcw serwisw WWW: http://www.mk.w.pl/porady/porady_www  )



Error when making mod_perl

2002-09-19 Thread Christophe Mailhe

Hi,

I have a Warning when creating the Makefile from Makefile.pm :

* WARNING *

  mod_perl is unlikely to link with your libperl, suggestions:
*) Rebuild Perl with Configure -Accflags=+Z ...


* WARNING *


And then, I have an error message when I make mod_perl :



/usr/bin/ld -b -L/usr/local/lib \
 \
mod_perl.lo modperl_interp.lo modperl_tipool.lo 
modperl_log.lo 
modperl_config.lo modperl_cmd.lo modperl_options.lo modperl_ca
llback.lo modperl_handler.lo modperl_gtop.lo modperl_util.lo 
modperl_io.lo modperl_filter.lo modperl_bucket.lo modperl_mgv.lo 
modperl
_pcw.lo modperl_global.lo modperl_env.lo modperl_cgi.lo 
modperl_perl.lo 
modperl_perl_global.lo modperl_perl_pp.lo modperl_sys.lo modp
erl_hooks.lo modperl_directives.lo modperl_flags.lo 
modperl_xsinit.lo  
-E -B deferred   -L/usr/local/lib /usr/local/lib/perl5/5.8.0/P
A-RISC1.1/auto/DynaLoader/DynaLoader.a 
-L/usr/local/lib/perl5/5.8.0/PA-RISC1.1/CORE -lperl -lnsl -lnm -
lmalloc 
-ldld -lm -lc -lndir -
lcrypt -lsec \
-o mod_perl.so
/usr/bin/ld: DP relative code in file 
al/lib/perl5/5.8.0/PA-RISC1.1/auto/DynaLoader/DynaLoader.a
(DynaLoader.o) 
- shared libra
ry must be position
independent.  Use +z or +Z to recompile.
*** Error exit code 1

Stop.
*** Error exit code 1

Stop.

 

The thing is I have built perl 5.8.0 from source, using the following 
command :

 
Configure -d -e -Dcc=gcc -Dprefix=/usr/local useposix=true -
Accflags=+Z
 

Can someone help me here. I need this module working ASAP.

Many thanks,

Chris.






Information may be contained in this message which is legally privileged
and/or confidential. If you are not the addressee(s) legally indicated in
this message (or responsible for delivery of the message to such person),
you may not copy or deliver this message to anyone.  In such case, you
should destroy this message, and notify us immediately. Opinions,
conclusions and other information expressed in this message are not given or
endorsed by my employer unless otherwise indicated by an authorised
representative independent of this message.  Please note that neither my
employer nor I accept any responsibility for viruses and it is your
responsibility to scan attachments (if any). If you have received this
transmission in error it would be helpful if you could notify us as soon as
possible.



Re: mod_perl 2.x vs. mod_perl 1.x benchmarks

2002-09-19 Thread siberian

On the Apache 2.0 note, 2.0 breaks terribly when it has to 
proxy chunked data. It strips the chunk length and does 
not replace it with a Content-Length.

Bug is filed but no one in the Apache group seems to want 
to play with it :(

Just a warning for those of you who may potentially be 
doing proxy for chunked data.

John-

On Thu, 19 Sep 2002 01:47:39 -0700 (PDT)
  Ask Bjoern Hansen [EMAIL PROTECTED] wrote:
On Wed, 18 Sep 2002, Josh Chamas wrote:

[...]
 So I run it again with ServerTokens Min, and get the 
same results. :)
 Still something different on the mod_perl headers, looks 
like mod_perl
 2.x is setting Content-Length where it didn't use to.

The details evade me, but I recall something about how 
the buckets
work in the httpd that makes httpd 2.0 always know (and 
set) the
Content-Length.

There was discussion about changing it; but I don't 
remember the
outcome.

(yes, it has (had?) some implications for how data can be 
streamed
from the proxy in such a setup, which was the reason for 
changing
it.  Indeed it could be that it was only affecting the 
proxy.  Did I
mention that I forgot the details?).  :-)


  - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; 
do();





Re: When is Apache-server-log_error available?

2002-09-19 Thread Geoffrey Young



Ken Miller wrote:
 I'd like to write some status messages to the error_log during server
 startup.  So, I tried
 
 Apache-server-log_error( ... )
 
 but it doesn't work. This works fine in the child processes.  Is the log
 file not ready to write to during server startup?  Printing to STDERR does
 not work either.
 
 It's not that important, but I'd like to know regardless.

I'm not sure exactly of the mechanism here, but I know a few people 
have asked before.  from what I can tell, it seems like Apache binds 
stuff like warn() and the log functions to error_log between the first 
and second startups.  for instance, I have a bunch of warn() 
statements in my startup.pl:

warn ErrorLog , Apache-server-error_fname;

and the first pass sends them to STDERR, and the second pass goes to 
the error_log (at least that's how it appears to work).

I'm not sure how Apache-server-log_error is supposed to work here, 
but there is some code in Apache.xs that errors error_log not open 
yet under certain conditions.

at any rate, warn() should be able to work for you.

HTH

--Geoff




possibly [OT] - changing the handler for a directory

2002-09-19 Thread iudicium ferat

OK, this may be OT for this list, but the system and possible 
resolution surrounds mod_perl:


I am looking at a system that an educational vendor wrote (I cannot 
say which vendor - they may be watching this list. ;)

Anyhow, the Apache/mod_perl server sends out a note stating that 
the remote client MUST support cookies and JS; but I have a system 
monitor (from another vendor :P  which does not do cookies or JS.

The goal is to override the default behavior of the first system - 
which keeps telling the second system it needs to accept cookies 
and do JS - am I braindead?  If there is a solution it has escaped 
me.

Right now the first system sends out 6,000 bytes just to say the 
monitoring system doesn't support cookies or JS -- that cannot be 
changed because the error message is needed for normal web browsers.

Any suggestions?
-Sx- ???




PerlRun and text/xml data: zero bytes

2002-09-19 Thread Scott Nelson

I am having problems reading standard input while running under PerlRun. 
I am trying to use text/xml data POSTed to an url, as opposed to form-data.

I get the data when running in CGI mode, but I get zero bytes when 
running in PerlRun mode. How do I read the data POSTed to the URL?

I have isolated my problem down to this short script:

#! /usr/bin/perl -w

use strict;
use diagnostics;
use XML::LibXML;

my $parser = XML::LibXML-new();
my input = ;
my $input = join(\n, input);
#my $doc = $parser-parse_string($input);
#my $plainText = $doc-toString();
my $plainText = $input;
my $length = length($plainText);

print Content-type: text/plain\n;
print Content-length: $length\n;
print \n;
print $plainText;

The content length is 0!




Re: possibly [OT] - changing the handler for a directory

2002-09-19 Thread iudicium ferat

Also, I almost forgot -

It send out this 6,000 byte error page even if I try to get 
/sever-status

Thx/Sx :]


 Right now the first system sends out 6,000 bytes just to say the 
 monitoring system doesn't support cookies or JS -- that cannot be 
 changed because the error message is needed for normal web 
 browsers.





Re: PerlRun and text/xml data: zero bytes

2002-09-19 Thread Scott Nelson

Jon wrote:

I guess you've checked that $plainText isn't of length 0?

/Jon

Well, I read standard input into $input, copy it into $plainText and 
check the length and it is 0. That is my problem: when I run using 
PerlRun it is 0 but I works without a problem when running in CGI mode...




/usr/sbin/apachectl: line 198: 12577 Segmentation fault $HTTPD -t

2002-09-19 Thread Andrew G. Hammond

I'm trying to use some modules I wrote through PerlModule in httpd.conf

The modules are tested and correct.  They appear to work when they're
auto-loaded.  However, I wish to load them on startup of the web server.
When I add the following line to my httpd.conf:

PerlModule Bounce::Handler

and attempt to apachectl configtest I get:

/usr/sbin/apachectl: line 198: 12577 Segmentation fault  $HTTPD -t

Any suggestions about what I might have done wrong?

Thanks,
Drew




Re: /usr/sbin/apachectl: line 198: 12577 Segmentation fault $HTTPD -t

2002-09-19 Thread Marcin Kasperski

Andrew G. Hammond [EMAIL PROTECTED] writes:

 I'm trying to use some modules I wrote through PerlModule in httpd.conf
 
 The modules are tested and correct.  They appear to work when they're
 auto-loaded.  However, I wish to load them on startup of the web server.
 When I add the following line to my httpd.conf:
 
 PerlModule Bounce::Handler
 
 and attempt to apachectl configtest I get:
 
 /usr/sbin/apachectl: line 198: 12577 Segmentation fault  $HTTPD -t
 
 Any suggestions about what I might have done wrong?

Modules loaded in startup.pl are initialized once in the parent
process instead of being initialized in each of the child
processess...

The question is: which modules do you use.


-- 
( Marcin Kasperski   | You have the right to peace, fun, and productive  )
( http://www.mk.w.pl |and enjoyable work. (Beck) )
()
( Sztuczki i kruczki w C++: http://www.mk.w.pl/porady/porady_cplusplus   )



Re: Upgrading frontend apache - is it worth it?

2002-09-19 Thread Ask Bjoern Hansen

On 19 Sep 2002, Marcin Kasperski wrote:

[upgrade front end proxy to apache 2.x]
 So the question: is it really worth doing?

Because of the ProxyPreserveHost option it is easier to configure
than the 1.x setup.

http://develooper.com/modperl/performance_tuning.html#x59

You can probably get it done without too much work; so then it is
probably worth it.


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();




[NEWBIE] problem with module

2002-09-19 Thread funkaster

Hi,
I'm new to mod_perl and I'm trying to port a web application I had 
running using java-servlets to perl (becouse I'm running a server on 
a very old machine, and mod_perl is giving me excelent speeds). I've 
read the mod_perl guide, specifically the section 5 (the mod_perl 
guidelines), but I'm still having problems. It's a simple web-forum 
(bbs) using DBI to access a mysql database.
I have two files:

index.perl - in a web directory
AALC.pm - in /var/www/perllib

This is my startup.pl file:
--
use strict;
use lib /var/www/perllib;
$ENV{GATEWAY_INTERFACE} =~ /^CGI-Perl/ or die GATEWAY_INTERFACE not Perl!;
use Apache::Registry ();
use CGI (); CGI-compile(':all');
use CGI::Carp ();
use DBI ();
use DBD::mysql ();
1;
--
In AALC.pm (which defines the package AALC) I've defined some global 
variables and all of my methods (display info, query the database, 
open files, etc). This is index.perl:
--
use AALC;
my $q = CGI-new or die $aalc_text{'eruk'};
my $forum_id = defined($q-param('forum')) ? $q-param('forum') : ;
my $msg_id   = defined($q-param('msg_id')) ? $q-param('msg_id') : 0;

print $q-header('text/html');
if ($msg_id  0)
{
   AALC-show_message($msg_id);
   return;
}
if ($forum_id ne )
{
   AALC-show_forum($forum_id);
   return;
}
AALC-list_forums();
--
The problem I'm facing right now is that it works the first time. But 
the second time I make a request to the database (when I pass a 
$msg_id parameter) it won't work (it's like it's reading a wrong 
parameter or not accessing the database). If I try to modify the 
module AALC.pm (which has a 'use Apache::Reload', to not restart the 
server each time) it dies with this error:

[error] Too many arguments for AALC::display_error at 
/var/www/perllib/AALC.pm line 28, near })

which is stupid, because I didn't modify that line, and it was 
working fine. This is line 28:

$sth = $dbh-prepare($query) or display_error($aalc_text{erbd});

In AALC.pm $query, $dbh, $sth and two other variables are defined as 
locals (with 'my'). I just don't know what to do or where to start 
looking for the error. Can anyone please point me in the right 
direction?
thanks a lot,
-- 
Rolando Abarca
Estudiante Injenieria U. de Chile
rabarca (at) ing.uchile.cl - funk (at) andatealachucha.cl



POST problems

2002-09-19 Thread Corey Durward

Hi all.

Having a curious problem with the POST command with all CGI scripts on a
particular server (Apache/1.3.14 (Unix) (Red-Hat/Linux) DAV/1.0.2 PHP/4.0.6
mod_perl/1.24). Basically, it doesn't work. Form inputs are treated as
though the inputs were blank. It doesn't appear to be a permissions error as
no error reports are issued and nothing appears in the error log. GET still
works.

Everything was working fine up until a few weeks ago. The server admin
claims nothing has been modified in that time (I'm skeptical) and is
clueless as to the cause. I've scoured httpd.conf and haven't found anything
obvious there that might cause this.

Fishing for a clue. Any suggestions appreciated.

Corey.