RE: handling eval in ePerl

2002-01-21 Thread Matt Sergeant

 -Original Message-
 From: Perrin Harkins [mailto:[EMAIL PROTECTED]]
 
  My problem is that die works fine as such but it conks out if done
  inside a eval.
 
 Okay, I missed the part about eval() before.  Take a look at this code
 from Parse::ePerl::Evaluate() :
 local $SIG{'__DIE__'}  = sub { $error .= $_[0]; };

Yuck. People really need to stay away from $SIG{__DIE__} unless they
*really* know what they're doing.

Matt.


This e-mail has been scanned for all viruses by Star Internet. The service is powered 
by MessageLabs. For more information on a proactive anti-virus service working around 
the clock, around the globe, visit: http://www.star.net.uk




RFC: Thumbnail generator

2002-01-21 Thread Issac Goldstand

I recently decided that Apache::Gallery is really nice if you want to 
sit down and start fiddling with templates, but that I needed to make a 
quick-easy version for myself.  The design is to be extremely simple, 
and is divided into two seperate modules.  The first is an on-the-fly 
thumbnail  generator (currently supports only jpeg), which is just a 
spiced up implementation of Image::GD::Thumbnail.  The second is a 
directory index generator, which displays each file name and a link to 
the picture, using URIs to the on-the-fly thumbnail generator to show 
the previews.

Ideas are welcome, but my main questions are:
1) Put it on CPAN?
2) Namespace?

  Issac




Re: mod_deflate problem with chunked encoding

2002-01-21 Thread Igor Sysoev

On Fri, 18 Jan 2002, Jeremy Howard wrote:

 Geoffrey Young wrote:
  Philip Mak wrote:
  The following webpage on a mod_deflate enabled server is not working
  correctly in some browsers:
 ...
 
  a few of us have been wondering where all the traffic on these modules
  has been coming from, is all - I thought it might genuinely be some
  mis-documentation or something...
 
 I originally introduced these modules to this list in an earlier post titled
 Report on mod_accel and mod_deflate in which I promoted these modules as
 an excellent tool for creating a front-end accelerator to mod_perl web
 applications. It included brief documentation for installing and configuring
 the modules--previously there had only been Russian documentation.
 
 There's been no other location for English language discussion of these
 modules. So the discussion has ended up here. I take full responsibility for
 any OT pollution as a result. ;-)
 
 Given that these modules are new, don't have an active discussion home in
 English yet, and are very relevent to mod_perl programmers, I'd like to see
 discussion remain here, or at least have Igor post the occassional update on
 new releases etc.

As to mod_deflate I think mod_perl list is not right place to discuss it.
But mod_accel discussion is more relevent to this list as well as
lingerd, mod_proxy, Squid and other reverse proxing or accelerating
technology.

 If that bothers anyone then I'm happy to set up a mailing list elsewhere, of
 course.

I think it would be nice.

Igor Sysoev




Re: QUESTION: how to debug segfault apache1.3.22/mod_perl1.26/HTML::Mason

2002-01-21 Thread Ged Haywood

Hi there,

On Wed, 16 Jan 2002, Chris Hutchinson wrote:

 I've recently built apache 1.3.22/mod_perl 1.26, statically with perl 
 5.6.1 on linux RH 7.0.
 [snip]
 ccversion='', gccversion='2.96 2731 (Red Hat Linux 7.0)', 

At the risk of sounding like a broken record, have you tried compiling
everyhthing with a different compiler?  The one supplied with RH7.0
had some problem (I gather:).

On a couple of RH6.2 systems I'm still using 2.91.66 with no problems,
in fact I've deliberately avoided upgrading gcc because the docs said
it wouldn't compile my kernels any more if I did...

73,
Ged.




Re: handling eval in ePerl

2002-01-21 Thread Mithun Bhattacharya

Perrin Harkins wrote:

 local $SIG{'__DIE__'}  = sub { $error .= $_[0]; };
 
 That's going to kill your exception handling code.  You need to change
 that if you want to be able to use eval() in your code.  Matt has an
 explanation of this in the exceptions part of the mod_perl Guide.


Hmm,

I think just commenting it worked !!. I have tried the following which 
have worked the way it should.

