building mod_perl against multiple apache's, make test fails looking for apr.so

2006-03-02 Thread mbockol

Hi Folks,

I'm trying to set up a dev box with both apache 2.0.55 and 2.2.0 . 
Since I've got both, I didn't want to set /usr/local/http-2.0.55/lib in 
my /etc/ld.so.conf since then the 2.2.0 binaries might look at the 
wrong APR (well.. that's my guess).


I tried:

perl Makefile MP_APXS=/usr/local/httpd-2.0.55/bin/apxs 
MP_APR_CONFIG=/usr/local/httpd-2.0.55/bin/apr-config


It builds without error. Make test fails a number of places because it 
can't find apr.so.


If I set /usr/local/httpd-2.0.55/lib in ld.so.conf, or set  SETENV 
LD_LIBRARY_PATH then all is well, but then what about 2.2.0?


If mod_perl is running under a particular apache as a dso then does it 
just inherit the right apr and the make test is nothing to worry about?


Thanks for any insight you can provide.

Matt Bockol
Web Technical Administrator, Carleton College






Re: Apache::Session::MySQL lock troubles

2006-03-02 Thread Jonathan Vanasco


you could also try this:

store to /whatever/
read from memcached
failover to /whatever/

assuming you have the memory for it, it should handle spikes very well



Re: Perl Script using MapToStorageHandler

2006-03-02 Thread Torsten Foertsch
On Thursday 02 March 2006 15:34, Geoffrey Young wrote:
> thanks for the detailed explanations.  torsten++ :)
>
> > That leads to an error saying that " > point.
> >
> > But, a few thing cannot be applied by means of $r->add_config. For
> > example "AllowOverride" needs a "Directory" block
>
> I think what most people don't understand about $r->add_config() is that
> it's .htaccess-style configuration injection.  so, if you can't use a given
> config from an .htaccess file you can't use add_config() for it either.

Well, that is not entirely true at least if the mentioned patch is applied. 
For example AllowOverride cannot be used in a .htaccess. But with the patch 
you can say:

  $r->add_config( ['',
   'AllowOverride AuthConfig Options=Indexes,ExecCGI',
   '',
  ], ~0, '' );

If done in a MapToStorage handler that returns DECLINED it even affects the 
subsequent processing of a .htaccess file.

Or to do something like .htaccess processing:

use Apache2::Access;
use Apache2::RequestUtil;

{
  local @ARGV=($htaccess_file_name);
  $r->add_config( [<>], $r->allow_override, '/', $r->allow_override_opts );
}

Torsten


pgpCuQDFuW3yB.pgp
Description: PGP signature


Re: Apache::Session::MySQL lock troubles

2006-03-02 Thread Perrin Harkins
On Thu, 2006-03-02 at 14:10 -0500, Dan Axtell wrote:
> I've been using Apache::Session::MySQL for a while, but I've been trying to 
> lower the amount of database I/O in some applications that experience spikes 
> in server traffic.  So I came up with the idea of using Apache::Session::File 
> with the files on /dev/shm, with a cron job to clear up old or expired 
> sessions.  Preliminary benchmarks found this to be about 7-8 times faster 
> than MySQL.

Sure, it's local.  Using BerkeleyDB would also be faster than MySQL.
The downside of your approach is that it can't scale across a cluster of
machines, and has no on-disk backup.  If you only have one machine, it's
probably fine.

- Perrin



Re: Apache::Session::MySQL lock troubles

2006-03-02 Thread Dan Axtell
I've been using Apache::Session::MySQL for a while, but I've been trying to 
lower the amount of database I/O in some applications that experience spikes 
in server traffic.  So I came up with the idea of using Apache::Session::File 
with the files on /dev/shm, with a cron job to clear up old or expired 
sessions.  Preliminary benchmarks found this to be about 7-8 times faster 
than MySQL.

I'm curious if anyone else has tried this, and if they can think of any 
reasons why this would be a bad idea.

Dan


RE: Content Disposition header and file contents sequence...

2006-03-02 Thread John N. Brahy
Just as I give up and email the list 

I figured out that the database wasn't returning the filename so it
wasn't able to open the file for download so when I hard coded a
filename it started working. The thing I don't understand is why didn't
I get a server error when it wasn't able to open a file... 



