Re: Apache::Request

2000-04-11 Thread John S. Evans

I'm using Solaris (SunOS 5.7, according to uname).

The number of files varies, and I can control this if I know what the limits
are.  Is the 256 limit per process or for the entire machine?  For instance,
if I have 10 apache children going full bore, is the practical limit 25 per
child, or 256 per child?

I saw (in the code) that there's one open file per uploaded file.  That
should be fine.  I just need to find out if they're getting closed
correctly.

What is "lsof"?

Thanks!

-jse

> From: Doug MacEachern <[EMAIL PROTECTED]>
> Date: Tue, 11 Apr 2000 21:26:19 -0700 (PDT)
> To: "John S. Evans" <[EMAIL PROTECTED]>
> Cc: modperl <[EMAIL PROTECTED]>
> Subject: Re: Apache::Request
> 
> On Mon, 10 Apr 2000, John S. Evans wrote:
> 
>> I'm looking for some help/advice with Apache::Request.  I'm currently using
>> Apache::Request to parse the POST that is used to upload a bunch of files to
>> our server.
> 
> how many files?  what os are you using?  solaris has a 256 limit.
> 
>> The problem I'm running into is that I seem to be running out of file
>> descriptors over a long period of time, if a large number of files (between
>> 50 and 200) are posted at once.
> 
> there will be an open FILE* for each file uploaded in a given request,
> none of which are closed until the request is over.  try using lsof to see
> if any of them are not being closed after the request is done.
> 




Re: memory leak during server graceful restarts

2000-04-11 Thread Nikki Chumakov

Doug MacEachern wrote:

> On Fri, 7 Apr 2000, Nikki Chumakov wrote:
>
> > mod_perl probaly have memory leakage during rereading configs (e.g. on
> > the apachectl graceful)
>
> do you have PerlFreshRestart On?  if so, try turning it off.  i think dso
> leaks on restart too, try linking static if that's the problem.  a static
> httpd that doesn't have PerlFreshRestart On doesn't run any Perl code, so
> it can't leak.  unless you have  sections in httpd.conf, do you?

Well, actually I checked without any perl_mod specific config statements in httpd.conf 
and without any http requests. With LoadModule/AddModule mod_perl the server grows in 
size during every reload, and doesn't grow with AddModule mod_perl commented out.

So, this is apparently mod_perl DSO problem, that happens before compiling any Perl 
code.






Re: missing modules/perl/libperl.a

2000-04-11 Thread Todd Finney