---
# Exception handling
eval {die blah blah blah;};
print got : $@;
---
die blah blah blah;
---
# Write to error log
use Apache::Log;
Apache-request-log-error(got : $@);
---
# Syntax error
eval {die blah blah blah;
print got : $@;
---


print STDERR blah blah blah is going to the browser but I am not 
really worried about it too much unless it is something I should worry 
about - anyone care to comment on that ?

Ofcourse I still dont understand why die was being trapped out there.

Thanks to Perrin and Matt for their suggestions anyway.



Mithun




Re: Thumbnail generator

2002-01-21 Thread Gerald Richter

 I recently decided that Apache::Gallery is really nice if you want to
 sit down and start fiddling with templates, but that I needed to make a
 quick-easy version for myself.  The design is to be extremely simple,
 and is divided into two seperate modules.  The first is an on-the-fly
 thumbnail  generator (currently supports only jpeg), which is just a
 spiced up implementation of Image::GD::Thumbnail.

You may want to take a look at Apache::ImageMagick (if you not already
have). It's let's you create thumbnails very easy (just two parameters
pic.xxx/scale?geometry=100x100) and ImageMagick supports over 80 different
formats. It also handles conversion from 4 color pictures to RGB for your
thumbnails and many other things, if you need them.

Gerald


-
Gerald Richterecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925131
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-






Re: handling eval in ePerl

2002-01-21 Thread Perrin Harkins

 print STDERR blah blah blah is going to the browser but I am not
 really worried about it too much unless it is something I should worry
 about - anyone care to comment on that ?

Printing error messages to the public is a potential security risk, so
you have to decide how paranoid you want to be.  You could change this
behavior by modifying the tied STDERR in Parse::ePerl or maybe in
Apache::ePerl where it prints the message to the browser.

 Ofcourse I still dont understand why die was being trapped out there.

It is being trapped to allow for error reporting and to avoid leaving
the program in an unknown state when a problem occurs.  If you want it
to still work for this but not pick up your eval() calls, you can
replace the __DIE__ handler there with something fancier like this:

local $SIG{__DIE__} = sub {
 my $in_eval = 0;
 for( my $stack = 1;  my $sub = (CORE::caller($stack))[3];
 $stack++ ) {
 $in_eval = 1 if $sub =~ /^\(eval\)/;
 }
 $error .= $_[0] unless $in_eval;
};

This is a slight variation of some Michael Schwern code that Stas posted
a little while ago.

- Perrin





Forking another process in Apache?

2002-01-21 Thread eCap

A newbie question here...
I have a requirement to spin off a SQL loader process after a web page (a
form which is qualified and accepted) has been submitted.  Does it make
sense, or more importantly, is it dangerous to apply a fork at the end of
a module such as this:


sub handler {
 # do some qualification stuff here and accept the form submission...
 if ($pid = fork) {
  # parent
  # ...whatever i need to accomplish to deliver return html code
  return OK
 } elsif {
  # child
  exec($sql_loader);
 } else {
  # ...whatever i ned to do to recover errors
  return DECLINED
 }

}

Are there any dangers in doing something like this?  Or is there a more
efficient way to accomplish the same thing?

Thanks for the advice,
Kirk




Re: Forking another process in Apache?

2002-01-21 Thread Perrin Harkins

 I have a requirement to spin off a SQL loader process after a web page
(a
 form which is qualified and accepted) has been submitted.  Does it
make
 sense, or more importantly, is it dangerous to apply a fork at the
end of
 a module such as this:

You're probably better off using a cleanup handler to do this after
disconnecting form the client.  See the guide for more details:
http://perl.apache.org/guide/performance.html#Forking_and_Executing_Subp
rocess

- Perrin




Re: Thumbnail generator

2002-01-21 Thread Robert Landrum

At 4:13 PM +0100 1/21/02, Gerald Richter wrote:
  I recently decided that Apache::Gallery is really nice if you want to
 sit down and start fiddling with templates, but that I needed to make a
 quick-easy version for myself.  The design is to be extremely simple,
 and is divided into two seperate modules.  The first is an on-the-fly
 thumbnail  generator (currently supports only jpeg), which is just a
 spiced up implementation of Image::GD::Thumbnail.

You may want to take a look at Apache::ImageMagick (if you not already
have). It's let's you create thumbnails very easy (just two parameters
pic.xxx/scale?geometry=100x100) and ImageMagick supports over 80 different
formats. It also handles conversion from 4 color pictures to RGB for your
thumbnails and many other things, if you need them.

ImageMagick is way too slow for use in a production system. 
Especially if your resizing large images into thumbnails.  I suggest 
sacrificing space for speed and pre-generating all your thumbnails.

Most of the time libjpeg will do everything you need, including 
scaling.  I suggestion GD with Jpeg support or Inline.pm/C/libjpeg 
for real time conversion of jpegs.

There are probably other faster libs out there, and I'm just citing 
the ones I've heard about or used in the past.

Rob

--
When I used a Mac, they laughed because I had no command prompt. When 
I used Linux, they laughed because I had no GUI.  



Re: Thumbnail generator

2002-01-21 Thread Issac Goldstand

Robert Landrum wrote:

 At 4:13 PM +0100 1/21/02, Gerald Richter wrote:

  I recently decided that Apache::Gallery is really nice if you want to

 sit down and start fiddling with templates, but that I needed to make a
 quick-easy version for myself.  The design is to be extremely simple,
 and is divided into two seperate modules.  The first is an on-the-fly
 thumbnail  generator (currently supports only jpeg), which is just a
 spiced up implementation of Image::GD::Thumbnail.


 You may want to take a look at Apache::ImageMagick (if you not already
 have). It's let's you create thumbnails very easy (just two parameters
 pic.xxx/scale?geometry=100x100) and ImageMagick supports over 80 
 different
 formats. It also handles conversion from 4 color pictures to RGB for 
 your
 thumbnails and many other things, if you need them.


 ImageMagick is way too slow for use in a production system. Especially 
 if your resizing large images into thumbnails.  I suggest sacrificing 
 space for speed and pre-generating all your thumbnails.

 Most of the time libjpeg will do everything you need, including 
 scaling.  I suggestion GD with Jpeg support or Inline.pm/C/libjpeg for 
 real time conversion of jpegs.

 There are probably other faster libs out there, and I'm just citing 
 the ones I've heard about or used in the past.

 Rob

 -- 
 When I used a Mac, they laughed because I had no command prompt. When 
 I used Linux, they laughed because I had no GUI.  

Part of the idea here is to do everything on-the-fly so that changes on 
the filesystem (in terms of adding/removing pictures) will IMMEDIATELY 
take effect (including caching, etc) on the web interface.  That means 
no thumbnails to start with.

  Issac






Re: Thumbnail generator

2002-01-21 Thread Dave Hodgkinson

Issac Goldstand [EMAIL PROTECTED] writes:

 Part of the idea here is to do everything on-the-fly so that changes
 on the filesystem (in terms of adding/removing pictures) will
 IMMEDIATELY take effect (including caching, etc) on the web interface.
 That means no thumbnails to start with.

Yeah, but cache early, cache often.

-- 
Dave Hodgkinson, Wizard for Hire http://www.davehodgkinson.com
Editor-in-chief, The Highway Star   http://www.deep-purple.com
   Interim Technical Director, Web Architecture Consultant for hire



Cgi permission Questions

2002-01-21 Thread Joe Bifano

Hi all,

My first time on the list.  I have been looking at the archives but am not
able to find anything on this.

I have 3 web servers, 1 development/nfs server and 2 database mysql servers
in a cluster server farm.  All sites are owned by our company so nobody will
be on the system except for me.  It is behind a firewall and a load-balancer
so it is pretty secure.

I have several domains set up on the site called test.company.com,
demo.company.com, stage.company.com and company.com.  company.com is only on
the 3 web servers and all the rest is on the development server.

I have 2 employees that will be setting up a couple of things using a cgi
script called create.pl on test.company.com.  When this script is run it has
to create new test companies or demo companies.

Here is the problem:  create.pl is owned by test and group test and has file
permissions 755.  When the create.pl script is run it becomes owner apache
and group apache and has to create new files and directories on the machine.
All of the new files and directories  then become owner apache and group
apace.  I need them to stay as owner test and group test.

I have used SuExec before and know that it will call create.pl and then
become owner test rather than owner apache but would like to know if there
was a different way to do this.  The main reason for me not wanting to use
SuExec is because I want to learn and implement mod_perl and HTML::MASON for
this site down the road.

Thanks for you reply's in advance.

Joe




mod_perl installation

2002-01-21 Thread Rasoul Hajikhani

Folks,
I get this message when running Makefile.pm:

Your Perl is configured to link against libgdbm, 
  but libgdbm.so was not found.
  You might need to install Perl from source

I have checked the /usr/lib directory for libgdbm.so and it is not
there.
Here is the result of perl -V | grep libs:
 libs=-lgdbm -lm -lc

I use SGI IRIX 6.5 

Short of reinstalling perl, is there anything else that could be done?
Where would I find libgdbm.so?
Thanks in advance.
-r



[ANNOUNCE] Apache::GD::Thumbnail-0.01

2002-01-21 Thread Issac Goldstand

The uploaded file

Apache-GD-Thumbnail-0.01.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/I/IS/ISAAC/Apache-GD-Thumbnail-0.01.tar.gz
  size: 2428 bytes
   md5: 5c46eca45e213e98a2d2388b7a6fcb8a

NAME
   Apache::GD::Thumbnail - Apache module which generates on-
   the-fly thumbnails using GD and libjpeg

SYNOPSIS
 Location /pics/thumbnails
 SetHandler perl-handler
 PerlHandler Apache::GD::Thumbnail
 PerlSetVar ThumbnailMaxSize 75
 PerlSetVar ThumbnailBaseDir /usr/local/httpd/htdocs/pics
 /Location

DESCRIPTION
   Just what it looks like: creates on-the-fly thumbnails of
   a jpeg image.  There are two optional configuration direc­
   tives.

   · ThumbnailMaxSize
  Sets the maximum number of pixels to be used in the
  thumbnail for length or width (whichever is larger)
 
   · ThumbnailBaseDir
  Sets the directory that contains the images to be
  thumbnailed.  Defaults to .. if not set.

AUTHOR AND COPYRIGHT
   Copyright (c) 2002 Issac Goldstand - All rights reserved.

   This library is free software.  It can be redistributed
   and/or modified under the same terms as Perl itself.





Re: Cgi permission Questions

2002-01-21 Thread Perrin Harkins

 Here is the problem:  create.pl is owned by test and group test and
has file
 permissions 755.  When the create.pl script is run it becomes owner
apache
 and group apache and has to create new files and directories on the
machine.
 All of the new files and directories  then become owner apache and
group
 apace.  I need them to stay as owner test and group test.

There is some information on SuExec in the guide:
http://thingy.kcilink.com/modperlguide/install/Is_it_possible_to_run_mod
_perl_e.html

One possible solution for this with mod_perl is to run a separate server
that just handles this script, and start that server as the proper user.

- Perrin




Re: [OT] Cgi permission Questions

2002-01-21 Thread Robert Landrum

At 12:26 PM -0700 1/21/02, Joe Bifano wrote:
Hi all,

My first time on the list.  I have been looking at the archives but am not
able to find anything on this.

I have 3 web servers, 1 development/nfs server and 2 database mysql servers
in a cluster server farm.  All sites are owned by our company so nobody will
be on the system except for me.  It is behind a firewall and a load-balancer
so it is pretty secure.

I have several domains set up on the site called test.company.com,
demo.company.com, stage.company.com and company.com.  company.com is only on
the 3 web servers and all the rest is on the development server.

I have 2 employees that will be setting up a couple of things using a cgi
script called create.pl on test.company.com.  When this script is run it has
to create new test companies or demo companies.

Here is the problem:  create.pl is owned by test and group test and has file
permissions 755.  When the create.pl script is run it becomes owner apache
and group apache and has to create new files and directories on the machine.
All of the new files and directories  then become owner apache and group
apace.  I need them to stay as owner test and group test.


This is a little bit offtopic, since it about permissions and not 
really about mod_perl, but here goes:

You want to use the build-in perl function chown.

chown((getpwname('test'))[2,3],@files_to_chown);

You should not have to suexec if the files you're attempting to chown 
are owned by apache/apache.

Rob


--
When I used a Mac, they laughed because I had no command prompt. When 
I used Linux, they laughed because I had no GUI.  



Re: mod_perl installation

2002-01-21 Thread Robert Landrum

At 11:35 AM -0800 1/21/02, Rasoul Hajikhani wrote:
Folks,
I get this message when running Makefile.pm:

Your Perl is configured to link against libgdbm,
  but libgdbm.so was not found.
  You might need to install Perl from source

I have checked the /usr/lib directory for libgdbm.so and it is not
there.
Here is the result of perl -V | grep libs:
 libs=-lgdbm -lm -lc

I use SGI IRIX 6.5

I ran into this problem too... If I remember correctly, I just 
removed DB_File module directory from the source tree and recompiled.

Of course this means that you can't use DB_File, but if you don't 
need it, then this should work for you.

Rob



--
When I used a Mac, they laughed because I had no command prompt. When 
I used Linux, they laughed because I had no GUI.  



Re: Cgi permission Questions

2002-01-21 Thread oscar


- Original Message -
From: Joe Bifano [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 21, 2002 8:26 PM
Subject: Cgi permission Questions


 Hi all,

 My first time on the list.  I have been looking at the archives but am not
 able to find anything on this.

 I have 3 web servers, 1 development/nfs server and 2 database mysql
servers
 in a cluster server farm.  All sites are owned by our company so nobody
will
 be on the system except for me.  It is behind a firewall and a
load-balancer
 so it is pretty secure.

 I have several domains set up on the site called test.company.com,
 demo.company.com, stage.company.com and company.com.  company.com is only
on
 the 3 web servers and all the rest is on the development server.

 I have 2 employees that will be setting up a couple of things using a cgi
 script called create.pl on test.company.com.  When this script is run it
has
 to create new test companies or demo companies.

 Here is the problem:  create.pl is owned by test and group test and has
file
 permissions 755.  When the create.pl script is run it becomes owner apache
 and group apache and has to create new files and directories on the
machine.
 All of the new files and directories  then become owner apache and group
 apace.  I need them to stay as owner test and group test.


Ummm I'm not completly sure, but if you activate the suid on create.pl, then
create.pl will be executed as test and not as apache. And I think all files
create.pl creates, also will own test:test
chmod u+s create.pl
that command will give create.pl the suid.




 I have used SuExec before and know that it will call create.pl and then
 become owner test rather than owner apache but would like to know if there
 was a different way to do this.  The main reason for me not wanting to use
 SuExec is because I want to learn and implement mod_perl and HTML::MASON
for
 this site down the road.

 Thanks for you reply's in advance.

 Joe






Re: mod_perl installation

2002-01-21 Thread Robert Landrum

At 11:35 AM -0800 1/21/02, Rasoul Hajikhani wrote:
Folks,
I get this message when running Makefile.pm:

Your Perl is configured to link against libgdbm,
  but libgdbm.so was not found.
  You might need to install Perl from source

Actually, I just checked... I removed perl-5.6.x/ext/*_File

Rob


--
When I used a Mac, they laughed because I had no command prompt. When 
I used Linux, they laughed because I had no GUI.  



Re: Cgi permission Questions

2002-01-21 Thread Stephen Reppucci


On Mon, 21 Jan 2002, Joe Bifano wrote:

 Hi all,

 My first time on the list.  I have been looking at the archives but am not
 able to find anything on this.

Exactly.  Because this list is about perl, specifically mod_perl,
while your question is about Apache, and its configuration.

Please don't ask questions here which have no relevance.  There are
other lists that discuss these issues.

Please visit http://www.apache.org/httpd/, where there is a wealth
of great documentation put together through the effort of volunteers
to answer exactly this question.

-- 
Steve Reppucci   [EMAIL PROTECTED] |
Logical Choice Software  http://logsoft.com/ |
=-=-=-=-=-=-=-=-=-=-  My God!  What have I done?  -=-=-=-=-=-=-=-=-=-=




Re: Cgi permission Questions

2002-01-21 Thread Joe Bifano

Stephen,

I know that this is for perl and mod_perl BUT in my question if you looked I
specificaly said that we want to upgrade and impleiment our site to mod_perl
using HTML::MASON.  With saying that , I wanted to make sure that if I made
some changes to my Apache setup now , I want to make sure that it will work
using our new mod_perl setup in the future.  I am pretty sure that you can
not use SuExec with mod_perl so I wanted to find out from all the good
mod_perl programmers out there before hand.  Who wants to set up a server
with SuExec and then set up one with mod_perl and have to change all kinds
of permission problems.  It's hard enought to change all the scripts to
mod_perl anyway.  If this has no relavence then you did not read my email or
understand it.
- Original Message -
From: Stephen Reppucci [EMAIL PROTECTED]
To: Joe Bifano [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, January 21, 2002 4:11 PM
Subject: Re: Cgi permission Questions



 On Mon, 21 Jan 2002, Joe Bifano wrote:

  Hi all,
 
  My first time on the list.  I have been looking at the archives but am
not
  able to find anything on this.

 Exactly.  Because this list is about perl, specifically mod_perl,
 while your question is about Apache, and its configuration.

 Please don't ask questions here which have no relevance.  There are
 other lists that discuss these issues.

 Please visit http://www.apache.org/httpd/, where there is a wealth
 of great documentation put together through the effort of volunteers
 to answer exactly this question.

 --
 Steve Reppucci   [EMAIL PROTECTED] |
 Logical Choice Software  http://logsoft.com/ |
 =-=-=-=-=-=-=-=-=-=-  My God!  What have I done?  -=-=-=-=-=-=-=-=-=-=





Apache.pm failed to load!.

2002-01-21 Thread Rasoul Hajikhani

Folks,
After installing mod_perl-1.25  apache_1.3.22 I get this error message!
I know this is a really serious error, but I was wondering if any one
could tell me why I would get this since the installation of both
mod_perl and apache went through without a problem?!
-r



Re: Apache.pm failed to load!.

2002-01-21 Thread ___cliff rayman___

first off, that looks like a spanking brand new version
of apache but an older version of mod_perl.  you will
probaby be happier with mod_perl-1.26

what happens when you try the following from the command line?
perl -MApache -e 1

Rasoul Hajikhani wrote:

 Folks,
 After installing mod_perl-1.25  apache_1.3.22 I get this error message!
 I know this is a really serious error, but I was wondering if any one
 could tell me why I would get this since the installation of both
 mod_perl and apache went through without a problem?!
 -r

--
___cliff [EMAIL PROTECTED]http://www.genwax.com/





Re: Apache.pm failed to load!.

2002-01-21 Thread Rasoul Hajikhani

___cliff rayman___ wrote:
 
 first off, that looks like a spanking brand new version
 of apache but an older version of mod_perl.  you will
 probaby be happier with mod_perl-1.26
 
 what happens when you try the following from the command line?
 perl -MApache -e 1
 
 Rasoul Hajikhani wrote:
 
  Folks,
  After installing mod_perl-1.25  apache_1.3.22 I get this error message!
  I know this is a really serious error, but I was wondering if any one
  could tell me why I would get this since the installation of both
  mod_perl and apache went through without a problem?!
  -r
 
 --
 ___cliff [EMAIL PROTECTED]http://www.genwax.com/
Well don't know... I removed them both and are in the middle of
reinstalling them. Will let you know asap ...
-r



disable mod_perl for specific loation/virtual host

2002-01-21 Thread pilsl

I've a server that has pl-files for mod_perl and cgi for standard-cgi and 
now got a bunch of pl-files that do not run under mod_perl and cannot be 
renamed in cgi, cause they are linked in frames on distant hosts where I 
dont have access too.

So I need to disable mod_perl for these pl-files for this specific virtual 
host:

I activate mod_perl in main-part of my http.conf:
Files ~ \.pl$
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
/Files

for all virtual hosts

and now need to know which PerlHandler is responsible for no-mod_perl cgi.
(The PerlRun-Handler also fails ...)

It tried in the virtual host section:
Files ~ \.pl$
SetHandler cgi-script
Options +ExecCGI
/Files

and even SetHandler default-handler

And I tried 

AddHandler cgi-script .pl

but this wont do it. 


thnx,
peter




mod_perl failed at make test

2002-01-21 Thread Rasoul Hajikhani

After running make test (for the first time) here is waht I get:

*** Error code 2 (bu21)

mod_perl make test gives me this:
(cd ../apache_1.3.22  PERL5LIB=/home/rasoul/mod_perl-1.26/lib make)
=== src
=== src/regex
=== src/regex
=== src/os/unix
=== src/os/unix
=== src/ap
=== src/ap
=== src/main
=== src/main
=== src/lib
=== src/lib
=== src/modules
=== src/modules/standard
=== src/modules/standard
=== src/modules/perl
=== src/modules/perl
=== src/modules
cc -n32 -woff 1110,1184 -c -I.
-I/usr/local/lib/perl5/5.00503/irix/CORE -I./os/unix -I./include  
-DIRIX -DMOD_PERL -DUSE_PERL_SSI -I/usr/lsd/include -I/usr/local/include
-I/usr/apps/include -DUSE_HSREGEX -DNO_DL_NEEDED `./apaci` modules.c
cc -n32 -woff 1110,1184 -c -I.
-I/usr/local/lib/perl5/5.00503/irix/CORE -I./os/unix -I./include  
-DIRIX -DMOD_PERL -DUSE_PERL_SSI -I/usr/lsd/include -I/usr/local/include
-I/usr/apps/include -DUSE_HSREGEX -DNO_DL_NEEDED `./apaci` buildmark.c
cc -n32 -woff 1110,1184  -DIRIX -DMOD_PERL -DUSE_PERL_SSI
-I/usr/lsd/include -I/usr/local/include -I/usr/apps/include
-DUSE_HSREGEX -DNO_DL_NEEDED `./apaci`\
  -o httpd buildmark.o modules.o  modules/perl/libperl.a 
modules/standard/libstandard.a  main/libmain.a  ./os/unix/libos.a 
ap/libap.a regex/libregex.a  
-Wl,-rpath,/usr/local/lib/perl5/5.00503/irix/CORE
-Wl,-rpath,/usr/local/informix/lib
-Wl,-rpath,/usr/local/informix/lib/esql
-Wl,-rpath,/usr/local/mysql/lib/mysql -n32 -L/usr/lsd/lib
-L/usr/local/lib -L/usr/apps/lib -L/usr/local/informix/lib
-L/usr/local/informix/lib/esql -L/usr/local/mysql/lib/mysql
/usr/lsd/perl5.00503/lib/perl5/5.00503/irix/auto/DynaLoader/DynaLoader.a
-L/usr/local/lib/perl5/5.00503/irix/CORE -lperl -lgdbm -lm -lc 
ld32: WARNING 84: /usr/lsd/lib/libgdbm.so is not used for resolving any
symbol.
=== src/support
=== src/support
=== src
cp t/conf/mod_perl_srm.conf t/conf/srm.conf
../apache_1.3.22/src/httpd -f `pwd`/t/conf/httpd.conf -X -d
`pwd`/t 
httpd listening on port 8529
will write error_log to: t/logs/error_log
letting apache warm up...done
/usr/local/bin/perl5 t/TEST 0
modules/actions.ok
modules/cgi.ok
modules/constants...ok
modules/cookie..skipping test on this platform
modules/fileok
modules/httpdconf...ok
modules/include.ok
modules/log.ok
modules/module..skipping test on this platform
modules/perlrun.ok
modules/psections...ok
modules/request.dubious
Test returned status 0 (wstat 13, 0xd)
modules/src.ok
modules/ssi.ok
modules/stage...FAILED test 1
Failed 1/2 tests, 50.00% okay
modules/status..Internal Server Error
dubious
Test returned status 9 (wstat 2304, 0x900)
DIED. FAILED tests 8-10
Failed 3/10 tests, 70.00% okay
modules/symbol..ok
modules/uri.ok
modules/utilok
internal/apiok
internal/auth...ok
internal/croak..ok
internal/dirmagic...ok
internal/error..ok
internal/headersok
internal/hooks..ok
internal/http-get...ok
internal/http-post..ok
internal/proxy..ok
internal/redirect...ok
internal/rwrite.ok
internal/stackedok
internal/table..ok
internal/taint..ok
Failed Test  Status Wstat Total Fail  Failed  List of failed
---
modules/request   013??   ??   %  ??
modules/stage.t   21  50.00%  1
modules/status.   9  2304103  30.00%  8-10
2 tests skipped.
httpd terminated
httpd terminated
*** Error code 2 (bu21)

This is the first error I have got.
-r



disable mod_perl for certain virtual hosts/folders

2002-01-21 Thread pilsl

On my Apache mod_perl is generally enabled with the following statement:

Directory /data/apache
Files ~ \.pl$
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
/Files
/Directory


Now I've couple of pl-files in a certain virtual host that dont run
under mod_perl. How can I disable mod_perl for this virtual host or a certain folder ?

I tried (in the virtual-host config):
 Files ~ \.pl$
SetHandler cgi-script
Options +ExecCGI
 /Files

and even 

 Files ~ \.pl$
SetHandler default-handler
Options +ExecCGI
 /Files


but it didnt work - I have the feeling that I also should specifiy
PerlHandler, but dont know to which value (tried to set it to
'default-handler' but scripts are still running under mod_perl)

any help appretiated,

thnx,
peter

ps: scripts also dont run under PerlRun - they are really badstyled.



Re: Forking another process in Apache?

2002-01-21 Thread Mike P. Mikhailov

Hello eCap,

Monday, January 21, 2002, 10:45:37 PM, you wrote:

e A newbie question here...
e I have a requirement to spin off a SQL loader process after a web page (a
e form which is qualified and accepted) has been submitted.  Does it make
e sense, or more importantly, is it dangerous to apply a fork at the end of
e a module such as this:


e sub handler {
e  # do some qualification stuff here and accept the form submission...
e  if ($pid = fork) {
e   # parent
e   # ...whatever i need to accomplish to deliver return html code
e   return OK
e  } elsif {
e   # child
e   exec($sql_loader);
e  } else {
e   # ...whatever i ned to do to recover errors
e   return DECLINED
e  }

e }

e Are there any dangers in doing something like this?  Or is there a more
e efficient way to accomplish the same thing?

e Thanks for the advice,
e Kirk


I'm recently implement exactly such loader. From the client HTTP
request I'm starting loader with double fork approach. I'm loading
posssible large enough (about 100 - 150 MB) data from DBF flat files
into Oracle in single transaction (I'm must provide consistency).
Loader process takes about 40-50 min to complete and consumes many
resources (CPU and RAM). But it works !

-- 
WBR, Mike P. Mikhailov
mailto:[EMAIL PROTECTED]

Pessimests are right more often, but optimists are happy more often




Re: Thumbnail generator

2002-01-21 Thread Gerald Richter


 ImageMagick is way too slow for use in a production system.
 Especially if your resizing large images into thumbnails.

Apache::ImageMagick will cache the created thumbnail, so it only has to be
done once and can it automaticly recreate the thumbnail if the pictures on
disk changes.

Gerald


-
Gerald Richterecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925131
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-





cvs commit: modperl-2.0/xs/maps apache_functions.map modperl_functions.map

2002-01-21 Thread stas

stas02/01/21 00:27:30

  Modified:xs/Apache/Response Apache__Response.h
   xs/maps  apache_functions.map modperl_functions.map
  Log:
  - write a wrapper for $r-set_last_modified() to be the same as in 1.x
  - specify default values for $r-set_content_length and $r-update_mtime
  as in 1.x
  
  Revision  ChangesPath
  1.6   +9 -0  modperl-2.0/xs/Apache/Response/Apache__Response.h
  
  Index: Apache__Response.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/Response/Apache__Response.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Apache__Response.h6 Jan 2002 22:23:24 -   1.5
  +++ Apache__Response.h21 Jan 2002 08:27:30 -  1.6
  @@ -25,3 +25,12 @@
   
   rcfg-wbucket-header_parse = 0; /* turn off PerlOptions +ParseHeaders */
   }
  +
  +static MP_INLINE void
  +mpxs_Apache__RequestRec_set_last_modified(request_rec *r, apr_time_t mtime)
  +{
  +if (mtime) {
  +ap_update_mtime(r, mtime);
  +}
  +ap_set_last_modified(r);
  +}
  
  
  
  1.42  +3 -3  modperl-2.0/xs/maps/apache_functions.map
  
  Index: apache_functions.map
  ===
  RCS file: /home/cvs/modperl-2.0/xs/maps/apache_functions.map,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- apache_functions.map  20 Jan 2002 18:37:05 -  1.41
  +++ apache_functions.map  21 Jan 2002 08:27:30 -  1.42
  @@ -100,16 +100,16 @@
   
   MODULE=Apache::Response   PACKAGE=guess
ap_make_etag | | r, force_weak=0
  - ap_set_content_length
  + ap_set_content_length | | r, length=r-finfo.csize
ap_set_etag
ap_meets_conditions
ap_rationalize_mtime
  - ap_update_mtime
  + ap_update_mtime | | r, dependency_mtime=0
ap_send_error_response
   ~ap_send_fd
ap_send_mmap | | r, mm, offset, length
ap_set_keepalive
  - ap_set_last_modified
  +-ap_set_last_modified
ap_custom_response
   
   MODULE=Apache::Access   PACKAGE=Apache::RequestRec
  
  
  
  1.33  +2 -0  modperl-2.0/xs/maps/modperl_functions.map
  
  Index: modperl_functions.map
  ===
  RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- modperl_functions.map 8 Jan 2002 22:48:38 -   1.32
  +++ modperl_functions.map 21 Jan 2002 08:27:30 -  1.33
  @@ -43,6 +43,8 @@
   MODULE=Apache::Response   PACKAGE=Apache::RequestRec
   DEFINE_send_cgi_header | | request_rec *:r, SV *:buffer
mpxs_Apache__RequestRec_send_http_header | | r, type=NULL
  + mpxs_Apache__RequestRec_set_last_modified | | r, mtime=0
  +
   
   MODULE=Apache::ServerUtil   PACKAGE=guess
mpxs_Apache__Server_push_handlers
  
  
  



cvs commit: modperl-2.0/t/response/TestApache compat2.pm compat.pm

2002-01-21 Thread stas

stas02/01/21 00:32:46

  Modified:t/apache compat.t
   t/response/TestApache compat.pm
  Added:   t/response/TestApache compat2.pm
  Log:
  - split compat.pm test into compat.pm (for client side validation) and
  compat2.pm (for sub-tests that can be completed on the server side).
  - 2 out of 3 todo tests now pass with recent patches to
  set_content_length, update_mtime, ap_set_last_modified
  
  Revision  ChangesPath
  1.10  +1 -37 modperl-2.0/t/apache/compat.t
  
  Index: compat.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/apache/compat.t,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- compat.t  20 Dec 2001 03:54:40 -  1.9
  +++ compat.t  21 Jan 2002 08:32:46 -  1.10
  @@ -6,7 +6,7 @@
   use Apache::TestUtil;
   use Apache::TestRequest;
   
  -plan tests = 31, todo = [25, 28, 30];
  +plan tests = 3;
   
   my $location = /TestApache::compat;
   
  @@ -41,48 +41,12 @@
   );
   }
   
  -# Apache-gensym
  -{
  -my @data = (test = 'gensym');
  -my $data = GET_BODY query(@data) || '';
  -ok_nok($data);
  -}
  -
  -# header_in
  -t_header('in','get_scalar',q{scalar ctx: $r-header_in($key)});
  -t_header('in','get_list',  q{list ctx: $r-header_in($key)});
  -t_header('in','set',   q{$r-header_in($key = $val)});
  -t_header('in','unset', q{$r-header_in($key = undef)});
  -
  -# header_out
  -t_header('out','get_scalar',q{scalar ctx: $r-header_out($key)});
  -t_header('out','get_list',  q{list ctx: $r-header_out($key)});
  -t_header('out','set',   q{$r-header_out($key = $val)});
  -t_header('out','unset', q{$r-header_out($key = undef)});
  -
  -# Apache::File
  -{
  -my @data = (test = 'Apache::File');
  -my $data = GET_BODY query(@data) || '';
  -ok_nok($data);
  -}
  -
   
   ### helper subs ###
   sub query {
   my(%args) = (@_ % 2) ? %{+shift} : @_;
   $location? . join '', map { $_=$args{$_} } keys %args;
   }
  -
  -sub t_header {
  -my ($way, $what, $comment) = @_;
  -ok t_cmp(
  -ok,
  -GET_BODY(query(test = 'header', way = $way, what = $what)),
  -$comment
  -);
  -}
  -
   
   # accepts multiline var where, the lines matching:
   # ^ok\n$  results in ok(1)
  
  
  
  1.10  +3 -140modperl-2.0/t/response/TestApache/compat.pm
  
  Index: compat.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat.pm,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- compat.pm 20 Dec 2001 01:31:24 -  1.9
  +++ compat.pm 21 Jan 2002 08:32:46 -  1.10
  @@ -1,5 +1,8 @@
   package TestApache::compat;
   
  +# these Apache::compat tests are all run on the server
  +# side and validated on the client side. See also TestApache::compat2.
  +
   use strict;
   use warnings FATAL = 'all';
   
  @@ -33,146 +36,6 @@
   
   if ($data{test} eq 'content' || $data{test} eq 'args') {
   $r-print(test $data{test});
  -}
  -elsif ($data{test} eq 'gensym') {
  -debug Apache-gensym;
  -my $fh = Apache-gensym;
  -ok ref $fh eq 'GLOB';
  -}
  -elsif ($data{test} eq 'header') {
  -my $way  = $data{way};
  -my $sub  = header_$way;
  -my $sub_good = headers_$way;
  -if ($data{what} eq 'get_scalar') {
  -# get in scalar ctx
  -my $key;
  -if ($way eq 'in') {
  -$key = user-agent; # should exist with lwp
  -}
  -else {
  -# outgoing headers aren't set yet, so we set one
  -$key = X-barabara;
  -$r-$sub_good-set($key, $key x 2);
  -}
  -my $exp = $r-$sub_good-get($key);
  -my $got = $r-$sub($key);
  -$r-print(t_is_equal($exp, $got) ? 'ok' : 'nok');
  -}
  -elsif ($data{what} eq 'get_list') {
  -# get in list ctx
  -my $key = $data{test};
  -my @exp = qw(foo bar);
  -$r-$sub_good-add($key = $_) for @exp;
  -my @got = $r-$sub($key);
  -$r-print(t_is_equal(\@exp, \@got) ? 'ok' : 'nok');
  -}
  -elsif ($data{what} eq 'set') {
  -# set
  -my $key = $data{test};
  -my $exp = $key x 2;
  -$r-$sub($key = $exp);
  -my $got = $r-$sub($key);
  -$r-print(t_is_equal($exp, $got) ? 'ok' : 'nok');
  -}
  -elsif ($data{what} eq 'unset') {
  -# unset
  -my $key = $data{test};
  -my $exp = undef;
  -$r-$sub($key = $exp);
  -my $got = $r-$sub($key);
  -$r-print(t_is_equal($exp, $got) ? 'ok' : 'nok');
  -}
  -}
  -elsif ($data{test} eq 'Apache::File') 

