Re: maintaining shared memory size (was: Re: swampedwithconnection?)

2005-08-31 Thread David Hodgkinson


On 30 Aug 2005, at 10:16, Badai Aqrandista wrote:


I used to use A::S::MySQL, but it created 2 connections for every  
process. This caused 'Too many connections' error. So I tried to  
use memcached. Now that I know how to make one connection per  
process (using database.table identifier on all sql queries), I'll  
probably try to use A::S::MySQL again.


But now you have reduced MaxClients, that shouldn't happen.




Re: [PATCH] DBI::ProfileDumper::Apache ported to mp2 RC5+

2005-08-31 Thread Tim Bunce
[I wrote this over a week ago but queued it waiting till I submitted
the changes. That's still not happened yet so I'll just post it anyway.]

On Sun, Aug 21, 2005 at 05:22:34PM -0400, Philip M. Gollucci wrote:
> Hi,
> 
> On Sun, Aug 21, 2005 at 01:59:34PM -0400, Sam Tregar wrote:
> >Very cool!  One comment: don't bother with 'use constant' here.  The
> >tiny amount of time saved by using a constant will be overwhelmed by
> >the time used loading constant.pm and calling import().
> I wasn't doing it for speed, more of consitency's sake with perl.apache.org 
> docs
> and other modules like Apache::DBI, Apache::DB (+friends), and etc.  I have 
> however
> changed it to a user var ($MP2) per you request.

For some reason I got rejects so had to apply the patch by hand.

In the process I opted to use constant again. It's already loaded by
DBI::Profile and the perl compiler can use constants to completely
eliminate code for statements like if(){} blocks it knows won't be entered.

I also tweaked the $ENV{MOD_PERL_API_VERSION} test to avoid undef warnings.

Thanks.

Tim.

> I tweaked this to be slightly better. I stole an idea from Apache::DB
> Because the Apache::RequestUtil->request() is what needs the
> PerlOptions +GlobalRequest, I've added the ability to
> PerlSetEnv DBI_PROFILE_APACHE_LOG_DIR /server_root/logs
> 
> if you don't want to add +GlobalRequests which will would be useful in
> threaded environments as the CLONE() of $r is slow.
> 
> I've also added and confirmed this error message to the docs.
> 
> Also, I added a Changes entry and generated the diff against SVN.
> 
> P.S.
>   I upped the version 1.0 to 1.1
> 
> Index: lib/DBI/ProfileDumper/Apache.pm
> ===
> --- lib/DBI/ProfileDumper/Apache.pm (revision 1470)
> +++ lib/DBI/ProfileDumper/Apache.pm (working copy)
> @@ -10,6 +10,22 @@
> 
>PerlSetEnv DBI_PROFILE DBI::ProfileDumper::Apache
> 
> +Under mod_perl2 RC5+ you'll need to also add:
> +
> +  PerlSetEnv DBI_PROFILE_APACHE_LOG_DIR /server_root/logs
> +
> +  OR add
> +
> +  PerlOptions +GlobalRequest
> +
> +to the gobal config section you're about test with
> +DBI::ProfileDumper::Apache.  If you don't do this,
> +you'll see messages in your error_log similar to:
> +
> +DBI::ProfileDumper::Apache on_destroy failed: Global $r object is not 
> available. Set:
> +PerlOptions +GlobalRequest
> +in httpd.conf at /DBI/ProfileDumper/Apache.pm line 144
> +
>  Then restart your server.  Access the code you wish to test using a
>  web browser, then shutdown your server.  This will create a set of
>  F files in your Apache log directory.  Get a profiling
> @@ -105,11 +121,12 @@
> 
>  =cut
> 
> -use vars qw($VERSION @ISA);
> -$VERSION = "1.0";
> +use vars qw($VERSION @ISA $MP2);
> +$VERSION = "1.1";
>  @ISA = qw(DBI::ProfileDumper);
> +$MP2 = $ENV{MOD_PERL_API_VERSION} == 2 ? 1 : 0;
> +
>  use DBI::ProfileDumper;
> -use Apache;
>  use File::Spec;
> 
>  # Override flush_to_disk() to setup File just in time for output.
> @@ -120,7 +137,22 @@
>  my $self = shift;
> 
>  # setup File per process
> -my $path = Apache->server_root_relative("logs/");
> +my $path;
> +
> +if ($MP2) {
> +if ($ENV{DBI_PROFILE_APACHE_LOG_DIR}) {
> +$path = $ENV{DBI_PROFILE_APACHE_LOG_DIR};
> +}
> +else {
> +require Apache2::RequestUtil;
> +require Apache2::ServerUtil;
> +$path = 
> Apache2::ServerUtil::server_root_relative(Apache2::RequestUtil->request()->pool,
>  "logs/")
> +}
> +}
> +else {
> +   require Apache;
> +   $path = Apache->server_root_relative("logs/");
> +}
>  my $old_file = $self->{File};
>  $self->{File} = File::Spec->catfile($path, "$old_file.$$");
> 
> Index: Changes
> ===
> --- Changes (revision 1470)
> +++ Changes (working copy)
> @@ -25,6 +25,9 @@
>  $dbh->{Callbacks}->{prepare} = sub { ... };
>  With thanks to David Wheeler for the kick start.
> 
> +  Ported DBI::ProfileDumper::Apache to mod_perl RC5+
> +thanks to Philip M. Golluci
> +
>  =head2 Changes in DBI 1.48 (svn rev 928),14th March 2005
> 
>Fixed DBI::DBD::Metadata generation of type_info_all thanks to Steffen 
>Goeldner
> 
> 
> 
> 
> -- 
> END
> 
> What doesn't kill us can only make us stronger.
> Nothing is impossible.
>   
> Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
> Consultant / http://p6m7g8.net/Resume/
> Senior Developer / Liquidity Services, Inc.
>   http://www.liquidityservicesinc.com
>http://www.liquidation.com
>http://www.uksurplus.com
>http://www.govliquidation.com
>http://www.gowholesale.com
> 


