Image::Magick and mod_perl

1999-01-17 Thread Todd Finney

We're putting together a site that involves processing images uploaded by
our users.   I'm using Image::Magick to resize the images to a standard
size, and to create thumbnails.We will have an upload page, which hits
a CGI under mod_perl that handles the form data and processes the image.

I am wondering if this is the best way to handle this.   When a user
uploads an image and it's being processed, am I occupying an entire child
process for the duration of the transaction?  If each transaction lasts a
couple of seconds, it this a Bad Thing?   Is there a more efficient way to
handle this?

I saw the Apache::Magick demo in the modperl site, but it doesn't really
apply to this situation, as I don't need to do dynamic rendering. 

thanks,
Todd



Apache::ASP and server-side includes

1999-01-17 Thread Andrew Mayo

Is it possible to configure Apache so that .asp files also support
server-side includes?. I can configure Apache to successfully make .shtml
files support server-side includes but the asp files have a .asp extension
and if I change the handler for that, I'll end up disabling Apache::ASP. How
do I get server-side includes to work as well, for files with an .asp
extension?



Re: ANNOUNCE: HTML::Embperl 1.2.0

1999-01-17 Thread Ajit Deshpande

On Wed, Nov 17, 1999 at 08:23:07AM +0100, Gerald Richter wrote:
> The URL
> ftp://ftp.dev.ecos.de/pub/perl/embperl/HTML-Embperl-1.2.0.tar.gz
> has entered CPAN as
[...]

Are Gerald's and Jeffrey's Apache::Session back in sync now?

Ajit



CONTINIUS ERROR

1999-01-17 Thread Christian Callejon

Hello, i dont undestand this error

please HELP ME..!!

TKS

Errors Output

> Falla al preparar SELECT * from registrado
, /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 1142

Debug Output

> STARTING ASP HANDLER (v0.17) for file
/usr/apache/htdocs/christian/inicio.html
> GlobalASA package Apache::ASP::Demo
> ASP object created - GlobalASA:
Apache::ASP::GlobalASA=HASH(0x83ba764); Request:
Apache::ASP::Request=HASH(0x842348c); Response:
Apache::ASP::Response=HASH(0x8428ff8); Server:
Apache::ASP::Server=HASH(0x81b4720); app_state: 1; basename:
inicio.html; buffering_on: 0; cgi_headers: 0; clean: 0;
compile_includes: 0; dbg: 2; debugs_output: ARRAY(0x83c74e4); errs: 0;
filename: /usr/apache/htdocs/christian/inicio.html; global:
/usr/apache/htdocs/christian//.; global_package: Apache::ASP::Demo; id:
NoCache; includes_dir: ; init_packages: ARRAY(0x83bc95c); mail_alert_to:
; mail_errors_to: ; mtime: 942863737; no_cache: 1; no_session: 0;
no_state: 1; package: Apache::ASP::Demo; pod_comments: 1; r:
Apache=SCALAR(0x83197e4); stat_inc: 1; stat_inc_match: zzz;
unique_packages: 0;
> parsing inicio.html
> active undefing sub Apache::ASP::Demo::NoCache code CODE(0x840de88)
before compiling
> compiling into package Apache::ASP::Demo subid
Apache::ASP::Demo::NoCache
> executing NoCache
> Falla al preparar SELECT * from registrado
, /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 1142

Last 100 Bytes of Buffered Output

tle>CLASIfacil






ASP to Perl Program

  1: package Apache::ASP::Demo; ;; no strict; ;; use vars