cvs commit: modperl-2.0/todo missing_old_features.txt

2002-01-21 Thread stas

stas02/01/21 00:40:54

  Modified:todo missing_old_features.txt
  Log:
  - Apache::File has been ported
  
  Revision  ChangesPath
  1.17  +1 -1  modperl-2.0/todo/missing_old_features.txt
  
  Index: missing_old_features.txt
  ===
  RCS file: /home/cvs/modperl-2.0/todo/missing_old_features.txt,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- missing_old_features.txt  14 Dec 2001 02:07:30 -  1.16
  +++ missing_old_features.txt  21 Jan 2002 08:40:54 -  1.17
  @@ -42,7 +42,7 @@
   
   - Apache::ModuleConfig
   
  -- Apache::File, Apache::Util
  +- Apache::Util
   
   - see also: xs/maps/apache_functions.map
   
  
  
  



cvs commit: modperl/Apache Apache.pm

2002-01-21 Thread stas

stas02/01/21 06:32:35

  Modified:Apache   Apache.pm
  Log:
  - document $r-location
  Submitted by: Issac Goldstand [EMAIL PROTECTED]
  Reviewed by:  stas
  
  Revision  ChangesPath
  1.69  +6 -0  modperl/Apache/Apache.pm
  
  Index: Apache.pm
  ===
  RCS file: /home/cvs/modperl/Apache/Apache.pm,v
  retrieving revision 1.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- Apache.pm 14 Jan 2002 03:12:51 -  1.68
  +++ Apache.pm 21 Jan 2002 14:32:34 -  1.69
  @@ -390,6 +390,12 @@
   filename translation, optionally changing it with the first argument
   if you happen to be doing the translation.
   
  +=item $r-Egtlocation
  +
  +The $r-Egtlocation method will return the path of the
  +EltLocationEgt section from which the current CPerl*Handler is
  +being called.
  +
   =item $r-Egtpath_info( [$path_info] )
   
   The $r-Egtpath_info method will return what is left in the path after the