> -Original Message-
> From: John N. Brahy [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 02, 2006 10:46 AM
> To: modperl@perl.apache.org
> Subject: Content Disposition header and file contents sequence...
> 
> This is the relevant part of my handler for a link that I want to
force
> a download for. I know it's content-disposition but for some reason I
> can not get it to actually download the file. I get the download
dialog
> and I choose the location to save it but when I open the document it
is
> empty. I've tried changing the sequence of the items but it never
works.
> 
> 
> my $filename = "/usr/local/app/media/videos/downloads/preview.mov";
> unless ($fileFH = Apache::File->new($filename)){
>   $r->log_error("couldn't open $filename for reading: $!");
>   return SERVER_ERROR;
> }
> $r->content_type('video/quicktime');
> $r->headers_out->set('Content-Disposition' =>
> "attachment;filename=$downloadFilename");
> $r->send_fd($fileFH);
> $r->send_http_header();
> return OK;
> 
> 
> 
> 
> 
> : John Brahy
> : CIO
> : www.ad2.com
> 
> : [EMAIL PROTECTED]
> : t: 310-356-7500
> : f: 310-356-7520
> 
> : ad2, Inc.
> : 1990 East Grand Ave, Suite 200
> : El Segundo, CA 90245



Re: Content Disposition header and file contents sequence...

2006-03-02 Thread Geoffrey Young

> $r->headers_out->set('Content-Disposition' =>
> "attachment;filename=$downloadFilename");

try

  $r->headers_out->set('Content-Disposition' => ' inline;
filename=$downloadFilename');

> $r->send_fd($fileFH);
> $r->send_http_header();

those definitely need to be reversed - you need to send the headers before
you send any output.

--Geoff



Content Disposition header and file contents sequence...

2006-03-02 Thread John N. Brahy
This is the relevant part of my handler for a link that I want to force
a download for. I know it's content-disposition but for some reason I
can not get it to actually download the file. I get the download dialog
and I choose the location to save it but when I open the document it is
empty. I've tried changing the sequence of the items but it never works.


my $filename = "/usr/local/app/media/videos/downloads/preview.mov";
unless ($fileFH = Apache::File->new($filename)){
$r->log_error("couldn't open $filename for reading: $!");
return SERVER_ERROR;
}
$r->content_type('video/quicktime'); 
$r->headers_out->set('Content-Disposition' =>
"attachment;filename=$downloadFilename");
$r->send_fd($fileFH);
$r->send_http_header();
return OK;





: John Brahy
: CIO
: www.ad2.com

: [EMAIL PROTECTED]
: t: 310-356-7500
: f: 310-356-7520

: ad2, Inc.
: 1990 East Grand Ave, Suite 200
: El Segundo, CA 90245



Re: Problem Recompiling mod_perl

2006-03-02 Thread Todd W

"Kaplan, Andrew H." <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi there --

I ran the Makefile.PL script using the command /usr/local/bin/perl. Once the
compilation and install was completed, I tried running the server and
unfortunately the same error message concerning Perl 5.8.0 appeared
on-screen.

You should probably put the path to the new perl in your $PATH because shell
code that you invoked using /usr/local/bin/perl Makefile.PL may use the old
perl.

trwww





Re: Perl Script using MapToStorageHandler

2006-03-02 Thread Glenn Martin
Sure id love to see that script... to be completely
hones im still kinda new to perl even... Im getting it
slowly... Anyway, im just looking to achieve my goal
and that is to have a working script/perl module that
can switchout config based on incomming URI... a
perfect example would be the one im working on now...
the Subversion/Dav one...

Glenn

--- Torsten Foertsch <[EMAIL PROTECTED]> wrote:

> On Wednesday 01 March 2006 23:20, Glenn Martin
> wrote:
> > Sounds great, but how would i do something simular
> to:
> >
> >       $r->add_config([sprintf(' > "%s/?">', $uripath),
> >                           'DirectoryIndex .',
> >                           'Options +Indexes',
> >                           'Dav svn',
> >                           sprintf("SVNPath %s",
> > $localpath),
> >                           '']);
> >
> >
> > and
> >
> >       $r->add_config([sprintf('',
> > $localpath), 'DirectoryIndex .', 'Options
> +Indexes',
> > 'Dav On', '']);
> 
> That leads to an error saying that " not allowed at that point. 
> In your case I think you don't need the "Directory"
> around your 
> configuration, I think. But, let me explain how the
> configuration is applied 
> to a request. After startup when the configuration
> has been parsed you have a 
> server/vhost-specific default configuration. That is
> everything outside 
> "Directory", "Location" and so on. Just before
> MapToStorage a copy of this 
> config is made. Then the core-MapToStorage handler
> applies "Location", 
> "Directory" etc blocks to that copy. At the end of
> the request this copy is 
> thrown away.
> 
> The mod_perl MapToStorage handler comes in after the
> server-specific config is 
> loaded but before the core handler. In fact if the
> mp-handler returns OK the 
> core-handler is skipped.
> 
> When $r->add_config([EMAIL PROTECTED], $override) is applied
> in MapToStorage it is very 
> similar to
> 
> AllowOverride $override
> 
> @lines
> 
> 
> Only this location block is applied *before* any
> Directory block.
> 
> That means
> 
> 1) If your mp-handler returns DECLINED, your current
> configuration can be 
> overridden by the core-handler, because it comes
> after you.
> 
> 2) Anything you apply to the config in MapToStorage
> applies to a copy. Hence, 
> nothing is needed to undo the changes.
> 
> 3) Your config can be applied by
> 
> $r->add_config([
>                 'DirectoryIndex .',
>                 'Options Indexes',
>                 'Dav svn',
>                 sprintf("SVNPath %s", $localpath),  
>   
>], ~0) # ~0 == AllowOverride All
> 
> 
> But, a few thing cannot be applied by means of
> $r->add_config. For example 
> "AllowOverride" needs a "Directory" block or
> "ProxyPassReverse" does 
> different things if it appears outside or inside a
> "Location" block. Further, 
> mod_perl-2.0.2 cannot apply "Options" if working
> under Apache 2.2. For these 
> situations I have posted a patch a few days ago
> (last Friday I think). I hope 
> it will make it into mod_perl 2.0.3 see
> 
>  
>
http://www.gossamer-threads.com/lists/modperl/modperl/87401
> 
> In fact, I am currently working on a module that can
> read the configuration 
> from a database and apply it on the fly. It already
> works pretty good. If you 
> want I can send you a current copy. I think of
> releasing it on CPAN later 
> this week or early next week.
> 
> Torsten
> 