Re: Apache::Test not finding global config file

2005-08-31 Thread William McKee
On Thu, Aug 25, 2005 at 06:59:56PM -0400, Philip M. Gollucci wrote:
> To answer your original quesiton,
> you want:
> in A-T source,

Thanks for the reference. Some further investigating showed that calling
t/TEST -clean is when I lose the -httpd_config setting which explains
why `./Build test` is finding the wrong config file.

I'm putting some debug statements into
lib/Apache/TestConfigParse.pm::inherit_config() to see if I can track
down where A::T is getting that bad location for the config file.


Thanks,
William

-- 
Knowmad Services Inc.
http://www.knowmad.com


Re: Apache::Test not finding global config file

2005-08-31 Thread William McKee
On Thu, Aug 25, 2005 at 06:56:57PM -0400, Philip M. Gollucci wrote:
> >From the trace below, you can see that A::T thinks the config file is
> >'/usr/conf/httpd2.conf':
> >   [  debug] isolated httpd_defines HTTPD_ROOT = /etc/httpd/2.0
> >   [  debug] isolated httpd_defines SERVER_CONFIG_FILE = conf/httpd2.conf
> I guess that should be
> /etc/httpd/2.0/conf/httpd2.conf
> 
> then right ?
> What is the actual path you want it to find ?

I want it to find /etc/httpd/2.0/conf/httpd2.conf but it is finding:

[  debug] isolated httpd_defines HTTPD_ROOT = /etc/httpd/2.0
[  debug] isolated httpd_defines SERVER_CONFIG_FILE = conf/httpd2.conf
[  debug] inheriting config file: /usr/conf/httpd2.conf

I'd love to figure out where it's grabbing '/usr' to append to the
SERVER_CONFIG_FILE that it finds. Any ideas?


Thanks,
William

-- 
Knowmad Services Inc.
http://www.knowmad.com


Re: Apache::Test not finding global config file

2005-08-31 Thread Geoffrey Young

> I want it to find /etc/httpd/2.0/conf/httpd2.conf but it is finding:
> 
> [  debug] isolated httpd_defines HTTPD_ROOT = /etc/httpd/2.0
> [  debug] isolated httpd_defines SERVER_CONFIG_FILE = conf/httpd2.conf
> [  debug] inheriting config file: /usr/conf/httpd2.conf
> 
> I'd love to figure out where it's grabbing '/usr' to append to the
> SERVER_CONFIG_FILE that it finds. Any ideas?