qw($Application $Session $Response $Server $Request); ;; sub
Apache::ASP::Demo::NoCache {  ;;  return(1) unless $_[0];  ;;
  2: $Response->{Buffer}=1;
  3: $Response->Write('
  4: 
  5: 
  6: 
  7:
  8:
  9:
 10:CLASIfacil
 11: 
 12: 
 13:
 14: 
 15: ');
 16:
 17: $usuario = $Request->Form('use');
 18: $password = $Request->Form('pas');
 19: $validacion="";
 20: $user="informix";
 21: $passmm="informix";
 22: $database="/home/informix/clasifacil\@christian";
 23: $sql="SELECT * from registrado";
 24: die "Falla al conectar db \n"
 25: unless ($dbh=DBI->connect("dbi:Informix:$database",$user,$passmm));

 26: die "Falla al preparar $sql \n"
 27: unless ($sth=$dbh->prepare($sql));
 28: $sth->execute();
 29: @name = @{$sth->{NAME}};# Column names
 30: while(@row=$sth->fetchrow)
 31: {
 32:
 33: $us=@row[2];
 34: $pa=@row[3];
 35:
 36:
 37:
 38:if ($us eq $usuario) {
 39:
 40:if ($pa eq $password) {
 41:$validacion= @row[4].@row[5];
 42:}
 43: }
 44:
 45: }
 46:
 47:
 48: if ($validacion){
 49: print "Bienvenido",$validacion,"";

 50:} else {
 51:   $url="error.html";
 52:   $Response->Redirect($url);
 53: }
 54:
 55:
 56: $Response->Write('
 57:
 58:
 59:
 60:
 61:
 62:
 63:
 64:
 65: 
 66: 
 67:  
 68: 
 69: 
 70: Bienvenido:
 71:
 72: 
 73: 
 74: 
 75:  
 76: 
 77: 
 78: 
 79:
 80:  
 81: 
 82: 
 83: Busquedas:
 84:  
 85:  
 86:  
 87:
 88: Visualizar un rubro
 89: completo
 90:  
 91:
 92: Ver todo el contenido de
 93: todos los rubros
 94:  
 95: 
 96: 
 97: 
 98: 
 99:
100: 
101: 
102: Bienvenidos a la mayor guia de
avisos
103: clasificados y Bolsas de Trabajo GRATUITA de Argentina.
104: Registrese GRATIS y podra vender, comprar, ofrecer o
contratar
105: servicios de todo tipo. 
106: 
107:
108: 
109: 
110:  
111: 
112: 
113:  
114:
115:  
116:
117:  
118: 
119: 
120:
121: 
122:  
123: 
124: 
125:  
126:
127:  
128:
129:  
130: 
131: 
132:
133:  
134: 
135: 
136:
137: 
138: 
139:
140:  
141:  
142: 
143: '); ;; }





multipart/form-data

1999-01-17 Thread John S. Evans

I need to implement an HTTP API that will be used to transfer random pieces
of information (some small, some large) to our server.

I was thinking of using multipart/form-data to accomplish this, since I was
assuming that there'd be tools on the server-side to help me deal with the
incoming onslaught of data.

Now I need to decide whether I should build my server-side code as a modperl
handler, or just build a perl CGI (and use Apache::Registry to make it
zippy).

Any suggestions or recommendations for one method over the other?

Thanks for any info!

-jse



chunked POST

1999-01-17 Thread Tom Amiro


I hope this is a good forum for this question, if not let me know a better
one.
I'm running some automated tests against Apache, and have gotten
fails with chunked POSTs.
I've found information on ApacheWeek saying support  of HTTP 1.1,
included the ability to:
    Receive
chunked POST and PUT submissions
The following is one of  the tests, that I think is attempting
to do a chunked POST, and is failing.
POST http://localhost/cgi-bin/echo.pl HTTP/1.1
Host: localhost
Transfer-encoding: chunked
0001c
The twenty-eight characters
0
GET http://localhost/small.html HTTP/1.1
Host: localhost
Connection: close
Here is the response Apache gave:
HTTP/1.1 411 Length Required
Date: Wed, 27 Oct 1999 13:31:29 GMT
Server: Apache/1.3.9 (Unix)
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
11d


411 Length Required

Length Required
A request of the requested method POST requires a valid Content-length.
chunked Transfer-Encoding forbidden: /cgi-bin/echo.pl

I assume Apache does support the HTTP 1.1 spec and that
chunked POST can be used to return dynamic CGI output, so
I don't understand why such tests are failing. But maybe this
test isn't testing what I think it is.
Anyone know what's going on?
Thanks,
Tom


Apache::ASP config question

1999-01-17 Thread Brad Babb

Hi,
I'm about to put a site into production using Apache::ASP, and need to have
a development side to the site to continue working.
I won't to be able to have 2 difference Application, one for the production
side, and one for the development side.  What do I need to do to make this
work.  I tried something like this in httpd.conf, but didn't seem to work..


SetHandler perl-script
PerlHandler Apache::ASP
PerlSetVar Debug  2
PerlSetVar NoState 1
PerlSetVar BufferingOn 0
PerlSetVar NoCache 1
   PerlSetVar DynamicIncludes 1


PerlHandler Apache::ASP
PerlSetVar Debug 2
PerlSetVar NoState 1
PerlSetVar BufferingON 0
PerlSetVar NoCache 1
PerlSetVar DynamicIncludes 1


PerlSetVar Global /usr/local/apache/htdocs


PerlSetVar Global /usr/local/apache/htdocs/development


I'd also like to turn off all the debugging, etc, on the production side but
like it on in the development side...
I may just be tired, (or dumb) and have missed something or just way off,
but need help anyway..
thanks,
brad



multipart POST problems

1999-01-17 Thread John S. Evans

I've been attempting to write a perl module that handles POSTs of type
multipart/form-data, and have been having a rough time.

I'm using Apache::Request to process the request.  I have dumped the
content-type of the incoming request, and verified that it's
"multipart/form-data".  I can use param() to get the parameters, but I can't
seem to use upload() to access the blocks directly.

I've included the code from my test handler below.  Basically it attempts to
access a large parameter MIME block two ways - using param() and using
upload().  The param() version works fine, but the upload() version can't
find the block.

Any clues?  The only thing that I can think of is that for this test case,
the MIME type of the "message" block is text/plain (it's in a TEXTAREA
field, for testing purposes).  Is it possible that Apache::Request will not
allow me to process "normal" form fields with upload()?

-jse


sub handler
{
my $r = shift;
my $apr = Apache::Request->new($r);
my $block;
my $buffer;

$r->content_type('text/html');
$r->send_http_header();

$buffer = $apr->param('message');
$r->print("Message:$buffer");

$block = $apr->upload('message');
if ($block)
{
$r->print("Found message");
}
else
{
$r->print("No message");
}

return OK;
}



multipart POST problems

1999-01-17 Thread John S. Evans

This is a resend - for some reason I'm having problems sending to the list
from my main email account.  Doh!

-jse



I've been attempting to write a perl module that handles POSTs of type
multipart/form-data, and have been having a rough time.

I'm using Apache::Request to process the request.  I have dumped the
content-type of the incoming request, and verified that it's
"multipart/form-data".  I can use param() to get the parameters, but I can't
seem to use upload() to access the blocks directly.

I've included the code from my test handler below.  Basically it attempts to
access a large parameter MIME block two ways - using param() and using
upload().  The param() version works fine, but the upload() version can't
find the block.

Any clues?  The only thing that I can think of is that for this test case,
the MIME type of the "message" block is text/plain (it's in a TEXTAREA
field, for testing purposes).  Is it possible that Apache::Request will not
allow me to process "normal" form fields with upload()?

-jse


sub handler
{
my $r = shift;
my $apr = Apache::Request->new($r);
my $block;
my $buffer;

$r->content_type('text/html');
$r->send_http_header();

$buffer = $apr->param('message');
$r->print("Message:$buffer");

$block = $apr->upload('message');
if ($block)
{
$r->print("Found message");
}
else
{
$r->print("No message");
}

return OK;
}



ANNOUNCE: CGI::WeT 0.71

1999-01-17 Thread James G Smith

The uploaded file

CGI-WeT-0.71.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/J/JS/JSMITH/CGI-WeT-0.71.tar.gz
  size: 40841 bytes
   md5: 78528519a7a96511b96064d9a4d750ce

CGI::WeT is a package to help build a website with the ability to offer
different views for the same content.  CGI::WeT prefers Apache with 
mod_perl but can be made to work without mod_perl with a little more effort.

Version 0.71 provides almost complete emulation of CGI.pm.  Any differences
from normal operation after converting a script from CGI to CGI::WeT
should be considered bugs in CGI::WeT (unless they aren't).  Please
report them to the cgi-wet mailing list.
--
James Smith <[EMAIL PROTECTED]>



Re: Stonehenge::Throttle, round 2 - CPU used by an IP

1999-01-17 Thread Ask Bjoern Hansen

On Tue, 16 Nov 1999, Matt Sergeant wrote:

> For the unique IP in _most_ firewall cases, take the last comma separated
> value of the X-Forwarded-For header: $r->headers_in->get('x-forwarded-for');

except for all the clients at 192.168.1.100 (etc).

So you would have to get into "real ip / forwarded for" pairs, and the
harmful stupid people would at some point figure that out and put random
"forwarded for" thingies into their clients. Don't use anything but the
real ip for anything related to access policies based on ip addresses.


 - ask

-- 
ask bjoern hansen - 
more than 60M impressions per day, 



Re: ANNOUNCE: HTML::Embperl 1.2.0

1999-01-17 Thread G.Richter

> On Wed, Nov 17, 1999 at 08:23:07AM +0100, Gerald Richter wrote:
> > The URL
> > ftp://ftp.dev.ecos.de/pub/perl/embperl/HTML-Embperl-1.2.0.tar.gz
> > has entered CPAN as
> [...]
>
> Are Gerald's and Jeffrey's Apache::Session back in sync now?
>

I have moved the interface between Apache::Session and Embperl to the
Embperl distribution, (named now HTML::Embperl::Session instead of
Apache::Session::Embperl), so Embperl 1.2.0 will work with _any_
Apache::Session 1.xx version :-), so you do _not_ need my Apache::Session
versions (1.01,02,04) anymore.

Gerald




RE: perl variable in configs for few virtual servers

1999-01-17 Thread Eric Cholet

Andrei,

I do not see this behavior if I use PerlSetVar directly inside a 
section instead of via a ResourceConfig. I do see it if I move the directive
to the main server, so I suppose it's a scope issue with ResourceConfig.


> It's Apache 1.3.9, mod_perl 1.21 on Linux.
> 
> The only change I have is patch for correcting PATH enviroment
> corruption provided by Doug.
> 
> Andrei
> 
> On Tue, Nov 16, 1999 at 05:29:46PM +0100, Eric Cholet wrote:
> > Which version of mod_perl are you using, 1.21 or the CVS version perhaps?
> > 
> > > Hi!
> > > 
> > > I've encountered very interesting problem. When I set some variable
> > > using PerlSetVar in configuration files for different virtual servers
> > > they seem to be available to ALL of those virtual servers.
> > > 
> > > Here's details to clarify.
> > > 
> > > In httpd.conf I have
> > > 
> > > 
> > > ServerName   myhost1.domain.com
> > > DocumentRoot /httpd/docs
> > > ErrorLog logs/httpd-errors
> > > CustomLog logs/httpd-log common
> > > AccessConfig conf/access.conf
> > > ResourceConfig conf/srm.conf
> > > 
> > > 
> > > 
> > > ServerName   myhost2.domain.com
> > > DocumentRoot /httpd/docs
> > > ErrorLog logs/httpd2-errors
> > > CustomLog logs/httpd2-log common
> > > AccessConfig conf/access2.conf
> > > ResourceConfig conf/srm2.conf
> > > 
> > > 
> > > 
> > > Now in srm.conf I set
> > > 
> > > PerlSetVar MyVariable MyValue
> > > PerlAuthenHandlerApache::Myhandler
> > > 
> > > 
> > > And in srm2.conf I have
> > > 
> > > PerlSetVar MyVariable2 MyValue2
> > > PerlAuthenHandlerApache::Myhandler
> > > 
> > > In Myhandler::handler I do 
> > > $myvar1 = $r->dir_config('MyVariable');
> > > $myvar2 = $r->dir_config('MyVariable2);
> > > 
> > > if($myvar1){
> > > ## do stuff for first virtual server
> > > }else{
> > > ## do stuff for the second one
> > > }
> > > 
> > > But $myvar1 appears to be ALWAYS set. Which leads me to belief that
> > > mod_perl "shares" variables between virtual servers if those variables
> > > are not explicitly set in configuration for that server.
> > > 
> > > Is this supposed to be this way? Or am I missing something?
> > > 
> > > Andrei

--
Eric



RE: multipart POST problems

1999-01-17 Thread Tubbs, Derric L

My understanding is that upload() is only for  only and
that param() handles all of the other form elements.  That's how I've
implemented it here and all works as expected.

BTW, I don't do any checking to see how the form was submitted. I use
Apache::Request for all of my form submission methods and everything works
fine, no matter how the information was submitted.

> --
> From: John S. Evans[SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, November 18, 1999 5:54 PM
> To:   modperl
> Cc:   [EMAIL PROTECTED]
> Subject:  multipart POST problems
> 
> I've been attempting to write a perl module that handles POSTs of type
> multipart/form-data, and have been having a rough time.
> 
> I'm using Apache::Request to process the request.  I have dumped the
> content-type of the incoming request, and verified that it's
> "multipart/form-data".  I can use param() to get the parameters, but I
> can't
> seem to use upload() to access the blocks directly.
> 
> I've included the code from my test handler below.  Basically it attempts
> to
> access a large parameter MIME block two ways - using param() and using
> upload().  The param() version works fine, but the upload() version can't
> find the block.
> 
> Any clues?  The only thing that I can think of is that for this test case,
> the MIME type of the "message" block is text/plain (it's in a TEXTAREA
> field, for testing purposes).  Is it possible that Apache::Request will
> not
> allow me to process "normal" form fields with upload()?
> 
> -jse
> 
> 
> sub handler
> {
> my $r = shift;
> my $apr = Apache::Request->new($r);
> my $block;
> my $buffer;
> 
> $r->content_type('text/html');
> $r->send_http_header();
> 
> $buffer = $apr->param('message');
> $r->print("Message:$buffer");
> 
> $block = $apr->upload('message');
> if ($block)
> {
> $r->print("Found message");
> }
> else
> {
> $r->print("No message");
> }
> 
> return OK;
> }
> 



RE: multipart/form-data

1999-01-17 Thread Tubbs, Derric L

Like I said in my other post, I use Apache::Request for all of the various
form submission methods and everything works fine and it allows me to handle
every type of submission with the same calls. It's less to remember when
coding.  I had problems at first getting uploads to work but that turned out
to be my own poor programming practices so I had to fix that :-)

> --
> From: John S. Evans[SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, November 18, 1999 12:30 AM
> To:   modperl
> Subject:  multipart/form-data
> 
> I need to implement an HTTP API that will be used to transfer random
> pieces
> of information (some small, some large) to our server.
> 
> I was thinking of using multipart/form-data to accomplish this, since I
> was
> assuming that there'd be tools on the server-side to help me deal with the
> incoming onslaught of data.
> 
> Now I need to decide whether I should build my server-side code as a
> modperl
> handler, or just build a perl CGI (and use Apache::Registry to make it
> zippy).
> 
> Any suggestions or recommendations for one method over the other?
> 
> Thanks for any info!
> 
> -jse
> 



Apache and too many children

1999-01-17 Thread Anthony Gardner

All,

Apache is spawning too many children. At present I've set MinSpareServers 5 
and MaxSpareServers 7 for testing but I now have 13 of them running!!

Is/Has anyone had problems of this nature? If so, was it Apache or the OS??

Current OS HP-UX 10 with all current patches applied.

Thanks in Adavnce


-Ants.

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



RE: Apache and too many children

1999-01-17 Thread Eric Cholet

> All,
> 
> Apache is spawning too many children. At present I've set MinSpareServers 5 
> and MaxSpareServers 7 for testing but I now have 13 of them running!!
> 
> Is/Has anyone had problems of this nature? If so, was it Apache or the OS??
> 
> Current OS HP-UX 10 with all current patches applied.
> 
> Thanks in Adavnce
> 

You need to set MaxClients.

--
Eric



Re: Apache::ASP and server-side includes

1999-01-17 Thread Mike Dameron

Lookup $Response->Include() in the docs.  It is used for exactly this purpose.

-Mike

Andrew Mayo wrote:

> Is it possible to configure Apache so that .asp files also support
> server-side includes?. I can configure Apache to successfully make .shtml
> files support server-side includes but the asp files have a .asp extension
> and if I change the handler for that, I'll end up disabling Apache::ASP. How
> do I get server-side includes to work as well, for files with an .asp
> extension?

--
ISIS 2000, Inc.
Your e-Partner. Not e-Vendor
e-Business, Systems Integration and Enterprise Management solutions
http://www.isis2000.com




Re: perl variable in configs for few virtual servers

1999-01-17 Thread Andrei A. Voropaev

Ok. I think I've figured that out

Reading documentation on Apache ResourceConfig directive. It states

--
Syntax: ResourceConfig filename
Default: ResourceConfig conf/srm.conf
Context: server config, virtual host
Status: core

The server will read this file for more directives after reading the
httpd.conf file. Filename is relative to the ServerRoot. This feature
can be disabled using: 

 ResourceConfig /dev/null
--

Which explains everything. I have 2 configs srm.conf and srm1.conf.
The first one is read BEFORE defining virtual servers that is why
variables from it are available in all virtual servers.

As usually I should have RTFM before complaining :)

Andrei


On Fri, Nov 19, 1999 at 10:09:33AM -0500, Andrei A. Voropaev wrote:
> Let me try that.
> 
> Andrei
> 
> On Fri, Nov 19, 1999 at 03:43:40PM +0100, Eric Cholet wrote:
> > But do you see the behaviour I see, that is, the problem is related to
> > the fact that you're using ResourceConfig? If you do this:
> > 
> > 
> > PerlSetVar var1 value1
> > 
> > 
> > 
> > PerlSetVar var2 value2
> > 
> > 
> > 
> > Now when you call a script in host2 do you see var1 as being set?
> > 
> > 
> > > Interesting. I can reproduce this problem on my machine easily. And
> > > it's pretty painful too because customers couldn't access my second
> > > virtual server for exactly that reason. As a quick fix I had to set
> > > the same variable to have different values. This works perfectly.
> > > 
> > > Maybe it has something to do with the way I've set up my virtual
> > > hosts?
> > > 
> > > I've checked few times already. I don't source srm.conf anywhere
> > > outside of , so the problem is not there
> > > definetely.
> > > 
> > > Anyway, I'll read Apache documentation on setting up Virtual
> > > Hosts. And do more testing. Basically this has come up only because I
> > > was too lazy to change couple lines in my module to expect different
> > > values from the same variable.
> > > 
> > > Andrei
> > > 
> > > 
> > > On Fri, Nov 19, 1999 at 12:40:24PM +0100, Eric Cholet wrote:
> > > > Andrei,
> > > > 
> > > > I do not see this behavior if I use PerlSetVar directly inside a 
> > > > section instead of via a ResourceConfig. I do see it if I move the directive
> > > > to the main server, so I suppose it's a scope issue with ResourceConfig.
> > > > 
> > > > 
> > > > > It's Apache 1.3.9, mod_perl 1.21 on Linux.
> > > > > 
> > > > > The only change I have is patch for correcting PATH enviroment
> > > > > corruption provided by Doug.
> > > > > 
> > > > > Andrei
> > > > > 
> > > > > On Tue, Nov 16, 1999 at 05:29:46PM +0100, Eric Cholet wrote:
> > > > > > Which version of mod_perl are you using, 1.21 or the CVS version perhaps?
> > > > > > 
> > > > > > > Hi!
> > > > > > > 
> > > > > > > I've encountered very interesting problem. When I set some variable
> > > > > > > using PerlSetVar in configuration files for different virtual servers
> > > > > > > they seem to be available to ALL of those virtual servers.
> > > > > > > 
> > > > > > > Here's details to clarify.
> > > > > > > 
> > > > > > > In httpd.conf I have
> > > > > > > 
> > > > > > > 
> > > > > > > ServerName   myhost1.domain.com
> > > > > > > DocumentRoot /httpd/docs
> > > > > > > ErrorLog logs/httpd-errors
> > > > > > > CustomLog logs/httpd-log common
> > > > > > > AccessConfig conf/access.conf
> > > > > > > ResourceConfig conf/srm.conf
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > ServerName   myhost2.domain.com
> > > > > > > DocumentRoot /httpd/docs
> > > > > > > ErrorLog logs/httpd2-errors
> > > > > > > CustomLog logs/httpd2-log common
> > > > > > > AccessConfig conf/access2.conf
> > > > > > > ResourceConfig conf/srm2.conf
> > > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > Now in srm.conf I set
> > > > > > > 
> > > > > > > PerlSetVar MyVariable MyValue
> > > > > > > PerlAuthenHandlerApache::Myhandler
> > > > > > > 
> > > > > > > 
> > > > > > > And in srm2.conf I have
> > > > > > > 
> > > > > > > PerlSetVar MyVariable2 MyValue2
> > > > > > > PerlAuthenHandlerApache::Myhandler
> > > > > > > 
> > > > > > > In Myhandler::handler I do 
> > > > > > > $myvar1 = $r->dir_config('MyVariable');
> > > > > > > $myvar2 = $r->dir_config('MyVariable2);
> > > > > > > 
> > > > > > > if($myvar1){
> > > > > > > ## do stuff for first virtual server
> > > > > > > }else{
> > > > > > > ## do stuff for the second one
> > > > > > > }
> > > > > > > 
> > > > > > > But $myvar1 appears to be ALWAYS set. Which leads me to belief that
> > > > > > > mod_perl "shares" variables between virtual servers if those variables
> > > > > > > are not explicitly set in configuration for that server.
> > > > > > > 
> > > > > > > Is this supposed to be this way? Or am I missing something?
> > > > > > > 
> > > > > > > Andrei
> > > > 
> > > > --
> > > > Eric
> > > 
> > > -- 
> > 
> 
> -- 

-- 



Re: Image::Magick and mod_perl

1999-01-17 Thread Randy Harmon


On Mon, Nov 15, 1999 at 01:14:43PM -0500, Todd Finney wrote:
> We're putting together a site that involves processing images uploaded by
> our users.   I'm using Image::Magick to resize the images to a standard
> size, and to create thumbnails.We will have an upload page, which hits
> a CGI under mod_perl that handles the form data and processes the image.
> 
> I am wondering if this is the best way to handle this.   When a user
> uploads an image and it's being processed, am I occupying an entire child
> process for the duration of the transaction?  If each transaction lasts a

It does occupy that child process.

> couple of seconds, it this a Bad Thing?   Is there a more efficient way to

Depends on your server, your visitor volume, and your standards of Bad.

> handle this?

Probably so, but only your own usage is likely to demonstrate proof.  An
alternative would be to accept the upload, add the picture to the database
that I infer you have, and tag it as needing to go through Image::Magick.
Every so often, perhaps with a cron job, process your accumulated work with
a plain perl script, fixing up the database as you go to reflect that the
work got done.

Of course, that makes assumptions like "you're using a database" et cetera. 
Adjust as required.  

Hope this helps.

Randy



Bug in libapreq makes form elements stick to an apache child

1999-01-17 Thread Jeffrey Baker

Hi,

I haven't had time to really hunt this bug to its source, but here is
the report anyway.

Take as an example the URI /program?foo=bar&foo=baz&foo=quux

In program, which uses libapreq, I have code which looks like this:

my @foo_in = $r->param('foo');

@foo_in should not be defined if there are no foo arguments in the query
string.  The problem is that once a foo argument has been seen, the
@foo_in array is defined in that Apache child process for all time.  The
array will not be defined in any other Apache child.

To reproduce the problem, use the handler I have included below and
perform the following steps:

1) Visit /yoururl
2) Visit /yoururl?foo=bar&foo=baz
3) Visit /yoururl as many times as you have Apache child processes

Here is the handler:

package JWB;
use Apache::Request;

use strict;

sub handler {
my $r = Apache::Request->new(shift());
$r->status(200);
$r->content_type("text/plain");
$r->send_http_header;

my @foo_in = $r->param('foo');

if (defined @foo_in) {
print "foo_in is defined!\n";
}
else {
print "foo_in is not defined!\n";
}

print "foo_in has this many entries: ",scalar(@foo_in);

return 0;
}

1;

Regards,
Jeffrey
-- 
Jeffrey W. Baker * [EMAIL PROTECTED]
Critical Path, Inc. * we handle the world's email * www.cp.net
415.808.8807



Re: Bug in libapreq makes form elements stick to an apache child

1999-01-17 Thread Jeffrey Baker

I should have mentioned in this bug report that the problem only occurs
when you call $r->param in a list context.  Everything is fine in a
scalar context.  For that reason I suspect this little bit of code:

sub param {
my $self = shift;
my($name, $value) = @_;
my $tab = $self->parms;
unless ($name) {
my %seen;
return wantarray ? grep { !$seen{$_}++ } keys %$tab : $tab;
}
if (defined $value) {
$tab->set($name, $value);
}
return wantarray ? ($tab->get($name)) : scalar $tab->get($name);
}

-jwb

Jeffrey Baker wrote:
> 
> Hi,
> 
> I haven't had time to really hunt this bug to its source, but here is
> the report anyway.
> 
> Take as an example the URI /program?foo=bar&foo=baz&foo=quux
> 
> In program, which uses libapreq, I have code which looks like this:
> 
> my @foo_in = $r->param('foo');
> 
> @foo_in should not be defined if there are no foo arguments in the query
> string.  The problem is that once a foo argument has been seen, the
> @foo_in array is defined in that Apache child process for all time.  The
> array will not be defined in any other Apache child.
> 
> To reproduce the problem, use the handler I have included below and
> perform the following steps:
> 
> 1) Visit /yoururl
> 2) Visit /yoururl?foo=bar&foo=baz
> 3) Visit /yoururl as many times as you have Apache child processes
> 
> Here is the handler:
> 
> package JWB;
> use Apache::Request;
> 
> use strict;
> 
> sub handler {
> my $r = Apache::Request->new(shift());
> $r->status(200);
> $r->content_type("text/plain");
> $r->send_http_header;
> 
> my @foo_in = $r->param('foo');
> 
> if (defined @foo_in) {
> print "foo_in is defined!\n";
> }
> else {
> print "foo_in is not defined!\n";
> }
> 
> print "foo_in has this many entries: ",scalar(@foo_in);
> 
> return 0;
> }
> 
> 1;
> 
> Regards,
> Jeffrey