At 11:49 PM 4/11/00 , Doug MacEachern wrote:
>On Thu, 6 Apr 2000, Todd Finney wrote:
>
>> I'm attempting to recompile Stronghold with mod_perl, and I've run into a
>> problem that no set of instructions (that I've seen) seem to help with.
 Any
>> assistance/advice/RTFMs would be appreciated.
>> 
>> mod_perl 1.21
>> Stronghold 2.42 glibc2.1 build 2412
>> Perl 5.005_03
>> 
>> This system has an existing mod_perl enabled httpd that I compiled with no 
>> problems.   It is also 1.21, with apache 1.3.9.  I'd rather not poon that
>> instance while creating this one.
>
>with the same Perl version or an older one?

It's the same version of Perl.  

>> In file included from mod_perl.h:41,
>>  from mod_perl.c:60:
>> /usr/lib/perl5/5.00503/i686-linux/CORE/perl.h:2546: redefinition of `union
>> semun'
>> /usr/lib/perl5/5.00503/i686-linux/CORE/patchlevel.h:41: warning:
>> `local_patches' defined but not use
>
>what kernel/distribution are you using?  this same problem has come up
>with older 2.0.x kernels, i'm told upgrades have cured.

It's a RH6.(mumble) distribution, with a fairly recent SMP kernel.  

A couple of days after I posted my last message regarding this, I got it to
compile.  It would appear that the problem was the underscore in the
USE_APACI call in my Makefile.pl line:

perl Makefile.PL APACHE_PREFIX=/usr/local/apache-strong/
APACHE_SRC=/usr/local/apache-strong/ \
DO_HTTPD=1 \
USE_APACI=1 \
EVERYTHING=1 \
PREP_HTTPD=1

The guide seems to waver on the hyphen vs. underscore but this did the trick:

perl Makefile.PL APACHE_PREFIX=/usr/local/apache-strong/ \
 APACHE_SRC=../../apache-strong/src/  \
USE-APACI=1 \
APACI-ARGS=--prefix=/usr/local/apache-strong/ \
DO_HTTPD=1 \
EVERYTHING=1 \
PREP_HTTPD=1

In looking at this now, I think that my call to APACI-ARGS is redundant
when used with the APACHE_PREFIX argument.   At any rate, it worked and the
server is performing as advertised.

Thank you very much for getting back to me, Doug.

cheers,
Todd Finney




 



Re: Error compiling mod_perl

2000-04-11 Thread Doug MacEachern

On Tue, 11 Apr 2000, Sam Carleton wrote:

> This is the error message I got when I compiled mod_perl:
> 
> Perl lib version (5.00503) doesn't match executable version (5.006) at
> /usr/lib/perl5/5.00503/i586-linux/Config.pm line 7.

you either installed a new Perl after running mod_perl's Makefile.PL or
have a broken Perl installation.  try building mod_perl from a fresh
source tree.




Re: memory leak during server graceful restarts

2000-04-11 Thread Doug MacEachern

On Fri, 7 Apr 2000, Nikki Chumakov wrote:

> mod_perl probaly have memory leakage during rereading configs (e.g. on
> the apachectl graceful)

do you have PerlFreshRestart On?  if so, try turning it off.  i think dso
leaks on restart too, try linking static if that's the problem.  a static
httpd that doesn't have PerlFreshRestart On doesn't run any Perl code, so
it can't leak.  unless you have  sections in httpd.conf, do you?




Re: Apache::Request

2000-04-11 Thread Doug MacEachern

On Mon, 10 Apr 2000, John S. Evans wrote:

> I'm looking for some help/advice with Apache::Request.  I'm currently using
> Apache::Request to parse the POST that is used to upload a bunch of files to
> our server.

how many files?  what os are you using?  solaris has a 256 limit.
 
> The problem I'm running into is that I seem to be running out of file
> descriptors over a long period of time, if a large number of files (between
> 50 and 200) are posted at once.

there will be an open FILE* for each file uploaded in a given request,
none of which are closed until the request is over.  try using lsof to see
if any of them are not being closed after the request is done.




Re: Can't locate object method "BINMODE" via package "Apache"

2000-04-11 Thread Doug MacEachern

On Tue, 11 Apr 2000, Ken Williams wrote:

> Change that to binmode(STDOUT) and it should work.  Since STDOUT is tied, I
> think Perl is interpreting that as STDOUT->binmode.

that's not the problem, see my reply to Roca.




Re: Can't locate object method "BINMODE" via package "Apache"

2000-04-11 Thread Doug MacEachern

On Tue, 11 Apr 2000, Roca, Ignasi wrote:

> I'm using mod_perl-1.21 and testing GD-1.25.
> 
> When calling any of the demos examples given by GD-1.25 I have the error
> 
> "Can't locate object method BINMODE via package Apache".

the mod_perl cvs snapshot defines a BINMODE stub (5.6.0 added this tied
filehandle method). you don't need that to cure, remove the call to
binmode or add this code to a startup file:

sub Apache::BINMODE {}





Re: Segfaults with RH6.1, mod_perl, perl 5.6.0, and apache 1.3.12

2000-04-11 Thread Doug MacEachern

On Mon, 10 Apr 2000, Benjamin Reed wrote:

> I'm getting segfaults with a RedHat 6.1 system.  I've tried mod_perl 1.22,
> as well as a CVS snapshot from today, and I pretty much get the same thing
> either way.  I would appreciate it if anyone could help me out on this, it's
> driving me nuts.

does 'make test' pass for you?  if so, we'll need more details on what
your server is doing, e.g. using XML::Parser?




Re: A better patch for Registry.pm

2000-04-11 Thread Doug MacEachern

On Mon, 10 Apr 2000, Tom Mornini wrote:

> 
> I missed an opportunity to set $r->notes('error-notes') if there was an
> error at compile-time. This patch includes both run-time and compile-time
> patches.

thanks tom.  the patch below will set error-notes for all Perl*Handlers.
$@ is also saved it $@{ $r->uri }, which was introduced before apache
started saving errors in $r->notes('error-notes')

--- src/modules/perl/mod_perl.c 2000/04/05 06:19:34 1.114
+++ src/modules/perl/mod_perl.c 2000/04/12 04:09:56
@@ -1635,6 +1635,9 @@
 if(perl_eval_ok(r->server) != OK) {
dTHRCTX;
MP_STORE_ERROR(r->uri, ERRSV);
+if (r->notes) {
+ap_table_set(r->notes, "error-notes", SvPVX(ERRSV));
+}
if(!perl_sv_is_http_code(ERRSV, &status))
status = SERVER_ERROR;
 }





Re: Apache::Cookie problems

2000-04-11 Thread Doug MacEachern

> 
> But while Recovering the Cookie I got some errors:
> 
> $cookie_ref = Apache::Cookie->fetch;

any difference if you change that to:
my $r = Apache->request;
my $cookies = Apache::Cookie->new($r)->parse;

?




Re: Core dump on startup

2000-04-11 Thread Doug MacEachern

On Sun, 9 Apr 2000, Robert Jenks wrote:

> I'm having problems with httpd core dumping during startup and have been
> completely unable to track it down.  Sometimes it will start up fine and
> other times it will core dump.  Any ideas, hints, etc.. would be GREATLY
> appreciated.

i see a mention of 'xmlFile' in your startup.pl, does that mean you're
using XML::Parser?  if so, try configuring Apache with:

RULE_EXPAT=no





Re: Apache::Registry error message?

2000-04-11 Thread Doug MacEachern

On Fri, 7 Apr 2000, Jason Terry wrote:

> Does anybody know how to track down what is causing this error.  It seems that 
>Apache::Registry is trying to undefine some handler,
> but I don't know what handler or where.  Any ideas?
> 
> 
>  [Thu Apr  6 11:06:26 2000] [error] Can't undef active subroutine at 
>/usr/lib/perl5/site_perl/5.005/i386-linux/Apache/Registry.pm
> line 102.

what version of mod_perl and Apache are you using?




RE: What phase am I in

2000-04-11 Thread Doug MacEachern

On Fri, 7 Apr 2000, Geoffrey Young wrote:

> of note, 1.21_01 introduced $r->notes('PERL_CUR_HOOK'), but why that was
> introduced when there is current_callback() I don't know (it's not in
> Changes as far as I can see)