$self->{httpd_basedir}, which looks to be calculated based on the location
of the httpd binary.  but it looks like it ought to be using HTTPD_ROOT
instead.  at least if it's defined.

try this (completely untested)

--Geoff
Index: lib/Apache/TestConfigParse.pm
===
--- lib/Apache/TestConfigParse.pm	(revision 265514)
+++ lib/Apache/TestConfigParse.pm	(working copy)
@@ -341,7 +341,7 @@
 my $extra_file = $self->{vars}->{httpd_conf_extra};
 
 unless ($file and -e $file) {
-if (my $base = $self->{httpd_basedir}) {
+if (my $base = $self->{httpd_defines}->{HTTPD_ROOT} || $self->{httpd_basedir}) {
 my $default_conf = $self->{httpd_defines}->{SERVER_CONFIG_FILE};
 $default_conf ||= catfile qw(conf httpd.conf);
 $file = catfile $base, $default_conf;


Multiple Handlers

2005-08-31 Thread Martin Moss
All,

I'm trying to make something work in mod perl, and all
the docs seem to be pointing me in ways which just
don't work on our system...

Server version: Apache/1.3.33 (Unix)
SunOS 5.9
perl, v5.8.6

I wish to have a handler which sits after the
Authentication stage, which can choose whether to
display a HTML page instead of the originally
requested page.. 
The originally requested page will usually be served
via Embperl, or a method handler..

I originally tried using $r->set_handlers. in my
PerlAuthenHandler. But this made absolutely no
difference to the current request... 
e.g. if did a get_handlers call before and after using
set_handlers, it clearly showed me the handlers I'd
set using set_handlers, but apache ignored this and
carried on serving it's original get_handlers()
anyway.. 

I found many different people reporting bugs in the
set_handlers mechanism and push_handler (which worked
but couldn't help me as what I wanted to do was
unshift (not push) the handlers).

So I tried defining two handlers for the same request,
the first one my custom handler, the second one
Embperl as normal. Now when my custom handler returns
DECLINE the page requested displays
normally.GREAT:-)... 

But when my custom handler actually serves a page, and
returns OK, I actually see the custom handler page
being served, and then the original requested page
appears below with a load of headers and server error
messages  So basically BOTH handlers are being
called

Now, I was under the impression (but could be wrong)
that if 2 content PerlHandlers are defined for a
request, then if the first one returns OK then the
second handler doesn't get called, but if it returns
DECLINED then the second one gets called...

Can anybody throw some light on this? 
Why doesn't set_handlers (used in the
PerlAuthenHandler phase) allow me to define the
PerlHandler for the content phase?

How do I prevent other handlers (independant of my
custom handler) from being run if my Custom handler
decides to serve a page...

Kind regards

Marty








___ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com


Suggestions for creating an archive

2005-08-31 Thread Dermot Paikkos
Hi,

Apologises if this is a little OT but I am can't seem to find anything
relevant elsewhere. I am currently using MP1, 1.29 on Linux.

I need to create a archive file and send it back to the user. The files 
within the archive will be jpegs so compression isn't needed, but I 
need the archive so they can download all the files in one hit. The 
end-users are all Win32 and will use winzip to open the archive so 
tar files might be...a bit complex for them to handle.  

I have 2 problems to overcome. The most obvious (and 
embarressing) is that I don't know how to send a request a file. I 
have seen examples of sending a filehandle ($r->send($fh)) but I am 
not sure that this is appropriate.  

The other problem is how to create the archive and with what. I have 
installed Apache::GzipChain but it seems unduly elaborate. Any 
suggestions here would be great.  

If I you do need to send a file as a filehandle, what are the other 
headers that need to be set, content_length, encoding and type and 
would the archiving process need to be done as a pipe?  

Sorry if I'm rambling here but I am don't know where to begin.
Thanx.
Dp.

~~
Dermot Paikkos * [EMAIL PROTECTED]
Network Administrator @ Science Photo Library
Phone: 0207 432 1100 * Fax: 0207 286 8668



Re: maintaining shared memory size

2005-08-31 Thread Perrin Harkins
On Wed, 2005-08-31 at 14:13 +1000, Badai Aqrandista wrote:
> Lots of SQL queries and calculation based on the query results. I've cached 
> most of the query results, but the calculation results can't be cached 
> because they depend on user inputs.

If this is serious number-crunching, it might be one of the few times
where using C really does make sense for that part.

> POE sounds good to start with, right?

For a daemon to monitor a queue?  Probably not.  I'd just write a simple
script that polls a database table and forks a new process to handle any
jobs it finds.  Parallel::ForkManager is handy for this kind of thing.

- Perrin



Re: Suggestions for creating an archive

2005-08-31 Thread Perrin Harkins
On Wed, 2005-08-31 at 17:18 +0100, Dermot Paikkos wrote:
> I need to create a archive file and send it back to the user.

Either do a system call to zip, or use Archive::Zip, write the file out
in a directory under your web server, and send a redirect to the newly
written file.

- Perrin




Re: Multiple Handlers

2005-08-31 Thread Geoffrey Young


> I originally tried using $r->set_handlers. in my
> PerlAuthenHandler. But this made absolutely no
> difference to the current request... 

if you want to set_handlers() for the PerlHandler phase you need two calls

  $r->set_handlers(PerlHandler => [ My::Handler ]);
  $r->handler('perl-script');

HTH

--Geoff


Re: Multiple Handlers

2005-08-31 Thread Martin Moss
Have an awful suspicion the book I used suggested
doing it the other way around? Would that make a
difference?

$r->handler('perl-script');
$r->set_handlers(PerlHandler => [ My::Handler ]);

Marty


--- Geoffrey Young <[EMAIL PROTECTED]> wrote:

> 
> 
> > I originally tried using $r->set_handlers. in my
> > PerlAuthenHandler. But this made absolutely no
> > difference to the current request... 
> 
> if you want to set_handlers() for the PerlHandler
> phase you need two calls
> 
>   $r->set_handlers(PerlHandler => [ My::Handler ]);
>   $r->handler('perl-script');
> 
> HTH
> 
> --Geoff
> 




___ 
To help you stay safe and secure online, we've developed the all new Yahoo! 
Security Centre. http://uk.security.yahoo.com


Re: Multiple Handlers

2005-08-31 Thread Geoffrey Young


Martin Moss wrote:
> Have an awful suspicion the book I used suggested
> doing it the other way around? Would that make a
> difference?
> 
> $r->handler('perl-script');
> $r->set_handlers(PerlHandler => [ My::Handler ]);

none whatsoever.

keep in mind that you can only call set_handlers() during phases prior to
the phase you're setting.  for example, you can't

  $r->set_handlers(PerlHandler => [ My::Handler ]

from within a PerlHandler, but you could from within a PerlAuthenHandler.

btw, I saw that you wanted to unshift handlers (as opposed to push). this is
how you do that

  my $handlers = $r->get_handlers(`PerlFixupHandler');
  $r->set_handlers(PerlFixupHandler => [`My::Bow', @$handlers]);

HTH

--Geoff


Re: Suggestions for creating an archive

2005-08-31 Thread Dermot Paikkos
I had tried Archive::Zip earlier but gave up after this error.

Here what I have at the moment.:

...snip
my $zip = Archive::Zip->new();
my $member = $zip->addDirectory('myarchive/');
chdir("$dir") or die "Can't cd into $dir: $!\n";

my @jpegs = glob("*.jpg");
foreach my $f (@jpegs) {
  $member = $zip->addFile($f);
 }
die "write error" unless $zip->writeToFileNamed('Myzip.zip') == 
AZ_OK;
move("Myzip.zip","/var/www/htdocs/");
$r->internal_redirect("myzip.zip");

 return OK;
} # end of Handler
1;

And I am getting a Bad Request - Invalid URI in request GET 
/file_export HTTP/1.1 error. I am not sure about this error. Can't say 
I've seen it before.

Myzip.zip is created and is stored in DocumentRoot 
(/var/www/htdocs).

Will redo the literal path later. Any ideas? Should I be giving more 
content info?
Dp.







On 31 Aug 2005 at 12:40, Perrin Harkins wrote:

> On Wed, 2005-08-31 at 17:18 +0100, Dermot Paikkos wrote:
> > I need to create a archive file and send it back to the user.
> 
> Either do a system call to zip, or use Archive::Zip, write the file out
> in a directory under your web server, and send a redirect to the newly
> written file.
> 
> - Perrin
> 
> 
> 


~~
Dermot Paikkos * [EMAIL PROTECTED]
Network Administrator @ Science Photo Library
Phone: 0207 432 1100 * Fax: 0207 286 8668



Re: Suggestions for creating an archive

2005-08-31 Thread Dermot Paikkos
On 31 Aug 2005 at 12:40, Perrin Harkins wrote:

Sorry I guess that should be

$r->internal_redirect("http://austin/Myzip.zip";);

That what the bad uri means.

Still my archive file arrives empty even though the actual archive in 
/var/www/htdocs has files files in it.
Dp.



~~
Dermot Paikkos * [EMAIL PROTECTED]
Network Administrator @ Science Photo Library
Phone: 0207 432 1100 * Fax: 0207 286 8668



Re: Suggestions for creating an archive

2005-08-31 Thread Perrin Harkins
On Wed, 2005-08-31 at 18:09 +0100, Dermot Paikkos wrote:
> $r->internal_redirect("myzip.zip");

That's supposed to be a URL: "/myzip.zip"

I was actually thinking of an external redirect, but an internal
redirect should work.

- Perrin



Re: Suggestions for creating an archive

2005-08-31 Thread Mike Whitaker


On 31 Aug 2005, at 17:40, Perrin Harkins wrote:


On Wed, 2005-08-31 at 17:18 +0100, Dermot Paikkos wrote:


I need to create a archive file and send it back to the user.



Either do a system call to zip, or use Archive::Zip, write the file  
out

in a directory under your web server, and send a redirect to the newly
written file.


ISTR doing this in the past by setting $r->file, or something  
similar, to point to the file in question. Am I misremembering?




Re: Multiple Handlers

2005-08-31 Thread Martin Moss
It doesn't seem to work... This was the original
solution I tried..

Here is the code:-

if (Apache->can('set_handlers'))
{
print STDERR "CAN PUSH HANDLERS OK\n";
}
else
{
print STDERR "CANNOT PUSH HANDLERS OK\n";
}
my $list = $r->get_handlers( 'PerlHandler' );
print STDERR "\n";
print STDERR Dumper($$,$0,$list);
print STDERR "===\n";
 $r->set_handlers( 'PerlHandler' =>
['My::Apache::User::Notification']);
 $r->handler('perl-script');
my $list2 = Apache->get_handlers( 'PerlHandler' );
print STDERR Dumper($$,$list,$list2);
print STDERR "==\n";



Here is the output I get in my logs:-

CAN PUSH HANDLERS OK
==
$VAR1 = 15253;
$VAR2 = '/www/common/conf/core/traps.conf';
$VAR3 = [
  'Embperl::handler'
];
==
$VAR1 = 15253;
$VAR2 = [
  'Embperl::handler'
];
$VAR3 = [
  'III::Apache::User::Notification'
];
==

==
15253 Apache::AuthenDBI request type = main

In Embperl::handler

So as you can see, the set_handlers seems to work...
But after the Authen stage has returned OK, the next
handler to take control is Embperl::handler...

Any Ideas?

Regards

Marty

--- Geoffrey Young <[EMAIL PROTECTED]> wrote:

> 
> 
> Martin Moss wrote:
> > Have an awful suspicion the book I used suggested
> > doing it the other way around? Would that make a
> > difference?
> > 
> > $r->handler('perl-script');
> > $r->set_handlers(PerlHandler => [ My::Handler ]);
> 
> none whatsoever.
> 
> keep in mind that you can only call set_handlers()
> during phases prior to
> the phase you're setting.  for example, you can't
> 
>   $r->set_handlers(PerlHandler => [ My::Handler ]
> 
> from within a PerlHandler, but you could from within
> a PerlAuthenHandler.
> 
> btw, I saw that you wanted to unshift handlers (as
> opposed to push). this is
> how you do that
> 
>   my $handlers =
> $r->get_handlers(`PerlFixupHandler');
>   $r->set_handlers(PerlFixupHandler => [`My::Bow',
> @$handlers]);
> 
> HTH
> 
> --Geoff
> 






___ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com


Re: Suggestions for creating an archive

2005-08-31 Thread Dermot Paikkos
On 31 Aug 2005 at 13:14, Perrin Harkins wrote:

> On Wed, 2005-08-31 at 18:09 +0100, Dermot Paikkos wrote:
> > $r->internal_redirect("myzip.zip");
> 
> That's supposed to be a URL: "/myzip.zip"
> 
> I was actually thinking of an external redirect, but an internal
> redirect should work.

Do you mean a redirect to a completely separate handler or cgi? 

Currently what i get is downloaded file named after the 
handler/Location, file_export (no extension). WinZip claims it is 
empty. You have to rename the file with a '.zip' extension or Winzip 
wil not recognise it.

So I guess the question is there a way define a name for the 
download?

Thanx.
Dp.





Re: maintaining shared memory size

2005-08-31 Thread colin_e

Badai Aqrandista wrote:


...Your requests take 110 seconds each?  What is your application doing?



My app is an online hotel booking system. That part is the part where 
it searches availabilities through all combination of dates, number of 
guests, rooms, packages, allotments, pricing structures, and more.


This doesn't sound like a "search" at all. Typically individuals know at 
least SOMETHING about the
booking they want to make. How many times do you book a hotel, but don't 
care whether it's in

Barbados or Brazil?

If you have a resonable set of search criteria (constraints) linked to 
appropriate indexes on your data,

you should be looking at <1s responses, not hundreds of seconds.

Many online systems will either reject a search with too few critieria, 
or limit the results to (say) the
first 100 hits, precisely to stop silly or malicious searches producing 
a zillion results and crippling their system.


If you really are enumerating all possible combinations, not really 
searching for specific solutions, this
sounds like a job for an occasionally-run batch job storing the results 
into a cache table, although in

your case this sounds like a potantially huge cache

Regards: Colin.


Re: Suggestions for creating an archive

2005-08-31 Thread Perrin Harkins
On Wed, 2005-08-31 at 18:38 +0100, Dermot Paikkos wrote:
> Do you mean a redirect to a completely separate handler or cgi? 

I mean a standard redirect to a normal .zip file, which you let apache
serve for you like any other file.  Then you clear these out
periodically with a cron job.

> So I guess the question is there a way define a name for the 
> download?

There is a way to do it, defined as part of HTTP or MIME -- I can't
quite remember.  If you do an external redirect you won't have to bother
figuring it out.

- Perrin



Re: Suggestions for creating an archive

2005-08-31 Thread Michael Peters


Perrin Harkins wrote:
> On Wed, 2005-08-31 at 18:38 +0100, Dermot Paikkos wrote:
> 
>>Do you mean a redirect to a completely separate handler or cgi? 
> 
> 
> I mean a standard redirect to a normal .zip file, which you let apache
> serve for you like any other file.  Then you clear these out
> periodically with a cron job.
> 
> 
>>So I guess the question is there a way define a name for the 
>>download?
> 
> 
> There is a way to do it, defined as part of HTTP or MIME -- I can't
> quite remember.  If you do an external redirect you won't have to bother
> figuring it out.

If you are generating your own content headers you use the
Content-Disposition header.

Something like:
$r->header_out(
'Content-Disposition' => 'inline; filename=my_cool_stuff.zip'
);

-- 
Michael Peters
Developer
Plus Three, LP



Re: Suggestions for creating an archive

2005-08-31 Thread Mike Whitaker


On 31 Aug 2005, at 18:43, Perrin Harkins wrote:


There is a way to do it, defined as part of HTTP or MIME -- I can't
quite remember.  If you do an external redirect you won't have to  
bother

figuring it out.


Content-Disposition: rings a bell.


Re: Apache::Test not finding global config file

2005-08-31 Thread William McKee
On Wed, Aug 31, 2005 at 11:54:57AM -0400, Geoffrey Young wrote:
> $self->{httpd_basedir}, which looks to be calculated based on the location
> of the httpd binary.  but it looks like it ought to be using HTTPD_ROOT
> instead.  at least if it's defined.
> 
> try this (completely untested)

Perfect! That worked just fine. How can we get it added to A::T?


Thanks,
William

PS: Sorry I missed you at YAPC this year. Perrin will tell you that I
tried my best to track you down. Next time...

-- 
Knowmad Services Inc.
http://www.knowmad.com


Re: Suggestions for creating an archive

2005-08-31 Thread Dermot Paikkos
Excellent. 

I give it a try tomorrow.
Dp.


On 31 Aug 2005 at 13:48, Michael Peters wrote:

> 
> 
> Perrin Harkins wrote:
> > On Wed, 2005-08-31 at 18:38 +0100, Dermot Paikkos wrote:
> > 
> >>Do you mean a redirect to a completely separate handler or cgi? 
> > 
> > 
> > I mean a standard redirect to a normal .zip file, which you let apache
> > serve for you like any other file.  Then you clear these out
> > periodically with a cron job.
> > 
> > 
> >>So I guess the question is there a way define a name for the 
> >>download?
> > 
> > 
> > There is a way to do it, defined as part of HTTP or MIME -- I can't
> > quite remember.  If you do an external redirect you won't have to bother
> > figuring it out.
> 
> If you are generating your own content headers you use the
> Content-Disposition header.
> 
> Something like:
> $r->header_out(
> 'Content-Disposition' => 'inline; filename=my_cool_stuff.zip'
> );
> 
> -- 
> Michael Peters
> Developer
> Plus Three, LP
> 
> 




Re: Apache::Test not finding global config file

2005-08-31 Thread Geoffrey Young


William McKee wrote:
> On Wed, Aug 31, 2005 at 11:54:57AM -0400, Geoffrey Young wrote:
> 
>>$self->{httpd_basedir}, which looks to be calculated based on the location
>>of the httpd binary.  but it looks like it ought to be using HTTPD_ROOT
>>instead.  at least if it's defined.
>>
>>try this (completely untested)
> 
> 
> Perfect! That worked just fine. How can we get it added to A::T?

if you can do me the favor of trying a few different configuration scenarios
(including 1.3, non-apxs, /usr/local/apache, etc) and making sure nothing
breaks, that would be great.  the box where my matrix used to live had a
hard drive failure, so I'm slowly rebuilding it as I find the time.

if those all look good I'll commit it.

> PS: Sorry I missed you at YAPC this year. Perrin will tell you that I
> tried my best to track you down. Next time...

next time just nail me down after one of my talks :)

--Geoff


Re: maintaining shared memory size

2005-08-31 Thread Badai Aqrandista
My app is an online hotel booking system. That part is the part where it 
searches availabilities through all combination of dates, number of 
guests, rooms, packages, allotments, pricing structures, and more.


This doesn't sound like a "search" at all. Typically individuals know at 
least SOMETHING about the
booking they want to make. How many times do you book a hotel, but don't 
care whether it's in

Barbados or Brazil?


Yes, the user provides the dates and the number of guests (and probably a 
coupon number). Then based on that, the system searches for available room 
and package combinations on the particular hotel, based on various 
constraints.


---
Badai Aqrandista
Cheepy (?)

_
REALESTATE: biggest buy/rent/share listings   
http://ninemsn.realestate.com.au




Re: maintaining shared memory size

2005-08-31 Thread Badai Aqrandista



> POE sounds good to start with, right?

For a daemon to monitor a queue?  Probably not.  I'd just write a simple
script that polls a database table and forks a new process to handle any
jobs it finds.  Parallel::ForkManager is handy for this kind of thing.


Yes. POE looks overkill compare to Parallel::ForkManager.

Thanks.

---
Badai Aqrandista
Cheepy (?)

_
Low rate ANZ MasterCard. Apply now! 
http://clk.atdmt.com/MAU/go/msnnkanz003006mau/direct/01/  Must be over 
18 years.