Re: embperl-intermittant sig11 seg faults

1999-01-17 Thread Cliff Rayman

PROBLEM SOLVED.

the values for $req_rec in the page and in the subs started out the
same and then shifted after a period of time.

I now pass in the $req_rec from the page to the subroutines and no
more segfaulting.

Thanks for the help.

Is this a problem that you are going to correct with your code?  If not,
a gotcha in the documentation is warranted.

Are there any related gotcha's that I should be aware of based upon the
subroutine technique I am using?

On another note - I install my site enmasse then restart apache so the mtime
parameter
should not be a factor when I execute the subroutine package.

Thanks for the help!
cliff rayman
genwax.com



Gerald Richter wrote:

> > at the top of every page I have the following:
> >
> > [- Execute({inputfile => '/usr/local/apache/share/GWCe.htm',
> > mtime => 1, import
> > => 1}); -]
>
> Using the mtime parameters together with an file may lead to problems, when
> the file changes, while the httpd is running, but this is another story and
> not the problem we are searching for...
>
> > [- ordpag(); exit if $GWCe::xitflg; -]
> >
>
> I would like to see if $$req_rec (note the two $$), has the same value in
> the page and in your subs. Could you add something like
>
> warn "req_rec=$$req_rec" inside your script and inside the subs, then, when
> the Segfault occurs, look in the Apache error log if the value has changed
> between the page and the sub.
>
> > I was thinking that one way out of this problem would be to put
> > the following at the top of every page:
> > [- Execute({inputfile => '/usr/local/apache/share/GWCe.htm',
> > mtime => 1, import
> > => 1}); -]
> > [- ordpag($req_rec); exit if $GWCe::xitflg; -]
> >
>
> This may solve your problem, you can give it a try.
>
> Gerald