that's related to this Change:
$r->current_callback now works properly when PerlHandler invokes
subrequests, thanks to James Smith for the spot

with that change, $r->current_callback is implemented using
$r->notes('PERL_CUR_HOOK'), which might change in the future, so stick
with $r->current_callback.





Re: $r->args troubles...

2000-04-11 Thread Doug MacEachern

On Fri, 7 Apr 2000, Jason Murphy wrote:
> Can't locate object method "new" via package "Apache::Request" at
> ./find_player.pl line 10.

that would normally indicate your script is running under mod_cgi, not
mod_perl.
 
> my $r = new Apache::Request;  <---Where the error appears

in any case, you need to change that to:

my $r = Apache::Request->new(shift);
or
my $r = Apache::Request->new(Apache->request);





Re: confusion between scripts

2000-04-11 Thread Doug MacEachern

On Thu, 6 Apr 2000, Marshall Dudley wrote:

> We have had banners servers running on 2 different boxes for years under
> mod_perl without any problems.  Recently we moved two banner servers
> onto the same box, each under a different virtual domain.
> 
> Now I cannot get them to run reliably.  It appears that since the
> banners in each are run as /cgi-bin/banner.pl, mod_perl is getting them
> mixed up, and we end up having the script fail with errors like that all
> kinds of things have been redefined, when they have not.

did you preload Apache::Registry in httpd.conf:

PerlModule Apache::Registry

?
that is reported to cure this problem.  the cvs version of mod_perl has a
fix so virtualhosts will not confuse Apache::Registry if it isn't
pre-loaded.




Re: missing modules/perl/libperl.a

2000-04-11 Thread Doug MacEachern

On Thu, 6 Apr 2000, Todd Finney wrote:

> I'm attempting to recompile Stronghold with mod_perl, and I've run into a
> problem that no set of instructions (that I've seen) seem to help with.   Any
> assistance/advice/RTFMs would be appreciated.
> 
> mod_perl 1.21
> Stronghold 2.42 glibc2.1 build 2412
> Perl 5.005_03
> 
> This system has an existing mod_perl enabled httpd that I compiled with no 
> problems.   It is also 1.21, with apache 1.3.9.  I'd rather not poon that
> instance while creating this one.

with the same Perl version or an older one?

> In file included from mod_perl.h:41,
>  from mod_perl.c:60:
> /usr/lib/perl5/5.00503/i686-linux/CORE/perl.h:2546: redefinition of `union
> semun'
> /usr/lib/perl5/5.00503/i686-linux/CORE/patchlevel.h:41: warning:
> `local_patches' defined but not use

what kernel/distribution are you using?  this same problem has come up
with older 2.0.x kernels, i'm told upgrades have cured.




Error compiling mod_perl

2000-04-11 Thread Sam Carleton

This is the error message I got when I compiled mod_perl:

Perl lib version (5.00503) doesn't match executable version (5.006) at
/usr/lib/perl5/5.00503/i586-linux/Config.pm line 7.
Compilation failed in require at
/usr/lib/perl5/5.00503/ExtUtils/MakeMaker.pm line 13.
BEGIN failed--compilation aborted at
/usr/lib/perl5/5.00503/ExtUtils/MakeMaker.pm line 13.
Compilation failed in require.
BEGIN failed--compilation aborted.
make: *** [Version_check] Error 255

How do I fix this?

Sam




Re: Avoiding redefining constant subs

2000-04-11 Thread Doug MacEachern

On Thu, 6 Apr 2000, Jeremy Howard wrote:

> Hi there,
> 
> I've been getting frustrated by the mandatory warning created by 'use
> constant' under mod_perl, caused by constant subroutines being redefined
> when imported. In particular, with Archive::Zip this was adding hundreds of
> lines to my log every restart.

what version of Perl are you using?
the mandatory constant-sub-redefined warning went away in 5.004_66:

[  1015] By: TimBunce  on 1998/05/19  20:07:01
Log: Title:  "loosen const sub re-defined warnings"
 From:  Doug MacEachern <[EMAIL PROTECTED]>
 Msg-ID:  <[EMAIL PROTECTED]>
 Files:  proto.h global.sym op.c pp.c sv.c
 Branch: maint-5.004/perl
   ! global.sym op.c pp.c proto.h sv.c




Re: Quick question re: mod_perl

2000-04-11 Thread Doug MacEachern

On Wed, 5 Apr 2000, Charles Aulds wrote:

> Doug,
> 
> Can you tell me with a simple response, are the modules shown on my status 
> page http://192.168.1.1/perl-status?inc all loaded by mod_perl when it starts?
> I have no PerlModule or PerlRequire directives in effect.

Apache.pm and Apache::Constants are loaded by default, which in turn pulls
in a few standard modules, Exporter, Carp, etc.




Re: which handler?!?

2000-04-11 Thread Doug MacEachern

On Wed, 5 Apr 2000, J. Horner wrote:

> I'm finally writing the web server intrusion system that I've planned for
> months.  I have the skeleton for the URI comparing handler, but I'm a
> little unclear where it should really go.
> 
> A handler is written to compare the URI against a source of known web
> server issues to alert the administrator to hacking attempts.  Should the
> handler be installed at the PerlPostReadRequestHandler phase or the
> PerlTransHandler phase.  The Eagle book says something like:
> 
> "It is called once per transaction and is intended to allow modules to
> step in and perform special processing on the incoming data", which is
> what I want, but it goes on to say, "However, because there's no way for
> modules to step in and actually contribute to the parsing of the HTTP
> header, this phase is more often  used just as a convenient place to do
> processing that must occur once per transaction."  
> 
> Is this last sentence not the negation that I read it to be?  It seems to
> me that it is telling me that I really can't write a handler to actually
> do something useful on the incoming request header.  

keyword is `parsing', once the HTTP request is parsed, you can modify the
$r->headers_in table in any phase.
 
> If I put the hander in at PerlTransHandler, it seems that I would
> interfere unnecessarily at the translation phase.  I just want a place to
> put it where it can take the request, run a regexp against a list of known
> issues to check for a match, then, if we return a false, go on with the
> parsing and file mapping.

you won't interfere if you return DECLINED from a PerlTransHandler.




Re: IO::File, mod_perl, and RedHat Secureweb

2000-04-11 Thread Doug MacEachern

On Wed, 5 Apr 2000, Joe Bowman wrote:

> Has anyone encountered the following problem?
> 
> I have a RedHat 6.0-based machine, using perl-5.00503,
> RedHat secureweb-3.1-2, and mod_perl 1.22. The problem I'm running into is
> that whenever I try to preload the IO::File module, secureweb segfaults.
> No error messages in error_log whatsoever. However, using IO::File outside
> of mod_perl (i.e. in a regular perl script run from the command line)
> works just fine.

what does 'perl -V:usemymalloc' say?  if 'y', try rebuilding Perl with
'Configure -des -Uusemymalloc', which is the default anyhow for linux.
another option is building mod_perl static instead of dso, assuming you
built as a dso?




Re: Turning off experimental threads in mod_perl

2000-04-11 Thread Doug MacEachern

On Tue, 4 Apr 2000, Chris Mason wrote:

> How do I keep mod_perl from trying to use the experimental thread
> feature in perl, even when I built perl with that option?  Is this
> possible?  See the build error that I get below.
> 
> I'm using mod_perl 1.22, perl 5.005_63, and apache 1.3.12.

try using Perl 5.005_03 or 5.6.0




Re: 1.22_01-dev: Modification of a read-only value ...

2000-04-11 Thread Doug MacEachern

On Wed, 5 Apr 2000, Oleg Bartunov wrote:
 
> Yes ! It works now after I add Apache::Table to my startup.pl

excellent.  Apache::Table is now loaded by default if it's enabled
(footprint is small), problem solved.




Re: Segfault on DBI->Connect

2000-04-11 Thread Doug MacEachern

this seems to becoming quite a common problem, i wonder if Jochen can shed
some light?

On Tue, 4 Apr 2000 [EMAIL PROTECTED] wrote:

> I've been seeing the same segfault-on-connect problem with Apache 1.2.12
> + mod_perl 1.22 + DBI 1.13 + Msql-Mysql-modules 1.2211.  The segfault is
> due to a null first argument being passed to mysql_real_connect().
> 
> Running Apache with a -X argument yields the following backtrace when my
> mod_perl module does a DBI->connect (str, username, passwd, { options }).
> Note the null mysql argument 
> |
> V
> #0  0x80ef5b7 in mysql_real_connect (mysql=0x0, 
> host=0x8a99db8 "hostname.brown.edu", user=0x8a9b550 "username", 
> passwd=0x8a9b568 "password", db=0x8a99e40 "databasename", port=3306, 
> unix_socket=0x0, client_flag=0) at libmysql.c:1125
> #1  0x402d01fd in mysql_dr_connect ()
>from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so
> #2  0x402d0540 in _MyLogin ()
>from /usr/lib/perl5/site_perl/5.005/i386-linux/auto/DBD/mysql/mysql.so
> 
> The mysql_real_connect routine does a set_sigpipe(mysql), which triggers
> the segfault.
> 
> This problem has only come up since I upgraded Apache/mod_perl from
> 1.3.9/1.21 to 1.3.12/1.22.
> 
> Richard Goerwitz
> 




Re: Apache::URI port() problem

2000-04-11 Thread Zeqing Xia


It works! Thanks so much!

Fred

Eric Cholet wrote:

> > Hello,
> >
> > It seems the method unparse() of Apache::URI does not take the port
> > value into the result string. For example, I have:
> >
> >  my $uri = Apache::URI->parse($r, $r->uri);
> >  $uri->scheme('http');
> >  $uri->hostname($r->get_server_name);
> >  $uri->port(8080);
> >  $uri->query(scalar $r->args);
> >
> > If I call $uri->unparse(), the string returned does not have port 8080
> > in it. Can anyone shed some light? Thanks.
> >
> > Fred Xia
>
> Can you try this patch?
>
> Index: URI.xs
> ===
> RCS file: /home/cvs/modperl/src/modules/perl/URI.xs,v
> retrieving revision 1.5
> diff -b -u -u -r1.5 URI.xs
> --- URI.xs  1998/11/13 03:27:52 1.5
> +++ URI.xs  2000/04/10 10:57:54
> @@ -183,6 +183,9 @@
>
>  CODE:
>  get_set_PVp(uri->uri.port_str,uri->pool);
> +if (items > 1) {
> +uri->uri.port = (int)SvIV(ST(1));
> +}
>
>  OUTPUT:
>  RETVAL
>
> --
> Eric
>




Re: Can't locate object method "BINMODE" via package "Apache"

2000-04-11 Thread Ken Williams

[EMAIL PROTECTED] (Roca, Ignasi) wrote:

>I'm using mod_perl-1.21 and testing GD-1.25.
>
>When calling any of the demos examples given by GD-1.25 I have the error
>
>"Can't locate object method BINMODE via package Apache".
>
>The perl scripts are as follows:
>
>#!/usr/local/bin/perl
>use GD;
>print "Content-type: image/png\n\n"
>$im = new GD::Image(100,50);
>
>binmode STDOUT;

Change that to binmode(STDOUT) and it should work.  Since STDOUT is tied, I
think Perl is interpreting that as STDOUT->binmode.






Thanks !

2000-04-11 Thread Harald Houppermans

Thanks everybody for helping me install 

The Apache Webserver 1.3.9 with mod_Perl 1.21 CGI support for windows 98.

The binary I used was downloaded from:
ftp://theoryx5.uwinnipeg.ca/pub/other/ 

filename:
perl-win32-bin-0.5.exe  ( about 10 meg )

The problem was that the ApacheModulePerl.dll did not load.

The solution is:

1) remove c:\apache, c:\perl, c:\openssl and unzip/install the distrobution again,
this way you get clean install again

2) copy c:\perl\PerlCRT.lib to c:\perl\5.00503\lib 
   copy c:\perl\PerlCRT.dll to c:\windows\system32

3) set PATH to something like 
PATH=%PATH%;"C:\ProgramFiles\Mts";"C:\ProgramFiles\DevStudio\VC\bin";
"C:\PERL\5.00503\BIN\MSWin32-x86";"C:\PERL\5.00503\BIN";c:\apache;C:\openssl\bin;

4) restart windows

5) now from the prompt you should get some answer to say 'perl -V' or
something similar

6) included configs are OK, you select the one with modperl and change
stuff the way you need it (for testing the server the default should be
ok, I usually change just DocRoot and add few virtual servers)
( make sure all the /apache are replaced with c:/apache )
( make sure all the @@ServerRoot@@ are replaced with c:/apache )

7) create a empty dir c:\apache\logs

8) start it with C:\Apache\Apache.exe (maybe you'll need something like
apache -d c:\apache)

9) you're done

10) enjoy ! :)

Thanks to Robert ([EMAIL PROTECTED]) for supplying this fantastic solution !
( I improved it a little bit :) )

Greetings

Harald

---
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]




Re: Bug#61231: mod_perl segfaults child-processes in combination with XML::Parser::Expat

2000-04-11 Thread Ardo van Rangelrooij

Hi!

Steve Dunham (thanks!!!)provided a patch which should take care of
this problem.  I've made a package available as

  http://master.debian.org/~ardo/libxml-parser-perl_2.27-3_i386.deb

Please try it out and let me know what's up.  If no problems occur
I'll upload it to master officially.

I'll also forward this problem to the man upstream, Clark Cooper.

Thanks,
Ardo

Daniel Jacobowitz <[EMAIL PROTECTED]> writes:

> reassign 61231 libxml-parser-perl
> thanks
> 
> And sure enough, the man is right.  This is not mod_perl's problem. 
> When I disable RULE_EXPAT, apache ceases crashing.
> 
> 
> On Tue, Apr 04, 2000 at 02:49:36PM -0700, Doug MacEachern wrote:
> > On Tue, 4 Apr 2000, Daniel Jacobowitz wrote:
> > 
> > > [mod_perl people - any comment?  Please keep the Cc: list to the Debian
> > > bug tracking system.]
> >  
> > > > When using the XML::Parser::Expat under mod_perl, this causes segmentation
> > > > faults (quite random?) in the child-processes of httpd.
> > > > The error message in the error.log of apache is:
> > > > "[notice] child pid 28177 exit signal Segmentation fault (11)"
> > 
> > yeah, try configuring Apache with:
> > RULE_EXPAT=no
> > 
> > otherwise, the symbols in XML::Parser clash with apache's.  i've suggested
> > several times that the XML::Parser author should consider making those
> > symbols static or use a different prefix, but no idea if that's happened
> > or not.
-- 
Ardo van Rangelrooij
home email: [EMAIL PROTECTED], [EMAIL PROTECTED]
home page:  http://home.flevonet.nl/~avrangel
PGP fp: 3B 1F 21 72 00 5C 3A 73  7F 72 DF D9 90 78 47 F9



Re: Apache::ASP and @INC

2000-04-11 Thread Mark T. Dame

"Mark T. Dame" wrote:
> 
> Hello all.
> 
> According to the docs for Apache::ASP
> (http://www.nodeworks.com/asp/config.html#Global), the Global directory
> and the IncludesDir directory will be added to @INC so you can 'use' and
> 'require' perl modules in these directories.  This doesn't seem to be
> working for me.
> 
> I have a simple ASP file:
> 
> 
> 
> Test
> 
> 
> 
> <%
>   use TestModule;
> 
>   my $r = Apache->request;
>   my $c = $r->connection;
> 
>   my $host = $c->remote_host;
>   my $user = $c->user;
> %>
> 
> Host: <%=$host%>
> User: <%=$user%>
> 
> 
> 
> 
> TestModule.pm is in /var/www/htdocs/asp.  This script fails with:
> 
> [Tue Apr 11 13:10:51 2000] [error] [asp] [12553] [error] Can't locate
> TestModule.pm in @INC (@INC contains: /var/www/perllib /var/www/perllib
> /var/www/perllib /usr/lib/perl5/5.00503/i386-linux
> /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux
> /usr/lib/perl5/site_perl/5.005 . /usr/local/ /usr/local/lib/perl) at
> (eval 187) line 8. <--> BEGIN failed--compilation aborted at (eval 187)
> line 8. <--> , /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 1180
> 
> If I add this right before the 'use TestModule;'
> 
> use lib "/var/www/htdocs/asp";
> 
> It works fine.
> 
> I'm using Apache::ASP version 0.18, perl 5.005_03, mod_perl 1.21, and
> Apache version 1.3.9.
> 
> Anyone have any ideas?

I guess I should have added my .htaccess file too.  Here's the relevant
part:

PerlSetVar Global /var/www/htdocs/asp
PerlSetVar StateDir /var/www/aspstate
PerlSetVar StateDB DB_File
PerlSetVar StatINC 1
PerlSetVar CookiePath /
PerlSetVar UseStrict 1


SetHandler perl-script
PerlHandler Apache::ASP



-m
-- 
## Mark T. Dame:  mailto:[EMAIL PROTECTED]
## WWW:  http://www.mfm.com/~mdame/
## MFM Communication Software:  http://www.mfm.com/
"The future has arrived; it's just not evenly distributed."
 -- William Gibson



Apache::ASP and @INC

2000-04-11 Thread Mark T. Dame

Hello all.

According to the docs for Apache::ASP
(http://www.nodeworks.com/asp/config.html#Global), the Global directory
and the IncludesDir directory will be added to @INC so you can 'use' and
'require' perl modules in these directories.  This doesn't seem to be
working for me.

I have a simple ASP file:



Test



<%
  use TestModule;

  my $r = Apache->request;
  my $c = $r->connection;

  my $host = $c->remote_host;
  my $user = $c->user;
%>

Host: <%=$host%>
User: <%=$user%>




TestModule.pm is in /var/www/htdocs/asp.  This script fails with:

[Tue Apr 11 13:10:51 2000] [error] [asp] [12553] [error] Can't locate
TestModule.pm in @INC (@INC contains: /var/www/perllib /var/www/perllib
/var/www/perllib /usr/lib/perl5/5.00503/i386-linux
/usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux
/usr/lib/perl5/site_perl/5.005 . /usr/local/ /usr/local/lib/perl) at
(eval 187) line 8. <--> BEGIN failed--compilation aborted at (eval 187)
line 8. <--> , /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 1180

If I add this right before the 'use TestModule;'

use lib "/var/www/htdocs/asp";

It works fine.

I'm using Apache::ASP version 0.18, perl 5.005_03, mod_perl 1.21, and
Apache version 1.3.9.

Anyone have any ideas?


-m
-- 
## Mark T. Dame:  mailto:[EMAIL PROTECTED]
## WWW:  http://www.mfm.com/~mdame/
## MFM Communication Software:  http://www.mfm.com/
"Our aim is to show the essential elements of the language in real 
 programs, but without getting bogged down in detail, rules, and 
 exceptions."
 -- The C Programming Language, Kernighan and Ritchie



Re: REDIRECT missing Cookie

2000-04-11 Thread Perrin Harkins

Jim Winstead wrote:
> 
> On Apr 08, Zeqing Xia wrote:
> > Hi,
> >
> > I'm having a problem with setting the cookie in a REDIRECT. Basically,
> > I'm doing this in a handler:
> >
> > $r->headers_out->add('Set-Cookie' => $cookie);
> > $r->headers_out->add('Location' => $location);
> > return REDIRECT;
> >
> > The $location is hit but the cookie is missing when I debug the handler
> > for $location.
> >
> > I have tried various remedies, such as no_cache(),
> > unset('Content-length'), etc. But nothing seems have effect.
> >
> > Can anyone point out what is the problem? Thanks so much.
> 
> This is a misfeature of some browsers. (Particular versions of
> Internet Explorer, if I remember correctly.)
> 
> Some people have reported success with some browsers depending on
> the order the headers appear, but the most bullet-proof solution
> is to do a redirect with a header or meta-tag refresh instead of
> an redirect. (Which is definitely not as user-friendly, but works
> for all cookie-enabled browsers that I've come across.)
> 
> So you'd want to do something like:
> 
>   $r->headers_out->add('Set-Cookie' => $cookie);
>   $r->headers_out->add('Refresh' => "0; url=$location");
>   $r->print("Sending you here.");
>   return OK;
> 
> Jim

You could also put the cookie info in the URL you redirect to (as a
query string), and make your handler look for it there if the cookie is
missing.

- Perrin



Re: Windows98 : ApacheModulePerl

2000-04-11 Thread Robert

Light Software wrote:
> 
> >Your Perl is probably not working right - every time I had this
> >problem
> 
> You are right ! thanks for this tip... i didn't know that perl
> has to work first... i mean i thought the dll was enough ?
... 
> So my apache directory is totally nuked... but now i receive
> another message saying is can't locate apache.pm or something
...

1) remove c:\apache, c:\perl, c:\openssl and unzip the distro again,
this way you get clean install again

2) copy PerlCRT.lib to c:\perl\5.00503\lib and PerlCRT.dll to
c:\windows\system32

3) set PATH to something like SET
PATH=.;C:\PERL\5~1.005\BIN\MSWIN3~1;C:\PERL\5~1.005\BIN;C:\VC;c:\apache;C:\openssl\bin;C:\PROGRA~1\F-SECURE\SSH3\PROGRAM;%PATH%

4) restart windows

5) now from the prompt you should get some answer to say 'perl -V' or
something similar

6) included configs are OK, you select the one with modperl and change
stuff the way you need it (for testing the server the default should be
ok, I usually change just DocRoot and add few virtual servers)

7) I seem to remember you have to create empty dir c:\apache\logs

8) start it with C:\Apache\Apache.exe (maybe you'll need something like
apache -d c:\apache)

9) you're done



Re: Windows98 : ApacheModulePerl

2000-04-11 Thread Robert

I replied to this via email but it doesn't seem to get throu.

Your Perl is probably not working right - every time I had this problem
it was because I forgot about dll/lib thing in the distro instalation or
got PATH wrong. Try command line perl first to see if it works at all.

- Robert


Light Software wrote:
> 
> Hi everybody,
> 
> I want to be able to run perl scripts on the apache web server.
> 
> Like printenv.
> 
> Apache wont run with the ApacheModulePerl.dll on windows 98.
> 
> Apache generates a error:
> 
> Syntax error on line 181 of c:/win apache/apache/conf/httpd.conf:
> Cannot load c:/win apache/apache/modules/ApacheModulePerl into server:
> 
> The text in httpd.conf at line 181:
> 
> LoadModule perl_module modules/ApacheModulePerl.dll
> 
> Does apache need this module ? ( ApacheModulePerl.dll )
> And if it does, how can I make it work ?
> 
> Greetings Harald
> __
> Get Your Private, Free Email at http://www.hotmail.com



Re: Apache::GzipChain

2000-04-11 Thread Rick Myers

On Apr 11, 2000 at 08:36:42 -0400, Paul G. Weiss twiddled the keys to say:
> I'm using Apache::RegistryNG to feed GzipChain.  But doesn't
> the chunking occur *after* GzipChain?  I've also tried
> Apache::Registry with the same results.

>From the Apache::GzipChain man page..

   GzipChain compresses every single buffer content it
   receives via the output chain separately according to the
   GZIP specification (RFC 1952). The compression ratio
   therefore suffers if the other module sends its data in
   very small chunks.

So apparently the browsers can't cope with multiple gzip'ed chunks. If
your send the content to GzipChain in one large hunk the problem goes
away.

Rick Myers[EMAIL PROTECTED]

The Feynman Problem   1) Write down the problem.
Solving Algorithm 2) Think real hard.
  3) Write down the answer.



RE: Apache::GzipChain

2000-04-11 Thread Paul G. Weiss

I'm using Apache::RegistryNG to feed GzipChain.  But doesn't
the chunking occur *after* GzipChain?  I've also tried
Apache::Registry with the same results.

-P

> -Original Message-
> From: Rick Myers [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 11, 2000 8:22 AM
> To: Paul G. Weiss
> Subject: Re: Apache::GzipChain
> 
> 
> On Apr 11, 2000 at 08:19:50 -0400, Rick Myers twiddled the 
> keys to say:
> > 
> > Your suspicion is correct. The problem however lies in 
> whatever module
> > your using to feed GzipChain. In my case it was 
> Apache::PassFile, which
> > sends in 16k chunks. Apache::PassHtml looks like it suffers from a
> > similar problem, but I've not tried it.
> 
> Whoops.. I'm a bit quick on the send button this morning.
> 
> Here's the patch for PassFile..
> 
> --- PassFile.pm.orig Fri Mar 31 05:18:32 2000
> +++ PassFile.pmFri Mar 31 05:10:39 2000
> @@ -30,9 +30,8 @@
>  my($buf,$read);
>  local $\;
> 
> +my $size = (stat _)[7];
>  while (){
> +  defined($read = sysread($fh, $buf, $size)) or return 
> SERVER_ERROR;
> -  defined($read = sysread($fh, $buf, $BUFFERSIZE)) or 
> return SERVER_ERROR;
>last unless $read;
>print $buf;
>  }
> 
> Rick Myers[EMAIL PROTECTED]
> 
> The Feynman Problem   1) Write down the problem.
> Solving Algorithm 2) Think real hard.
>   3) Write down the answer.
> 



Re: Apache::GzipChain

2000-04-11 Thread Rick Myers

On Apr 11, 2000 at 07:49:57 -0400, Paul G. Weiss twiddled the keys to say:
> I was playing around with this module and got strange
> results (both with MSIE 5.0 and Netscape 4.6).  The
> output is being sent chunked and when I do "view source"
> it appears that the browsers have not received the
> complete page.  I suspect that they are only reading
> up to the first "chunk".

Your suspicion is correct. The problem however lies in whatever module
your using to feed GzipChain. In my case it was Apache::PassFile, which
sends in 16k chunks. Apache::PassHtml looks like it suffers from a
similar problem, but I've not tried it.

Rick Myers[EMAIL PROTECTED]

The Feynman Problem   1) Write down the problem.
Solving Algorithm 2) Think real hard.
  3) Write down the answer.



Apache::GzipChain

2000-04-11 Thread Paul G. Weiss

I was playing around with this module and got strange
results (both with MSIE 5.0 and Netscape 4.6).  The
output is being sent chunked and when I do "view source"
it appears that the browsers have not received the
complete page.  I suspect that they are only reading
up to the first "chunk".

When I use lwp-download to read the page and then run
the contents (without the headers) through gunzip then
the complete page is indeed there.

Is there something to using this module that I'm missing?
Is there a way to force Apache to use Apache::GzipChain 
but not chunk the output?

-P



Re: Can't locate object method "BINMODE" via package "Apache"

2000-04-11 Thread Matt Sergeant

On Tue, 11 Apr 2000, Roca, Ignasi wrote:

> I'm using mod_perl-1.21 and testing GD-1.25.
> 
> When calling any of the demos examples given by GD-1.25 I have the error
> 
> "Can't locate object method BINMODE via package Apache".
> 
> The perl scripts are as follows:
> 
> #!/usr/local/bin/perl
> use GD;
> print "Content-type: image/png\n\n"
> $im = new GD::Image(100,50);
> ...
> binmode STDOUT;
> # print the image to stdout
> print $im->png;
> 
> 
> Is somebody knowing the reason of the error ? 

Yep, STDOUT is tied to the Apache class so that it outputs via the Apache
API. There should be no need to binmode it.

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org




Can't locate object method "BINMODE" via package "Apache"

2000-04-11 Thread Roca, Ignasi

I'm using mod_perl-1.21 and testing GD-1.25.

When calling any of the demos examples given by GD-1.25 I have the error

"Can't locate object method BINMODE via package Apache".

The perl scripts are as follows:

#!/usr/local/bin/perl
use GD;
print "Content-type: image/png\n\n"
$im = new GD::Image(100,50);
...
binmode STDOUT;
# print the image to stdout
print $im->png;


Is somebody knowing the reason of the error ? 

-- Ignasi Roca



Windows98 : ApacheModulePerl

2000-04-11 Thread Light Software

Hi everybody,

I want to be able to run perl scripts on the apache web server.

Like printenv.

Apache wont run with the ApacheModulePerl.dll on windows 98.

Apache generates a error:

Syntax error on line 181 of c:/win apache/apache/conf/httpd.conf:
Cannot load c:/win apache/apache/modules/ApacheModulePerl into server:

The text in httpd.conf at line 181:

LoadModule perl_module modules/ApacheModulePerl.dll

Does apache need this module ? ( ApacheModulePerl.dll )
And if it does, how can I make it work ?

Greetings Harald
__
Get Your Private, Free Email at http://www.hotmail.com