Apache 1.34, mod_perl 1.29, Apache::ASP based application

2006-03-02 Thread Jason J. Czerak




This message will be separately posted to the Apache mailing list as I'm not sure if it's a mod_perl/apache::asp deal or apache.

I have recently come across an issues where I ran out of file handles and couldn't open up any files. This is, as you know a mod_perl Apache::ASP based application (don't flame me, I didn't start it, just just support it).  The problem occurs on Linux (2.6.9 - RedHat EL4 update 2).  Vanilla Perl 5.8.7, apache, mod_perl, mod_ssl install. These binaries are separate of the base directory structure

The very same application works fine with default apache 1.3 server tuning on Solaris 8.  We are in the process of moving these applications to Linux. For the most part the software versions are the same on both platforms with exception of the minor versions.

here is a few lines from lsof that look to be eating up the filehandles and not releasing them:

httpd 17196   nobody   93u sock    0,4 11020434 can't identify protocol
httpd 17196   nobody   94u sock    0,4 11020606 can't identify protocol
httpd 17196   nobody   95u sock    0,4 11020717 can't identify protocol


I have the MaxRequestsPerChild set to 5000. This seem to control things at an acceptable level of file handles by killing off processes, once killed off, large blocks are released..  The apache processes do not look like they make it over 60meg in size either.. But this isn't the right way to do this I'm sure.  ideas?








-- 
Jason Czerak ([EMAIL PROTECTED])






__
This email transmission and any documents, files or previous email
messages attached to it may contain information that is confidential or
legally privileged. If you are not the intended recipient or a person
responsible for delivering this transmission to the intended recipient,
you are hereby notified that you must not read this transmission and
that any disclosure, copying, printing, distribution or use of this
transmission is strictly prohibited. If you have received this transmission
in error, please immediately notify the sender by telephone or return email
and delete the original transmission and its attachments without reading
or saving in any manner.




Re: Perl Script using MapToStorageHandler

2006-03-02 Thread Geoffrey Young
thanks for the detailed explanations.  torsten++ :)

> That leads to an error saying that " But, a few thing cannot be applied by means of $r->add_config. For example 
> "AllowOverride" needs a "Directory" block

I think what most people don't understand about $r->add_config() is that
it's .htaccess-style configuration injection.  so, if you can't use a given
config from an .htaccess file you can't use add_config() for it either.

all the rest is good stuff and on target :)

--Geoff