Re: Bug in libapreq makes form elements stick to an apache child

1999-01-17 Thread Cliff Rayman

`perldoc -f defined` yields a couple of sentences:

You may also use C to check whether a subroutine exists, by
saying C without parentheses.  On the other hand, use
of C upon aggregates (hashes and arrays) is not guaranteed to
produce intuitive results, and should probably be avoided.

why not use:

if(@foo_in)

instead of:

if (defined @foo_in)

cliff rayman
genwax.com

Jeffrey Baker wrote:

> Hi,
>
> I haven't had time to really hunt this bug to its source, but here is
> the report anyway.
>
> Take as an example the URI /program?foo=bar&foo=baz&foo=quux
>
> In program, which uses libapreq, I have code which looks like this:
>
> my @foo_in = $r->param('foo');
>
> @foo_in should not be defined if there are no foo arguments in the query
> string.  The problem is that once a foo argument has been seen, the
> @foo_in array is defined in that Apache child process for all time.  The
> array will not be defined in any other Apache child.
>
> To reproduce the problem, use the handler I have included below and
> perform the following steps:
>
> 1) Visit /yoururl
> 2) Visit /yoururl?foo=bar&foo=baz
> 3) Visit /yoururl as many times as you have Apache child processes
>
> Here is the handler:
>
> package JWB;
> use Apache::Request;
>
> use strict;
>
> sub handler {
> my $r = Apache::Request->new(shift());
> $r->status(200);
> $r->content_type("text/plain");
> $r->send_http_header;
>
> my @foo_in = $r->param('foo');
>
> if (defined @foo_in) {
> print "foo_in is defined!\n";
> }
> else {
> print "foo_in is not defined!\n";
> }
>
> print "foo_in has this many entries: ",scalar(@foo_in);
>
> return 0;
> }
>
> 1;
>
> Regards,
> Jeffrey
> --
> Jeffrey W. Baker * [EMAIL PROTECTED]
> Critical Path, Inc. * we handle the world's email * www.cp.net
> 415.808.8807



A few pointers, please.

1999-01-17 Thread Dave_Pfaltzgraff




From: Dave Pfaltzgraff@PATAPSCO on 11/19/99 01:45 PM

I'm fairly new at this and need a few pointers to possible resources.

I've used Apache::AuthenDBI and thus require the user to enter a user name and
password as expected. It all works. However, my customer has asked for either a
timeout, a [Logout] button, or both so that the browser basically 'forgets' the
user id. This would then remove the requirement for the user to close down the
browser when they leave their system.

Where can I look for assistence on this problem? My assumption is that it would
be a 'browser' thing so I wouldn't expect a direct answer from this group.

Thanks,
Dave




do "" command in Embperl

1999-01-17 Thread Martin A. Langhoff

hi all,


after many efforts [and 2 days sweating/swearing]  installing
Embperl, it's working now, and  I have a doubt ...

I can't include a series if site-wide configuration options that I
was used to load with a ` do"site.conf"; `  command.


   Is there a clean way  to go around this one? I've read the docs, and
foudn the section on subroutines and such, but seems more 'XSSI'
oriented.


Thanks all!

ml



--
   - Martin Langhoff @ S C I M  Multimedia Technology -
- http://www.scim.net  | God is real until  -
- mailto:[EMAIL PROTECTED]  | declared integer   -




Re: Image::Magick and mod_perl

1999-01-17 Thread Geoff Crawshaw

One solution is to use the 2 server setup described at
http://perl.apache.org/guide/scenario.html#One_Plain_and_One_mod_perl_enabl
and have the lightweight proxy server handle the upload as a regular
CGI process, after the file has uploaded redirect to a mod_perl
process for further processing. You can have a lot of lighweight proxy
processes handling uploads and only a few heavy mod_perl processes to
do the heavy lifting.

Todd Finney - Mon, Nov 15, 1999 at 01:14:43PM -0500
> We're putting together a site that involves processing images uploaded by
> our users.   I'm using Image::Magick to resize the images to a standard
> size, and to create thumbnails.We will have an upload page, which hits
> a CGI under mod_perl that handles the form data and processes the image.
> 
> I am wondering if this is the best way to handle this.   When a user
> uploads an image and it's being processed, am I occupying an entire child
> process for the duration of the transaction?  If each transaction lasts a
> couple of seconds, it this a Bad Thing?   Is there a more efficient way to
> handle this?
> 
> I saw the Apache::Magick demo in the modperl site, but it doesn't really
> apply to this situation, as I don't need to do dynamic rendering. 
> 
> thanks,
> Todd

-- 
Geoff Crawshaw
CTO
TimeBills.com Inc.




RE: embperl-intermittant sig11 seg faults

1999-01-17 Thread Gerald Richter

> PROBLEM SOLVED.
>
Fine :-)

> the values for $req_rec in the page and in the subs started out the
> same and then shifted after a period of time.
>

That was my suspicion...

> I now pass in the $req_rec from the page to the subroutines and no
> more segfaulting.
>
> Thanks for the help.
>
> Is this a problem that you are going to correct with your code?  If not,
> a gotcha in the documentation is warranted.
>

It's a bug somewhere in Embperl, so I will correct it, but at the first shot
I have to reproduce it here...

> Are there any related gotcha's that I should be aware of based upon the
> subroutine technique I am using?
>

I am not aware of any.

> On another note - I install my site enmasse then restart apache
> so the mtime
> parameter
> should not be a factor when I execute the subroutine package.
>

But you can simply leave out the mtime parameter and Embperl will make sure
that it's cache correspond to the file on the filesystem.


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 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-



RE: do "" command in Embperl

1999-01-17 Thread Gerald Richter

> I can't include a series if site-wide configuration options that I
> was used to load with a ` do"site.conf"; `  command.
>

A normal perl do should be no problem. You have to take care about file
permission (keep in mind that Apache runs as another user). Look at the $@
and $!, are there any error messages?

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 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-



Re: Bug in libapreq makes form elements stick to an apache child

1999-01-17 Thread Jeffrey Baker

Cliff Rayman wrote:
> 
> `perldoc -f defined` yields a couple of sentences:
> 
> You may also use C to check whether a subroutine exists, by
> saying C without parentheses.  On the other hand, use
> of C upon aggregates (hashes and arrays) is not guaranteed to
> produce intuitive results, and should probably be avoided.

I hate it when that happens.

> why not use:
> 
> if(@foo_in)
> 
> instead of:
> 
> if (defined @foo_in)

Yeah.  I guess the reason I do the latter is b/c I want the code to
reflect what I am actually trying to test.  I don't really want to test
the trueness of @foo, I want to test for it's existence.  But in perl
the operation is overloaded.  Feh.

I think I will test for defined $foo_in[0] instead.

-- 
Jeffrey W. Baker * [EMAIL PROTECTED]
Critical Path, Inc. * we handle the world's email * www.cp.net
415.808.8807



Re: Image::Magick and mod_perl

1999-01-17 Thread Autarch

On Mon, 15 Nov 1999, Todd Finney wrote:

> process for the duration of the transaction?  If each transaction lasts a
> couple of seconds, it this a Bad Thing?   Is there a more efficient way to
> handle this?

Unless you truly need to resize the image on the fly as part of the
transaction with the client I think this is probably a waste of a good mod
perl server.

Someone previously mentioned sticking the image file name in a db and
tagging it for resizing.  You could also put it in a resize_me directory
that gets scanned by a daemon or cron job.  You could have a daemon
running and talk to it via a socket  There's a lots of solutions.  To me
it seems silly to waste a fairly heavy mod_perl child (6-10 MB or memory
perhaps)  to resize an image in the background.  The whole point of mod
perl is to serve dynamic content, not to just be a generic processing
mechanism.

-Dave


/*==
www.urth.org
we await the New Sun
==*/



Re: embperl-intermittant sig11 seg faults

1999-01-17 Thread Cliff Rayman

if you need more info on how to reproduce it - let me know.

Gerald Richter wrote:

> > PROBLEM SOLVED.
> >
> Fine :-)
>
> > the values for $req_rec in the page and in the subs started out the
> > same and then shifted after a period of time.
> >
>
> That was my suspicion...
>
> > I now pass in the $req_rec from the page to the subroutines and no
> > more segfaulting.
> >
> > Thanks for the help.
> >
> > Is this a problem that you are going to correct with your code?  If not,
> > a gotcha in the documentation is warranted.
> >
>
> It's a bug somewhere in Embperl, so I will correct it, but at the first shot
> I have to reproduce it here...
>
> > Are there any related gotcha's that I should be aware of based upon the
> > subroutine technique I am using?
> >
>
> I am not aware of any.
>
> > On another note - I install my site enmasse then restart apache
> > so the mtime
> > parameter
> > should not be a factor when I execute the subroutine package.
> >
>
> But you can simply leave out the mtime parameter and Embperl will make sure
> that it's cache correspond to the file on the filesystem.
>
> 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 925151
> WWW:http://www.ecos.de  Fax:  +49 6133 925152
> -



Problems with mod_perl 1.2.1 and apache 1.3.9 - newbie - Please help!

1999-01-17 Thread Scott Chapman

I'm new to compiling my own software and attempting to get 
mod_perl and apache to work together.  I have Redhat 6.0. 

I thought this was supposed to use gcc, not cc and I am getting no 
make action when it's done. 

I would _greatly_ appreciate any help on resolving this.  I'm teaching 
myself Embperl and want it to have Virtual Logging.  It appears that 
it must be a Apache module in order to enable this feature. 

I have the following directories in /usr/src mod_perl-1.21 
apache_1.3.9 

I just did gzip -d on the .gz files and then tar -xvf on the subsequent 
tar files. 

Then I went to the mod_perl-1.21 directory and did: $ perl 
Makefile.PL \  APACHE_PREFIX=/www \  DO_HTTPD=1 \  
USE_APACI=1 \  EVERYTHING=1 > makeout.log 2>&1 
 Makeout.log is here: 

Will run tests as User: 'nobody' Group: 'root' 
Configuring for Apache, Version 1.3.9 
 + using installation path layout: Apache (config.layout) 
 + activated perl module (modules/perl/libperl.a) 
Creating Makefile 
Creating Configuration.apaci in src 
  + id: mod_perl/1.21 
  + id: Perl/5.00503 (linux) [perl] 
Creating Makefile in src 
 + configured for Linux platform 
 + setting C pre-processor to cc -E 
 + checking for system header files 
 + adding selected modules 
o perl_module uses ConfigStart/End 
  + mod_perl build type: OBJ 
  + setting up mod_perl build environment 
  + adjusting Apache build environment 
  + enabling Perl support for SSI (mod_include) 
 + checking sizeof various data types 
 + doing sanity check on compiler and options 
** A test compilation with your Makefile configuration 
** failed. This is most likely because your C compiler 
** is not ANSI. Apache requires an ANSI C Compiler, such 
** as gcc. The above error message from your compiler 
** will also provide a clue. 
 Aborting! 
Will configure via APACI 
cp apaci/Makefile.libdir 
./apache_1.3.9/src/modules/perl/Makefile.libdir 
cp apaci/Makefile.tmpl ../apache_1.3.9/src/modules/perl/Makefile.tmpl 
cp apaci/README ../apache_1.3.9/src/modules/perl/README 
cp apaci/configure ../apache_1.3.9/src/modules/perl/configure 
cp apaci/libperl.module 
./apache_1.3.9/src/modules/perl/libperl.module 
cp apaci/mod_perl.config 
./apache_1.3.9/src/modules/perl/mod_perl.config 
cp apaci/mod_perl.config.sh 
./apache_1.3.9/src/modules/perl/mod_perl.config.sh 
cp apaci/load_modules.pl.PL 
./apache_1.3.9/src/modules/perl/load_modules.pl.PL 
cp apaci/find_source.PL 
./apache_1.3.9/src/modules/perl/find_source.PL 


[everything snipped].enabled 


(cd ../apache_1.3.9 && CC="cc" ./configure 
--activate-module=src/modules/perl/libperl.a --prefix=/www) 
Checking CGI.pm VERSION..ok 
Checking for LWP::UserAgent..ok 
Checking for HTML::HeadParserok 
Writing Makefile for Apache 
Writing Makefile for Apache::Connection 
Writing Makefile for Apache::Constants 
Writing Makefile for Apache::File 
Writing Makefile for Apache::Leak 
Writing Makefile for Apache::Log 
Writing Makefile for Apache::ModuleConfig 
Writing Makefile for Apache::PerlRunXS 
Writing Makefile for Apache::Server 
Writing Makefile for Apache::Symbol 
Writing Makefile for Apache::Table 
Writing Makefile for Apache::URI 
Writing Makefile for Apache::Util 
Writing Makefile for mod_perl 



Then I ran make > make.log 2>&1 


Make.log is here: 


(cd ../apache_1.3.9 && make) 
make[1]: Entering directory `/usr/src/apache_1.3.9' 
===> src 
make[2]: Entering directory `/usr/src/apache_1.3.9' 
make[3]: Entering directory `/usr/src/apache_1.3.9/src' 
make[3]: *** No rule to make target `all'.  Stop. 
make[3]: Leaving directory `/usr/src/apache_1.3.9/src' 
make[2]: *** [build-std] Error 2 
make[2]: Leaving directory `/usr/src/apache_1.3.9' 
make[1]: *** [build] Error 2 
make[1]: Leaving directory `/usr/src/apache_1.3.9' 
make: *** [apaci_httpd] Error 2 





--
Scott Chapman
Technical Support Specialist
Lund Performance Solutions
[EMAIL PROTECTED] or [EMAIL PROTECTED]
Phone: 541-926-3800 www.lund.com



Re: A few pointers, please.

1999-01-17 Thread James G Smith

[EMAIL PROTECTED] wrote:
>I'm fairly new at this and need a few pointers to possible resources.
>
>I've used Apache::AuthenDBI and thus require the user to enter a user name and
>password as expected. It all works. However, my customer has asked for either 
a
>timeout, a [Logout] button, or both so that the browser basically 'forgets' 
the
>user id. This would then remove the requirement for the user to close down the
>browser when they leave their system.
>
>Where can I look for assistence on this problem? My assumption is that it 
would
>be a 'browser' thing so I wouldn't expect a direct answer from this group.

Due to the stateless nature of HTTP, a timeout is not quite possible with 
protocol level authentication.  What you are wanting would either require a 
cookie or URL munging.

Several modules exist on CPAN which can provide what you are looking for:

Apache::AuthCookie
  Uses session keys to track users.  Authentication appears to be restricted 
to one website.  This code has been around a while and is more mature.

Authen::Ticket
  Uses cookies to provide an authenticating ticket.  The ticket may be signed 
using El Gamal (public key).  Authenticating tickets may be presented to 
multiple websites.  Newer code with bugs still being worked out.

Both modules allow a high level of customization in most phases.  Neither can 
handle mid-POST authentication yet.  Both are similar, but with different 
emphasis.  Both come with example code.
-- 
James Smith <[EMAIL PROTECTED]>, 409-862-3725
Texas A&M CIS Operating Systems Group, Unix




Re: Bug in libapreq makes form elements stick to an apache child

1999-01-17 Thread Matt Sergeant

On Fri, 19 Nov 1999, Jeffrey Baker wrote:
> 1) Visit /yoururl
> 2) Visit /yoururl?foo=bar&foo=baz
> 3) Visit /yoururl as many times as you have Apache child processes

httpd -X

-- 


Details: FastNet Software Ltd - XML, Perl, Databases.
Tagline: High Performance Web Solutions
Web Sites: http://come.to/fastnet http://sergeant.org
Available for Consultancy, Contracts and Training.



Re: Apache::ASP and server-side includes

1999-01-17 Thread Joshua Chamas

Andrew Mayo wrote:
> 
> Is it possible to configure Apache so that .asp files also support
> server-side includes?. I can configure Apache to successfully make .shtml
> files support server-side includes but the asp files have a .asp extension
> and if I change the handler for that, I'll end up disabling Apache::ASP. How
> do I get server-side includes to work as well, for files with an .asp
> extension?

 includes are handled by Apache::ASP 
directly.  To enable the rest, you must filter the ASP output
through Apache::Filter.  See:

  http://www.nodeworks.com/asp/ssi.html
  http://www.nodeworks.com/asp/config.html#Filter

-- Joshua
_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks >> free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051



Apache::Cookie confusion

1999-01-17 Thread John Siracusa

Apache::Cookie seems to have two different interfaces...or maybe there
are two different distributions of Apache::Cookie?  Whatever it is, the
interface seems different on two machines here at work.  One has 5.004
and one has 5.005, but that shouldn't change the Apache::Cookie interface
should it?

The interfaces are totally different.  One uses set() and get(), either
from an object or via Apache::Cookie->get().  The other purports to
use the CGI::Cookie interface but only accepts the methods it documents
itself: fetch(), bake(), etc.

In my code, I "use Apache::Cookie" and then bang away trying to figure
out what methods it supports.  The result is that the code on machine1
that calls Apache::Cookie->get('mycookie') dies with an undefined
subroutine error when run on machine2 (and vise versa for code on
machine2 that uses fetch() and bake()).

What am I missing here?  I've done "force install Apache::Cookie"
from the CPAN shell prompt several time to try to make sure everything
is in sync, but the discrepancy still exists, and I still don't know
what the correct interface to Apache::Cookie should be.  My hunch is
that the get() and fetch() versions are completely separate modules
that both declare "package Apache::Cookie", but good old CPAN should
allow that, should it?

Can someone set me straight?

-John

P.S.-Documentation snippets from the two machines:

On machine 1:

% perldoc Apache::Cookie

NAME
 The Apache::Cookie module - An OO interface to cookies based
 on CGI::Cookie, for use in mod_perl Apache modules.

SYNOPSIS
  use Apache::Cookie;

  $r = Apache->request;

  # Object oriented
  $cookie = Apache::Cookie->new($r);

  $cookie->set(-name => 'cookie', -value => 'monster');
  $value = $cookie->get('cookie');

...

On machine 2:

% perldoc Apache::Cookie

NAME
 Apache::Cookie - HTTP Cookies Class

SYNOPSIS
 use Apache::Cookie ();
 my $cookie = Apache::Cookie->new($r, ...);


DESCRIPTION
 The Apache::Cookie module is a Perl interface to the cookie
 routines in libapreq.  The interface is based on Lincoln
 Stein's CGI::Cookie module.
...




Re: Apache::ASP config question

1999-01-17 Thread Joshua Chamas

Brad Babb wrote:
> 
> Hi,
> I'm about to put a site into production using Apache::ASP, and need to have
> a development side to the site to continue working.
> I won't to be able to have 2 difference Application, one for the production
> side, and one for the development side.  What do I need to do to make this
> work.  I tried something like this in httpd.conf, but didn't seem to work..
> 

What didn't work about your config ?

> I'd also like to turn off all the debugging, etc, on the production side but
> like it on in the development side...

Debug 0 for production.

> I may just be tired, (or dumb) and have missed something or just way off,
> but need help anyway..

If you want a separate Application, just set StateDir to something
different.  In your config, I didn't see a global set, which is
very bad in production because then your state files will end 
up on Global/.state, which will be world readable, if Global
is '.', the default setting.

Note that you can use the same StateDir for both production
& development if you like, but not recommended, since you 
should isolate as much as possible the separate environments.
Further degrees of isolation would include separate apache
web servers, separate perl builds, ... (?)

-- Joshua
_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks >> free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051



Re: Bug in libapreq makes form elements stick to an apache child

1999-01-17 Thread Ken Williams

[EMAIL PROTECTED] (Jeffrey Baker) wrote:
>Cliff Rayman wrote:
>> 
>> `perldoc -f defined` yields a couple of sentences:
>> 
>> You may also use C to check whether a subroutine exists, by
>> saying C without parentheses.  On the other hand, use
>> of C upon aggregates (hashes and arrays) is not guaranteed to
>> produce intuitive results, and should probably be avoided.
>
>I hate it when that happens.
>
>> why not use:
>> 
>> if(@foo_in)
>> 
>> instead of:
>> 
>> if (defined @foo_in)
>
>Yeah.  I guess the reason I do the latter is b/c I want the code to
>reflect what I am actually trying to test.  I don't really want to test
>the trueness of @foo, I want to test for it's existence.  But in perl
>the operation is overloaded.  Feh.
>
>I think I will test for defined $foo_in[0] instead.

Are you sure?  I'm still not sure you understand about defined(@list).  It
actually tests whether Perl has allocated memory for the structure, not whether
the structure has ever been used or anything like that.  And even the present
behavior may change without notice.

When you do "my @list = &func();" and &func returns no values, @list will be an
empty list.  And it will evaluate in a boolean context to 0 (the number of
elements), which is false.  You shouldn't really care whether Perl has
allocated memory to it or not, because different versions of Perl will give you
different results with that test.

Finally, what if &func returns (undef, 1) or even (undef)?  If you use your
"defined $list[0]" test, you'll get a false result here, when &func actually
did return stuff.

Of course, I don't know your specific application, but "defined @list" is one
of the red flags of code.


  ------
  Ken Williams Last Bastion of Euclidity
  [EMAIL PROTECTED]The Math Forum




Re: Bug in libapreq makes form elements stick to an apache child

1999-01-17 Thread Jeffrey Baker

Ken Williams wrote:
> Are you sure?  I'm still not sure you understand about defined(@list).  It
> actually tests whether Perl has allocated memory for the structure, not whether
> the structure has ever been used or anything like that.  And even the present
> behavior may change without notice.

Actually that isn't what defined does.  defined is supposed to indicate
whether something has a real value or not.  It is not and should not be
related to whether Perl has allocated memory for it, although one
implies the other.  If no memory has been allocated, then the value is
certainly undefined.  However, if memory has been allocated the value
may or may not be defined.

I understand that defined doesn't work on lists and hashes.  I had
simply forgotten about that bit of trivia.  defined most certainly does
work on list *members* and hash *entries*.  For example, 'defined
$hash{key}' is definitely going to work.  Same for 'defined $array[0]'.

> When you do "my @list = &func();" and &func returns no values, @list will be an
> empty list.  And it will evaluate in a boolean context to 0 (the number of
> elements), which is false.  You shouldn't really care whether Perl has
> allocated memory to it or not, because different versions of Perl will give you
> different results with that test.

I don't care whether Perl has allocate memory or not.  All I care about
is whether or not there are any defined entries in the list, which I
think is most clearly expressed as 'if (defined $list[0])'.  What is
more clear than that?  'if (@list)' could certainly work because an
empty list evaluates to 0 in a scalar context.  But the code doesn't
look like what I am intending to do.

> Finally, what if &func returns (undef, 1) or even (undef)?  If you use your
> "defined $list[0]" test, you'll get a false result here, when &func actually
> did return stuff.

Obviously I need to know the calling conventions and return values for
all of my functions :)  In this case the function must either return an
empty list, or a list consisting of only defined scalar values.

> Of course, I don't know your specific application, but "defined @list" is one
> of the red flags of code.

Right.  As I said I simply managed to let that bit of info slip my
mind.  Perhaps I should use lint or some such.

-jwb
-- 
Jeffrey W. Baker * [EMAIL PROTECTED]
Critical Path, Inc. * we handle the world's email * www.cp.net
415.808.8807



Web Site Service Improvements

1999-01-17 Thread The Doctor

Question:

Has anyone devlopped a Web Mail interface using perl?

With mod_perl is there an available 'plug-in'?



Re: Bug in libapreq makes form elements stick to an apache child

1999-01-17 Thread Randal L. Schwartz

> "Jeffrey" == Jeffrey Baker <[EMAIL PROTECTED]> writes:

Jeffrey> Yeah.  I guess the reason I do the latter is b/c I want the code to
Jeffrey> reflect what I am actually trying to test.  I don't really want to test
Jeffrey> the trueness of @foo, I want to test for it's existence.  But in perl
Jeffrey> the operation is overloaded.  Feh.

Jeffrey> I think I will test for defined $foo_in[0] instead.

"if (@foo) {...}" is *idiomatic* Perl for "are there any elements in
@foo, and if so, do this".  If you don't understand the idioms, please
choose a more familiar language. :)

defined @bar and defined %bletch are almost never correct, and any
seasoned Perl hacker knows to watch for those as a red flag.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



RE: Apache and too many children

1999-01-17 Thread Clinton Gormley

You need to set MaxClients to the maximum number of children you want.

Clint


> -Original Message-
> From: Anthony Gardner [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 19, 1999 2:46 PM
> To: [EMAIL PROTECTED]
> Subject: Apache and too many children
> 
> 
> All,
> 
> Apache is spawning too many children. At present I've set 
> MinSpareServers 5 
> and MaxSpareServers 7 for testing but I now have 13 of them running!!
> 
> Is/Has anyone had problems of this nature? If so, was it 
> Apache or the OS??
> 
> Current OS HP-UX 10 with all current patches applied.
> 
> Thanks in Adavnce
> 
> 
> -Ants.
> 
> __
> Get Your Private, Free Email at http://www.hotmail.com
> 



Problems with mod_perl 1.2.1 and apache 1.3.9 - newbie - Please help!

1999-01-17 Thread Scott Chapman

I'm new to compiling my own software and attempting to get mod_perl
and apache to work together.  I have Redhat 6.0.

I thought this was supposed to use gcc, not cc and I am getting no
make action when it's done.

I would _greatly_ appreciate any help on resolving this.  I'm teaching
myself Embperl and want it to have Virtual Logging.  It appears that
it must be a Apache module in order to enable this feature.

I have the following directories in /usr/src
mod_perl-1.21
apache_1.3.9

I just did gzip -d on the .gz files and then tar -xvf on the
subsequent tar files.

Then I went to the mod_perl-1.21 directory and did:
$ perl Makefile.PL \
 APACHE_PREFIX=/www \
 DO_HTTPD=1 \
 USE_APACI=1 \
 EVERYTHING=1 > makeout.log 2>&1
 
Makeout.log is here:

Will run tests as User: 'nobody' Group: 'root'
Configuring for Apache, Version 1.3.9
 + using installation path layout: Apache (config.layout)
 + activated perl module (modules/perl/libperl.a)
Creating Makefile
Creating Configuration.apaci in src
  + id: mod_perl/1.21
  + id: Perl/5.00503 (linux) [perl]
Creating Makefile in src
 + configured for Linux platform
 + setting C pre-processor to cc -E
 + checking for system header files
 + adding selected modules
o perl_module uses ConfigStart/End
  + mod_perl build type: OBJ
  + setting up mod_perl build environment
  + adjusting Apache build environment
  + enabling Perl support for SSI (mod_include)
 + checking sizeof various data types
 + doing sanity check on compiler and options
** A test compilation with your Makefile configuration
** failed. This is most likely because your C compiler
** is not ANSI. Apache requires an ANSI C Compiler, such
** as gcc. The above error message from your compiler
** will also provide a clue.
 Aborting!
Will configure via APACI
cp apaci/Makefile.libdir
./apache_1.3.9/src/modules/perl/Makefile.libdir
cp apaci/Makefile.tmpl ../apache_1.3.9/src/modules/perl/Makefile.tmpl
cp apaci/README ../apache_1.3.9/src/modules/perl/README
cp apaci/configure ../apache_1.3.9/src/modules/perl/configure
cp apaci/libperl.module
./apache_1.3.9/src/modules/perl/libperl.module
cp apaci/mod_perl.config
./apache_1.3.9/src/modules/perl/mod_perl.config
cp apaci/mod_perl.config.sh
./apache_1.3.9/src/modules/perl/mod_perl.config.sh
cp apaci/load_modules.pl.PL
./apache_1.3.9/src/modules/perl/load_modules.pl.PL
cp apaci/find_source.PL
./apache_1.3.9/src/modules/perl/find_source.PL

[everything snipped].enabled

(cd ../apache_1.3.9 && CC="cc" ./configure
--activate-module=src/modules/perl/libperl.a --prefix=/www)
Checking CGI.pm VERSION..ok
Checking for LWP::UserAgent..ok
Checking for HTML::HeadParserok
Writing Makefile for Apache
Writing Makefile for Apache::Connection
Writing Makefile for Apache::Constants
Writing Makefile for Apache::File
Writing Makefile for Apache::Leak
Writing Makefile for Apache::Log
Writing Makefile for Apache::ModuleConfig
Writing Makefile for Apache::PerlRunXS
Writing Makefile for Apache::Server
Writing Makefile for Apache::Symbol
Writing Makefile for Apache::Table
Writing Makefile for Apache::URI
Writing Makefile for Apache::Util
Writing Makefile for mod_perl


Then I ran make > make.log 2>&1

Make.log is here:

(cd ../apache_1.3.9 && make)
make[1]: Entering directory `/usr/src/apache_1.3.9'
===> src
make[2]: Entering directory `/usr/src/apache_1.3.9'
make[3]: Entering directory `/usr/src/apache_1.3.9/src'
make[3]: *** No rule to make target `all'.  Stop.
make[3]: Leaving directory `/usr/src/apache_1.3.9/src'
make[2]: *** [build-std] Error 2
make[2]: Leaving directory `/usr/src/apache_1.3.9'
make[1]: *** [build] Error 2
make[1]: Leaving directory `/usr/src/apache_1.3.9'
make: *** [apaci_httpd] Error 2




--
Scott Chapman
Technical Support Specialist
Lund Performance Solutions
[EMAIL PROTECTED] or [EMAIL PROTECTED]
Phone: 541-926-3800 www.lund.com



Re: Can you pass on information? (was Re: chunked POST)

1999-01-17 Thread Tom Amiro


"Richard L. Goerwitz" wrote:
Tom Amiro wrote:
>
> I assume Apache does support the HTTP 1.1 spec and that
> chunked POST can be used to return dynamic CGI output, so
> I don't understand why such tests are failing. But maybe this
> test isn't testing what I think it is.
>
> Anyone know what's going on?
Wow.  If you find out what's going on, could you pass this information
on to the rest of the list (or to individuals who ask)?
David R Michaels helped me understand what was going on.
He wrote:

The ApacheWeek quote appears to be about chunking CGI output, we need
chunking into CGI.

My test was trying to do chunking into CGI. David goes on

One of the PrintXchange developers ...



tells me that apache v1.3 is not working w/ their CGI scripts. We also
had someone search the apache site for mention of chunking support in the
new minor versions but can find little or no mention of chunking in general,
nothing specific to input to cgi-bin. I'm not that knowledgeable about
apache, or web servers in general, more on the network/OS support side of
this. But, am under the impression that if the web server doesn't recombine
the chunks prior to sending to cgi-bin, then it can't fill in the size
argument that is part of the CGI interface. Other posts I found on dejanews
implied that apache just doesn't do this, (search apache+chunking+CGI).

I've received a few replies saying that the test failed because it didn't
include Content-Length,
which is what Apache's error message is saying. I was confusing chunked
input to
CGI versus chunked output from CGI. The fact that the test doing chunked
input
to CGI worked with the Sun Web Server 1.2, but not Apache 1.3.6 contributed
to
my expectation that such a request should work with Apache.
I wonder if there is any possibility that Apache will be enhanced to
behave
like Sun Web Server 1.2 and permit chunked input to CGI. There is at
least
one group that David mentioned that has a need for it, and there may
be
others.
Does mod_perl offer support for this, so that existing client software
doesn't
have to tack on the Content Length to requests?
Tom


Re: A few pointers, please.

1999-01-17 Thread Mark Cogan

At 01:45 PM 11/19/99 -0500, [EMAIL PROTECTED] wrote:
>From: Dave Pfaltzgraff@PATAPSCO on 11/19/99 01:45 PM
>
>I'm fairly new at this and need a few pointers to possible resources.
>
>I've used Apache::AuthenDBI and thus require the user to enter a user name
and
>password as expected. It all works. However, my customer has asked for
either a
>timeout, a [Logout] button, or both so that the browser basically
'forgets' the
>user id. This would then remove the requirement for the user to close down
the
>browser when they leave their system.
>
>Where can I look for assistence on this problem? My assumption is that it
would
>be a 'browser' thing so I wouldn't expect a direct answer from this group.

Exactly. The Basic Authentication scheme requires that the username and
password be sent with each request; most browsers store this information
after it has been entered once, and hang onto it until they are closed down. 

If you want to have a timeout or logout system, you need to implement some
kind of session-based authentication. 
---
Mark Cogan[EMAIL PROTECTED] +1-520-881-8101 
ArtToday  www.arttoday.com   perl.apache.solaris.oracle
"English is easy to learn -- all of the words are borrowed from C++"



Apache::ASP

1999-01-17 Thread Aroc725

I've written a short ASP page, 'HelloWorld.asp':



Hello World


Hello World! The time is <% Now %>



But when I try to test the page, I get the output below. Isn't Now a function 
supported by ASP?

Errors Output

Response::Now not defined at 
/usr/local/encap/perl-5.005.3/lib/site_perl/5.005/Apache/ASP.pm line 2171
Apache::ASP::Response::AUTOLOAD('Apache::ASP::Response=HASH(0x83584a4)') 
called at (eval 200) line 6

Apache::ASP::Demo::_home_webpages_userworld_htdocs_users_varocho1_asp_HelloWor
ld_aspINLINE() called at 
/usr/local/encap/perl-5.005.3/lib/site_perl/5.005/Apache/ASP.pm line 1051
eval {...} called at 
/usr/local/encap/perl-5.005.3/lib/site_perl/5.005/Apache/ASP.pm line 1051
Apache::ASP::Execute('Apache::ASP=HASH(0x8359c5c)') called at 
/usr/local/encap/perl-5.005.3/lib/site_perl/5.005/Apache/ASP.pm line 125
Apache::ASP::handler('Apache=SCALAR(0x8215d30)') called at /dev/null line 
0
eval {...} called at /dev/null line 0
, /usr/local/encap/perl-5.005.3/lib/site_perl/5.005/Apache/ASP.pm line 1053

Debug Output

STARTING ASP HANDLER (v0.14) for file 
/home/webpages/userworld/htdocs/users/varocho1/asp/HelloWorld.asp
GlobalASA package Apache::ASP::Demo
created $Application - 
SessionCookie - 714a9dc4950f93a39d03dd1b6c9ce922
session timed out, clearing
Session_OnEnd - session: 714a9dc4950f93a39d03dd1b6c9ce922; 
tieing session - 
clearing starting session
forcing groups cleanup
group check GroupId71
skipping delete self - id: 714a9dc4950f93a39d03dd1b6c9ce922; 
cleanup groups - deleted: 0; 
Application_OnEnd
Application_OnStart
Session_OnStart - session: 714a9dc4950f93a39d03dd1b6c9ce922; 
ASP object created - Application: Apache::ASP::Application=HASH(0x8359b9c); 
GlobalASA: Apache::ASP::GlobalASA=HASH(0x839eda8); Internal: 
Apache::ASP::State=HASH(0x8328334); Request: 
Apache::ASP::Request=HASH(0x8359b54); Response: 
Apache::ASP::Response=HASH(0x83584a4); Server: 
Apache::ASP::Server=HASH(0x839e510); Session: 
Apache::ASP::Session=HASH(0x8359de8); app_start: 0; basename: HelloWorld.asp; 
buffering_on: 1; cgi_do_self: 0; cgi_headers: ; clean: 0; command_line: ; 
compile_error: ; compile_includes: ; cookie_path: /; debug: 2; debugs_output: 
ARRAY(0x839e408); dirname: 
/home/webpages/userworld/htdocs/users/varocho1/asp; errors: 0; errors_output: 
ARRAY(0x8282858); filehandle: ; filename: 
/home/webpages/userworld/htdocs/users/varocho1/asp/HelloWorld.asp; filter: 0; 
global: /home/webpages/userworld/htdocs/users/varocho1/asp/.; global_package: 
Apache::ASP::Demo; group_refresh: 3; groups_refresh: 3; id: 
_home_webpages_userworld_htdocs_users_varocho1_asp_HelloWorld_aspINLINE; 
init_packages: ARRAY(0x839d184); mail_alert_period: 20; mail_alert_to: ; 
mail_errors_to: ; mail_host: ; mtime: 943039109; no_cache: ; no_headers: 0; 
no_session: 0; no_state: ; package: Apache::ASP::Demo; paranoid_session: 0; 
pod_comments: 1; r: Apache=SCALAR(0x8215d30); remote_ip: 209.16.196.244; 
script_timeout: 90; secure_session: ; session_serialize: ; session_timeout: 
30; soft_redirect: ; stat_inc: 1; stat_inc_match: CGI; state_db: SDBM_File; 
state_dir: /home/webpages/userworld/htdocs/users/varocho1/tmp/asp_demo; 
state_manager: 10; ua: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; 
DigExt); unique_packages: 0; 
parsing HelloWorld.asp
undefing sub 
Apache::ASP::Demo::_home_webpages_userworld_htdocs_users_varocho1_asp_HelloWor
ld_aspINLINE active code CODE(0x8357ec8) before compiling
compiling into package Apache::ASP::Demo
Script_OnStart
executing 
_home_webpages_userworld_htdocs_users_varocho1_asp_HelloWorld_aspINLINE
Response::Now not defined at 
/usr/local/encap/perl-5.005.3/lib/site_perl/5.005/Apache/ASP.pm line 2171
Apache::ASP::Response::AUTOLOAD('Apache::ASP::Response=HASH(0x83584a4)') 
called at (eval 200) line 6

Apache::ASP::Demo::_home_webpages_userworld_htdocs_users_varocho1_asp_HelloWor
ld_aspINLINE() called at 
/usr/local/encap/perl-5.005.3/lib/site_perl/5.005/Apache/ASP.pm line 1051
eval {...} called at 
/usr/local/encap/perl-5.005.3/lib/site_perl/5.005/Apache/ASP.pm line 1051
Apache::ASP::Execute('Apache::ASP=HASH(0x8359c5c)') called at 
/usr/local/encap/perl-5.005.3/lib/site_perl/5.005/Apache/ASP.pm line 125
Apache::ASP::handler('Apache=SCALAR(0x8215d30)') called at /dev/null line 
0
eval {...} called at /dev/null line 0
, /usr/local/encap/perl-5.005.3/lib/site_perl/5.005/Apache/ASP.pm line 1053
Script_OnEnd

ASP to Perl Program

  1: package Apache::ASP::Demo;  ;; no strict; ;; use vars qw($Application 
$Session $Response $Server $Request); ;; sub 
Apache::ASP::Demo::_home_webpages_userworld_htdocs_users_varocho1_asp_HelloWor
ld_aspINLINE {  ;;  return(1) unless $_[0]; @_ = (); ;; $Response->Write('
  2: 
  3: Hello World
  4: 
  5: 
  6: Hello World! The time is '); Now $Response->Write('
  7: 
  8: '); ;; }



Re: Bug in libapreq makes form elements stick to an apache child

1999-01-17 Thread brian moseley

On Fri, 19 Nov 1999, Matt Sergeant wrote:

> httpd -X

good production solution.