Re: More noob problems

2006-06-19 Thread Foo Ji-Haw

Ever considered using ActivePerl instead? It's rather well supported.

Rob Allen wrote:
Still having newbie troubles with IndigoPerl.  It all installed 
correctly and the service is up and running.  I can start/stop Apache 
consistently with no troubles.  There are no errors reported in the 
error log.
 
BUT...
 
Apache is sucking up 90-95% of my CPU pretty consistently, and when I 
make a request (http://localhost...) including trying to run 
PerlConsole, it hangs.  No error message, no 404 Page Not Found, 
nothing.  It just hangs and sucks CPU cycles until I shut down Apache.
 
Running on Win XP.
 
Any advice?  (Please spare me the "get off Windows" advice, though.  I 
don't have a choice.)
 
*Rob Allen*

Senior Systems Analyst
*Gensa Corporation*
Crowne Corporate Center II
2870 Gateway Oaks Drive
Sacramento, CA 95833
http://www.gensa.com




Re: [RELEASE CANDIDATE] libapreq2 2.08-RC1

2006-05-19 Thread Foo Ji-Haw
I have a Windows test machine I can use to test your module, but I do 
not have a compiler. Do you have a ppd version I can use?


Philip M. Gollucci wrote:

Please download, test, and report back on the following
candidate tarball:

  http://people.apache.org/~pgollucci/apreq2/libapreq2-2.08-RC1.tar.gz

 Most notably, it compiles with perl 5.8.8 now.

CHANGES SINCE 2.07

- Perl Glue docs [Philip M. Gollucci]
  Fix the 'docs_install' make target to actually install
  the docs for the perl glue.

- Perl Glue Build [Philip M. Gollucci]
  Regenerate glue/perl/xsbuilder/ppport.h to fix perl 5.8.8+ on some
  plaforms.

- C API [joes]
  Add code for apreq_cookies().

- Perl API [joes]
  Expose the constants in apreq_error.h via the APR::Request::Error 
package.



Philip M. Gollucci ([EMAIL PROTECTED]) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone..."




Is Apache::Session for Apache2 on Windows?

2006-05-16 Thread Foo Ji-Haw
I'm trying to explore using sessions in my application. It seems that my 
option is restricted to Apache::Session. Please let me know if other 
session modules exist for my platform.


My test codes are as follows:
First run (to generate the session):

   my %session;
   eval
   {
   tie %session, 'Apache::Session::File', undef,
   {Directory => 'd:/sessions',
   LockDirectory   => 'd:/LockSessions',};
   };
   if ($@)
   {
   die "Global data is not accessible: $@";
   }
   print $session{_session_id};
undef %session;

Subsequent runs:

   my %session;
   my $SessionID = 'c2e9a96e10b6918c4a358591413cddf5';
   eval
   {
   tie %session, 'Apache::Session::File', $SessionID,
   {Directory => 'd:/trendicate3/sessions',
   LockDirectory   => 'd:/trendicate3/LockSessions',};
   };
   if ($@)
   {
   die "Global data is not accessible: $@";
   }
   print $session{name}.'';
   $session{name} = 'John Doe';
undef %session;

My problems as as follows:
1. For some strange reason, the page will not load completely. What I 
mean to say is that the page displays, but the connection will not end, 
as if the process (thread, in Windows implementation) cannot end. I 
suspect maybe cleaning up the tie() has something to do with it.
2. I tried to store some stuff in the session (see code above), but it 
did not store. Very strange. I suspect if I can solve (1), (2) will 
resolve on its own.


Hope you guys can point me in the right direction. Thanks.


The famous 3221225477 exit status

2006-05-03 Thread Foo Ji-Haw

Hi all,

On my mp2 machine I see a lot of this exit status code generated. And 
when it does, my Apache2 stop serving for a while (I guess it's just 
restarting).


Goggling this number seems to indicate that a lot of people are 
experiencing this problem, but nobody really seems to have a solution 
for it. It seems to be an issue on the Windows platform.


Does anyone here have any suggestions on how this comes about, and how 
it can be resolved?


Thanks.


Re: How many people use the Windows combo of Apache2 + mod_perl2 ?

2006-04-27 Thread Foo Ji-Haw
I can give a brief account of my experiences with MP2 development on 
both Windows and non-Windows platforms.


Generally, I choose to develop on the Windows environment for various 
reasons; most of them out of convenience and comfort. Coming primarily 
from a Windows environment (in terms of associated skill-sets, and 
physical environment), I find the MP2 platform for Windows fairly 
stable. The good support in this newsgroup usually applies well, so not 
much pain everywhere.


My main installations are on the FreeBSD platform. Installing the OS and 
the related applications are fairly easy via ports. Installing the 
production code onto FreeBSD was not perfect, but largely painless with 
minor hiccups. So I can say that MP2 is 99% platform independent! :D


Performance-wise, I think that I am getting slightly faster throughput 
on FreeBSD, though I must admit that it is generally on a gut-feel 
basis. Stability-wise, both are good enough, but I am still experiencing 
annoying Windows pop-ups claiming some memory reading errors, yet 
nothing has crashed.


I think to be a cross-platform MP2 developer, it is important to have a 
good feel of the underlying OS. I don't know what problems RA Jones had 
hit, but my suspicion is that most of them are os-centric, rather than 
implementation-centric. Good knowledge of the OS should help. No offence 
intended Jones.


RA Jones wrote:

Lionel MARTIN wrote:
I think that I should better try with LAMP as well, but to be honest, 
I have never tried to install Linux.
Well then, be prepared for a VERY long and hard uphill struggle. Be 
prepared to spend hours/days configuring things that install & 
configure in seconds/minutes under Windows. If you are dependant on 
wireless connections, then don't even think of it.


I do all my development on Win32, but run my apps on hosted UNIX 
servers. So after deciding to run my own server I set up both systems 
to determine the relative merits of each - Apache2/mod_perl2 was a 
prerequisite. I was fully expecting Linux to win hands down over WinXP 
in terms of both stability and performance, but I was wrong on both 
counts. This from someone who was heartily sick of Microsoft products 
and REALLY wanted to like Linux. In my experience of many different 
distros, life's just too short for adopting Linux for anything but 
basic desktop (ie word processing/e-mails/web browsing) work, unless 
you already know what you are doing. Count this a vote for the Windows 
combo of Apache2 + mod_perl2  (can I believe I just wrote that?)





*** 


This e-mail is confidential and privileged. If you are not the intended
recipient please accept our apologies; please do not disclose, copy or
distribute information in this e-mail or take any action in reliance 
on its

contents: to do so is strictly prohibited and may be unlawful. Please
inform us that this message has gone astray before deleting it. Thank you
for your co-operation.
*** 







Re: How many people use the Windows combo of Apache2 + mod_perl2 ?

2006-04-26 Thread Foo Ji-Haw
A long time back (year 2000 I think) I tried ActivePerl 5.6 with PerlEx. 
It was terrible. We reverted to the Velocigen accelerator instead, and 
that was good. But I'm not sure where Velocigen is now.


My gut feel for PerlEx now...better not try.

Issac Goldstand wrote:

IIRC, PerlEx was discontinued a few years ago, I think shortly after the
Sophos acquisition.  I've recently seen it quietly reappear in standard
ActivePerl distributions, but not sure where (if anywhere) the great
folks at ActiveState are going with it...

  Issac

Philip M. Gollucci wrote:
  

Foo Ji-Haw wrote:


Just want to do a quick poll here.

Most of the comments I read here, come from people who use the Linux/
BSD platform. Is there anybody who actually deploy the Windows combo
on a production server? For those who do, do you have any issues that
are Windows-specific?

For me for example, my gripe is that I cannot use
ServerUtil::restart_count to determine the instance of the final
startup of the service, due to the implementation nature of mp2
  

Back in 2000, I _sadly_ used to deploy ActiveState Perl 6xx, PerlEx
2.1 with IIS 5.0.  the code didn't get that advanced.  My biggest
gripe was the ppm repositories were far behind that of CPAN, or
modules were only available in ActiveState Perl 8xx.

That particular behavior (restart_count) trips a lot of people up even
on BSD / Linux based platforms.

Its been a while and Phillippe will probably correct me here, but I
remember there be hard memory limit of 8GB with PerlEx.  We had filed
a bug report, but I don't think it was high enough priority for them
to look at at the time.

I wasn't really a big fan of setting things like Interpreter threads,
tracing, and etc... in the Windows registry either.

HTH





  




How many people use the Windows combo of Apache2 + mod_perl2 ?

2006-04-25 Thread Foo Ji-Haw

Just want to do a quick poll here.

Most of the comments I read here, come from people who use the Linux/ 
BSD platform. Is there anybody who actually deploy the Windows combo on 
a production server? For those who do, do you have any issues that are 
Windows-specific?


For me for example, my gripe is that I cannot use 
ServerUtil::restart_count to determine the instance of the final startup 
of the service, due to the implementation nature of mp2


Apache2::PAR is outdated

2006-04-23 Thread Foo Ji-Haw

Hi all,

I don't know if this make sense to fix, since apparently the ppd has 
been around for a while, and nobody reports the problem...


The PPD for Apache2::PAR cannot be used for mp2 since 1.99. The module 
names and all are outdated.


I've tried to fix the problem, mainly changing the namespaces. But it's 
not working out. I'm stuck at migrating the import() function, where I 
suspect my limited knowledge of Apache2::ServerUtil is hitting roadblocks.


I've attached my half-completed work. Anybody who is interested can 
finish it and claim credit.


Thanks.


package Apache2::PAR;

use constant DEBUG => 0;

use 5.005;
use strict;

require mod_perl2; # For version detection

# Since we don't use exporter, only export what we need
use vars qw($VERSION %PARFILE_LIST %MTIME_LIST %UNPACK_LIST);

$VERSION = '0.00_01';

require Apache2::ServerUtil;
use Archive::Zip qw( AZ_OK );
Archive::Zip::setErrorHandler(sub {});

our @pardir  = Apache2::ServerUtil->server->dir_config('PARDir');
our @parfiles= Apache2::ServerUtil->server->dir_config('PARFile');
our @parloc  = Apache2::ServerUtil->server->dir_config('PARInclude');

sub handler {
my $r = shift;
foreach (keys(%MTIME_LIST)) {
my $mtime = (stat($_))[9];
if($mtime > $MTIME_LIST{$_}) {
PAR::reload_libs($_);
if($UNPACK_LIST{$_}) {
unpack_par(undef, $_, 
Apache2::ServerUtil->server->dir_config('PARTempDir'))
}
$MTIME_LIST{$_} = $mtime;
}
}

return 1;
}

sub import {
my $class = shift;
my @parentries = @_;
my $parext= Apache2::ServerUtil->server->dir_config('PARExt') || 
'par';
my $conf_file = Apache2::ServerUtil->server->dir_config('PARConf') || 
'web.conf';

my %parlist = ();
foreach my $parentry (@parentries) {
$parentry = 
Apache2::ServerUtil->server_root_relative($parentry);
$parentry =~ s/\/$//;
if(!(-e $parentry)) {
print STDERR "PAR: No such file or directory: 
$parentry\n";
next;
}
if(-f _) {
$parlist{$parentry} = 1;
}
elsif(-d _) {
opendir(DIR, $parentry);
my @files = readdir(DIR);
closedir(DIR);
foreach my $file (@files) {
next if($file !~ /\.$parext$/);
next if(!-f "$parentry/$file");
$parlist{"$parentry/$file"} = 1;
}
}
else {
print STDERR "PAR: Bad file type: $parentry\n";
}
}
my @pars = keys(%parlist);
eval 'require PAR; import PAR (@pars,keys(%PARFILE_LIST));';
die "Could not load PAR, [EMAIL PROTECTED]" if $@;


foreach my $file (@pars) {
my $zip = Archive::Zip->new;
my $rv  = $zip->read($file);
unless($rv == AZ_OK && defined($zip)) {
print STDERR "$file does not seem to be a valid PAR 
(Zip) file. Skipping.\n";
next;
}

my $mtime = (stat $file)[9];
$MTIME_LIST{$file} = $mtime;

my $conf_member = $zip->memberNamed($conf_file);
next if(!defined($conf_member));
print STDERR "Including configuration from $file\n";
my $conf = $conf_member->contents;
my $err  = undef;

$conf =~ s/##PARFILE##/$file/g;
if ($conf =~ /##UNPACKDIR##/) {
my $tempdir = 
Apache2::ServerUtil->server->dir_config('PARTempDir');
if(uc($tempdir) eq 'NONE') {
print STDERR "PARTempDir setting disallows load 
of $file.  Skipping.\n";
next;
}
my $unpackdir = $class->unpack_par($file, $tempdir);
unless(defined($unpackdir)) {
print STDERR "Unable to unpack $file.  
Skipping.\n";
next;
}
$conf =~ s/##UNPACKDIR##/$unpackdir/g;
$UNPACK_LIST{$file} = $unpackdir;
# TODO: Use UNPACK_LIST in handler, etc to reload 
changed content.
}


unless ($mod_perl::VERSION < 1.99) {
$err = Apache2::ServerUtil->server->add_config([split 
/\n/, $conf]);
} else
{
Apache2->httpd_conf($conf);
 

Re: Database transaction across multiple web requests

2006-04-02 Thread Foo Ji-Haw



How do you know it isn't just the operating system caching the disk
fetches?  The docs certainly make it sound like a query cached with
LIMIT will not be useful when different LIMIT values are applied.
  
Because I run it from the command line, and Windows ain't that smart. 
Trust me. :)



- Perrin

  




Re: Database transaction across multiple web requests

2006-04-02 Thread Foo Ji-Haw

Perrin Harkins wrote:

Jeff wrote:
Your application simply uses approach (b) and MySQL does the rest 
automatically. So if you 
Have you tried this?  I was under the impression that MySQL would just 
stop when it finds enough row to satisfy LIMIT, so it wouldn't cache 
the whole result set.
I have, and I can verify that MySQL does some kind of internal 
'caching', so that the next limit call is very fast.


Re: No image creation in mod_perl

2006-03-28 Thread Foo Ji-Haw

Hello Carl,


Nope that's right, so you load up one image. The perl process 
allocates itself 100MB of memory for it from the OS. Then doesn't 
release it back to the OS once it's finished with.


The perl process will re-use this memory, so if you process another 
image you don't grab another 100MB, it's just not available at the OS 
level or for other processes.


This isn't completely bad as long as your OS has good memory 
management. The unused memory in the perl process will just be swapped 
out to disk and left there until that process uses it again or exits.
Can I confirm that in the Windows implementation, if a thread allocates 
requires 100MB of memory and then releases it, the next thread can reuse 
that memory?


Thanks.


Re: No image creation in mod_perl (was RE: Apache2/MP2 Segfaults ...)

2006-03-27 Thread Foo Ji-Haw

Hey Carl,


The only place where forking is useful is where you want something to
continue processing after sending the response back to the client.

You can achieve the same effective result by calling 
$r->child_terminate()
(assuming your using pre-fork). The currently running child exits at 
the end
of the request freeing any memory it's allocated, and the main apache 
server
process will fork a new child to replace it if needed. 
This revelation of how Perl does not free up memory it allocates is 
worrying, especially as I do process large documents regularly.


If I read you right, you are saying that $r->child_terminate will force 
the current thread to terminate, causing Apache to create a new thread. 
Is that right? I use 'threads' in place of 'processes' as I refer to the 
Windows implementation of Apache.


Thanks.



Re: syntax vs. style

2006-03-27 Thread Foo Ji-Haw



Apache::Reload doesn't always work too.  two scenarios

...
I use Apache2::Reload myself for my development box. There's an extra 
scenario you missed out:

1. If you change the inheritance of the package, you'll get an error too.

But having said that, I find Apache2::Reload very handy for easy and 
quick development.


Re: syntax vs. style

2006-03-26 Thread Foo Ji-Haw


I've fixed a lot of old CGI scripts over the past year and all new 
stuff to work in our MP2 environment and everything seems to be 
running excellent -- I mean GREAT, really.

Yes. I've never looked back myself. :)

If you're going all the way into modperl (arguably depending on your 
needs), you may want to use packages instead of a file-per-uri method. 
That means you use the following registration:



   SetHandler perl-script
   PerlResponseHandler Your::Package::Here


Check out perl.apache.org for a sample package that uses this model.

And using this model, you can use the following to set your content handler:
$r->content_type('text/html');


Is this a problem or is it just bad style?
I don't think it's bad style. But if you're just using modperl to 
accelerate your perl applets, you should try this method instead for 
setting content type:


$q->header(-type => 'text/html');

Where $q is an instance of CGI (check out perldoc for details).




Re: mp2: A interprocess shared variable for Windows modperl?

2006-03-20 Thread Foo Ji-Haw

Thanks for the tip Perrin. Now I can move forward. :)

Perrin Harkins wrote:

Foo Ji-Haw wrote:

Can anyone recommend an alternative solution to my problem?


Nowhere near as fast, but MLDBM::Sync is solid and well-tested on 
Windows.


- Perrin




mp2: A interprocess shared variable for Windows modperl?

2006-03-19 Thread Foo Ji-Haw

Hi all,

Some time back I poll the community for a means to access variables 
across processes, and the good people suggested Cache-FastMmap.


I'd like to use it, but there does not seem to be any ppm version for 
the Windows platform (I've looked at theoryx5 and bribes, in addition to 
the standard repository).


Can anyone recommend an alternative solution to my problem? Best if it 
handles concurrency. Thanks.


Re: Modperl2 question

2006-03-12 Thread Foo Ji-Haw


Sure, libapreq and its included modules are the fastest way to parse 
parameters and handle cookies.  However, hardly anyone needs that 
speed.  Most people are spending all of their time talking to a 
database or doing other I/O tasks, or have pretty minimal web traffic, 
or both.
That's true. I spend more time optimising the database and the web ui 
then anything.


If you're writing something new, and you don't care about supporting 
CGI, and you want to use the fastest option, by all means give 
libapreq a try.  For most people though, it won't make any measurable 
difference which one you use.  I wouldn't advise anyone to bother 
changing CGI.pm code unless they've run a profiler and seen it show up 
high enough to matter.
Apache2::Request, and Apache2::Cookie looks like compatible replacements 
to CGI and CGI::Cookie. I think that's the objective anyway, so that 
when the need arises, it's just a simple replacement from the root 
function call (assuming factoring has been done). I think the difference 
will be whether the web application is a high traffic site-low cpu site, 
or a high cpu-low traffic one. The performance gain for the former will 
be more significant.





Re: Modperl2 question

2006-03-12 Thread Foo Ji-Haw
That's odd. I thought I remembered reading up about discouraging the use 
of the CGI module in optimising modperl.
The rationale (if I remembered right) is that CGI depends on the %ENV, 
which populating it for every call is an effort. The recommended way is 
to turn of SetupEnv, and grab as much stuff from Apache2::RequestRec as 
possible.


Perrin Harkins wrote:

Foo Ji-Haw wrote:
So what you are saying, is that it is generally fine in a production 
environment to continue using CGI::Cookie?


Yes.


But it does not infer that using CGI is just as well right?


The CGI.pm module?  That's fine too.

- Perrin




Re: Modperl2 question

2006-03-12 Thread Foo Ji-Haw


Some people have existing code using CGI::Cookie, or want their new 
code  to work under CGI.  The performance difference is pretty small 
in any significant web app.

Hey Perrin,

So what you are saying, is that it is generally fine in a production 
environment to continue using CGI::Cookie? But it does not infer that 
using CGI is just as well right?


Just to clarify.


Re: Modperl2 + PerlAccessHandler + Sending Cookie

2006-03-12 Thread Foo Ji-Haw

Hello Fred,

Ok, the 12 layers of Apache is as cool as the OSI layers. Let's say that 
in my PerlAuthzHandler I verified the user via a cookie (given to the 
client during login). It sounds like double work to retrieve the user 
details again during the PerlResponseHandler phase (I have to do that to 
process the page based on the user). Following the mailing list thread, 
is the only/ preferred way to use the bucket brigade?


Fred Moyer wrote:

On Mon, 13 Mar 2006, Foo Ji-Haw wrote:
Wow, a little tangent to the topic here: I didn't know that you can 
do this

PerlResponseHandler Apache2::Const::OK
Is that 'legal'? It's interesting to know, but I wouldn't know of a 
practical use for this trick.


Specifying a return code for a handler phase is perfectly legal.  I 
first saw this technique used in 'PerlMapToStorageHandler 
Apache2::Const::OK' to skip the request phase which maps the uri to a 
location on disk, but you can use it with any phase.


Last question: is it a best practice to do the user and access 
authentication check at the PerlAccessHandler level? I like the idea 
(obviously I've not been trying this way). A single authentication 
module that can be used across various PerlResponseHandler. Easy to 
maintain and propogate.


The PerlAccessHandler phase runs in the same phase of the request 
cycle as Apache's mod_access module, and is meant to handle the 
request based on IP and domain information.  In httpd.conf, you can 
say 'Order Allow, Deny',
'Deny from 123.456.789.012', or you can use the PerlAccessHandler 
phase and

examine the request IP and accomplish the same functionality ( see
http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlAccessHandler). 
It is best practice to do access checks.


Best practice for user authentication is to use PerlAuthenHandler, and 
best practice for user authorization is the PerlAuthzHandler.  This 
way, you can modify the request, and return DECLINED, and Apaches 
authen and authz modules can do additional checks on those phases of 
the request.  Or you can do authen/authz only in the mod_perl phases 
and return OK or UNAUTHORIZED and skip Apache's auth/authz modules.


Each phase in this diagram - 
http://perl.apache.org/docs/2.0/user/handlers/http.html#HTTP_Request_Cycle_Phases 

- has a corresponding hook in Apache which runs after mod_perl if 
DECLINED is returned.  This is one of mod_perl's greatest strengths.




Re: Modperl2 question

2006-03-12 Thread Foo Ji-Haw


Apache2::Cookie is one of the glue modules for libapreq2.  You have to 
install libapreq2 to get Apache2::Cookie.


Ok. I am crazy about libapreq2 because it is a direct replacement to 
CGI. I thought this is the preferred way against continuing CGI (for 
performance reasons) in the modperl enviromment. Or am I missing 
something here?


Re: Modperl2 + PerlAccessHandler + Sending Cookie

2006-03-12 Thread Foo Ji-Haw

Wow, a little tangent to the topic here: I didn't know that you can do this
PerlResponseHandler Apache2::Const::OK
Is that 'legal'? It's interesting to know, but I wouldn't know of a 
practical use for this trick.


Another question: why do you use CGI::Cookie in place of Apache2::Cookie?

Last question: is it a best practice to do the user and access 
authentication check at the PerlAccessHandler level? I like the idea 
(obviously I've not been trying this way). A single authentication 
module that can be used across various PerlResponseHandler. Easy to 
maintain and propogate.


Fred Moyer wrote:

yperl wrote:

unfortunately no. I've already tried this.


Sometimes bad cookies leave no crumbs and are especially hard to track 
down.  I'm guessing this has to do with the specifics of your cookie 
values - can you show us the exact code you used to create it?


I was able to successfully bake a cookie from a PerlAccessHandler with 
the following code:


package Cookie::Monster;

use strict;
use warnings;

use Apache2::Const -compile => qw( OK );
use CGI::Cookie;

sub handler {
my $r = shift;
my $cookie = new CGI::Cookie( -name => 'ID', -value => 123456 );
$r->headers_out->add('Set-Cookie' => $cookie );
return Apache2::Const::OK;
}

1;

httpd.conf


SetHandler modperl
PerlAccessHandler Cookie::Monster
PerlResponseHandler Apache2::Const::OK


Headers output:

GET /test/ HTTP/1.1
Host: localhost:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) 
Gecko/20051201 Firefox/1.0.7
Accept: 
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 


Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: ID=123456
Cache-Control: max-age=0



Frank Wiles a écrit :

On Sat, 11 Mar 2006 02:42:20 +0100
yperl <[EMAIL PROTECTED]> wrote:

 

I've tried everything I found (in mailing lists, suggestions, web doc)
to send cookie from a PerlAccessHandler, but without success.

Before giving up, I would like to have an answer from the mod_perl2 
authors if it is possible.


[snip]

  if ( grantAccess() ) {

  $r->headers_out->{'Set-Cookie'} = $cookie;
  return Apache2::Const::OK;
  }



  Shouldn't that be:
  $r->headers_out->add('Set-Cookie' => $cookie );
 -
   Frank Wiles <[EMAIL PROTECTED]>
   http://www.wiles.org
 -

  








Re: Persisting data across handlers

2006-03-12 Thread Foo Ji-Haw

Philippe M. Chiasson wrote:

Vipul Ved Prakash wrote:
  

Thanks, Philippe.  For some reason I thought I had to use Apache's
memory management abstractions for this.


Out of curiosity, will using pnotes work just as well for your purpose?



Re: Modperl2 question

2006-03-12 Thread Foo Ji-Haw



There's a few recipes here:
http://perl.apache.org/docs/2.0/user/coding/cooking.html#Sending_Cookies_Using_libapreq2
  

Would using t Apache2::Cookie work just as well?


Re: can mp2 flush response output to the client, then continue processing?

2006-03-08 Thread Foo Ji-Haw

Excellent lateral solution! Thanks Tyler.

Tyler MacDonald wrote:

Foo Ji-Haw <[EMAIL PROTECTED]> wrote:
  
The basis for the need is because I am thinking of having my process 
call itself (but another uri) to activate another process.


Appreciate any tips you can offer. Thanks.



According to the docs a PerlCleanupHandler may do the trick:

http://perl.apache.org/docs/2.0/user/handlers/http.html#PerlCleanupHandler

Cheers,
Tyler

  




can mp2 flush response output to the client, then continue processing?

2006-03-08 Thread Foo Ji-Haw

Hi all,

I'm wondering if modperl can do the following:

When responding to a http post/get, it will send a simple response to 
the client, close the connection, but continue to do some processing. 
Pseudo-code is as follows:


sub handler
{
   my $r = shift;
   print "OK";
   $r->flush;
   $r->closeConnection;

   doMoreWork();
}


The basis for the need is because I am thinking of having my process 
call itself (but another uri) to activate another process.


Appreciate any tips you can offer. Thanks.


Re: A question for the newbies

2006-02-16 Thread Foo Ji-Haw
Thanks for the web links. I already have book by Damian, and it's a good
read.

- Original Message - 
From: "Tyler MacDonald" <[EMAIL PROTECTED]>
To: "Foo Ji-Haw" <[EMAIL PROTECTED]>
Cc: "Michael Greenish" <[EMAIL PROTECTED]>; "mod_perl"

Sent: Friday, February 17, 2006 11:19 AM
Subject: Re: A question for the newbies


> Foo Ji-Haw <[EMAIL PROTECTED]> wrote:
> > > I knew that perl could do OO and I couldn't find
> > > design patterns to go to the next step.
> > You brought up a good point. I wish someone will write a Design Patterns
> > book based on Perl...
>
> This helps:
>
> http://perldesignpatterns.com/perldesignpatterns.html
>
> And this is useful too:
>
> http://www.oreilly.com/catalog/perlbp/
>
> - Tyler
>



Re: A question for the newbies

2006-02-16 Thread Foo Ji-Haw
> On Feb 16, 2006, at 10:18 PM, Foo Ji-Haw wrote:
> > I think the biggest complaint about Perl, is that it is too
> > symbolic (which
>
> I thought that its ugly code - caused in part by no standard coding
> practices, and far too many people pushing 'theres more than one way
> to do it'
I actually favour the multiple-approach offer. Having more than 1 way to
feed your dog does not mean that you have to make the dog suffer. Creativity
and freedom will favour forward evolution. Besides, it makes programming
Perl fun!



Re: A question for the newbies

2006-02-16 Thread Foo Ji-Haw
I think people choose templating engines depending on how they want to use
it. For me, HTML::Template is fairly ideal because it encourages me to focus
on the business logic, and abstracts the presentation fairly well. By
allowing only simple tag replacements and loops, it has so far allowed me to
do everything I needed to do on the Web.

There are arguments on how much a templating engine 'should' offer. Some
like the engine to accept 'codelets', others (like me) prefer to keep it as
simple as possible. For this reason I have found it difficult to accept
Mason and Template Toolkit.

- Original Message - 
From: "Jonathan" <[EMAIL PROTECTED]>
To: "Michael Greenish" <[EMAIL PROTECTED]>
Cc: "mod_perl" 
Sent: Friday, February 17, 2006 2:16 AM
Subject: Re: A question for the newbies


>
> On Feb 16, 2006, at 12:48 PM, Michael Greenish wrote:
>
> > What I like about PHP over perl is the ease of
> > variable declaration.  I feel I have to use strict
> > with perl, I would like the ability to not have to put
> > "my" in front of every new variable.
>
> putting my / our before variables is good though.
>
> > is the templating.  I haven't found a template module
> > in perl that rivals Smarty templates in PHP.
>
> Have you looked at Template::Toolkit ? Or Mason ?
>
> > any array element with ".".  Smarty plugin's are
> > great.  They help with creating select drop downs,
> > date drop downs.  I can capitalize, count, strip
> > template variables within smarty
> All the perl templating engines allow that.  there's also FormBuilder
> and other things
>
> > so much more I can do with Smarty than with
> > HTML::Template.  Maybe I just missed all that stuff in
> > the documentation but again, I didn't find it.  Also,
> > it's much easier to include a code snippet in php than
> > in perl.
> HTML::Template is a simple barebones templating system.  its not a
> robust approach like Smarty.  You should be looking at TT and MAson.
>
> > Today, Perl is still my personal favorite language to
> > code for web/unix task.  However at work, I am
> > implementing MVC in PHP 4 much like I did with Perl
> > using the basic OO capabilities available in 4.
> > Interface functions don't help in the web apps I do
> > (small - medium) so I don't see to much need for us to
> > move to 5.  But that's another topic.
> I'd suggest looking at TAL the Template Attribute Language.  The
> specification is on the Zope website (python).  There are perl and
> php implementations (be warned though, the php version is a bit slow,
> so i suggest using a code caching system like eaccelerator with it).
> It's rather nice if you're doing cross-language development, because
> the same templates will work in just about any language.
>
>
>



Re: A question for the newbies

2006-02-16 Thread Foo Ji-Haw
> Did you ever try Template Toolkit? I'd say it's probably more popular than
> HTML::Template, and much less restrictive (although you also have more
rope to
> hang yourself too) and can do everything that you mentioned below.
What's the draw of Template Toolkit? I am a heavy user of HTML::Template,
primarily because lets me edit my html templates well on Dreamweaver.



Re: A question for the newbies

2006-02-16 Thread Foo Ji-Haw
> I knew that perl could do OO and I couldn't find
> design patterns to go to the next step.
You brought up a good point. I wish someone will write a Design Patterns
book based on Perl...

I've read up on Ruby (to understand the growing interest around it). It
looks Perlish, and it's an interesting alternative to Java. I think the
biggest problem with Ruby and PHP is that none of them have the support that
matches CPAN. In fact, I think CPAN is the biggest advantage for the Perl
community. Java has a huge and growing community library. I must say that
some of the Java-based works are really impressive.



Re: A question for the newbies

2006-02-16 Thread Foo Ji-Haw
>   Just an FYI, Perl 6 will use the dot notation for calling methods.
I did an O'Reilly read on Perl 6. The new syntaxes for variable manipulation
is a bit rough going for sunk-in Perl5 people like me.

But more importantly: when will it ever be ready?!? ( I know there are no
answers to this...)



Re: A question for the newbies

2006-02-16 Thread Foo Ji-Haw
I think the biggest complaint about Perl, is that it is too symbolic (which
I agreed when I started with Perl myself), making the learning curve steep.
But looking back, I am now much better able to focus on the problem
statement. Perl's TIMWTOWTDI attitude allows me to develop creatively, and
caters to developers of varying depths. Even now I am still learning more
tricks (like closures, tie) to make my work more efficient.


- Original Message - 
From: "Boysenberry Payne" <[EMAIL PROTECTED]>
To: "Clinton Gormley" <[EMAIL PROTECTED]>
Cc: "mod_perl" 
Sent: Thursday, February 16, 2006 11:37 PM
Subject: Re: A question for the newbies


> I guess I'm still considered a mod_perl / perl newbie.  I started
> learning perl 6 months
> ago in anticipation of translating a CMS (Content Management System) I
> wrote in PHP.
>
> I considered Python, and  C++ as alternatives.  C++ was over kill and
> would require
> way too much development just to get going (why reinvent the wheel if I
> don't have to.)
> Python, seemed too similar to PHP for my tastes.  I don't like being
> "forced" to use
> someone else's coding conventions unless I know there are valid reasons
> for it.
> With what I read about Python's white space issues, I thought it might
> be more
> tedious, rather than easier to maintain my 50+ files of code.
>
> Once I started looking into perl I was blown away.  Not only has perl
> been the "swiss
> army knife" of system administration for well over 10 years, but
> mod_perl blows the
> socks off of php.
>
> So for my particular project I couldn't find a better solution.
>
> I think the hardest part about learning perl (coming from developing in
> php for 5 years) was the odd mix of syntax.  It's a mixture of a couple
> of
> languages.  Because I was new to unix and shell syntax it was a bit of
> time before I started to feel comfortable.  Considering 70% of the
> internet
> is run off of *nix flavored servers it's not a bad skill to have.
>
> The benefits of having moved to perl from php are too many to count.
> Just the efficiency of perl's string manipulation cut my code down by
> up-to 50% in some cases.  Perls abilities to be used both procedurally
> as well Object Oriented makes it easy for me to use it which ever way
> is most useful for my task.
>
> Moving from PHP to Perl has been the smartest move I've made.  Our
> code is more secure (we use a proxy system to keep it completely
> separate
> from our client's file server.)  Our system is more stable and
> responsive.
> And my code is 100% easier to maintain.
>
> Although I could have used Python or even stuck with PHP and
> accomplished
> most of what I'm doing, it would take more time, and wouldn't be nearly
> as much
> fun.  In my situation (building a CMS without funding, etc.) I don't
> think I would
> have made it this far without being inspired as I was by perl, mod_perl
> and
> all that they can do.
>
> Did I mention CPAN?
>
> My hat is off to the Perl/mod_perl community for giving such an
> opportunity.
> When in history has it been so bright?
>
> Boysenberry
>
> boysenberrys.com | habitatlife.com | selfgnosis.com
>
> On Feb 16, 2006, at 7:41 AM, Clinton Gormley wrote:
>
> > It seems to me that a lot of people new to mod_perl and to Perl have
> > joined this mailing list recently.
> >
> > And this is during a period when popular opinion (amongst those who
> > know
> > no better) seems to regard Perl as antiquated.
> >
> > I'm delighted that new people are joining.
> >
> > My question is, what prompted you? What made you choose Perl above
> > Java/.Net/Python/Ruby etc etc
> >
> > Do you have experience of those languages? What appeals to you about
> > Perl? And how do you find your community experience/support compared to
> > the other languages you know?
> >
> > clint
> >
> >
> >
> >



Re: A question for the newbies

2006-02-16 Thread Foo Ji-Haw



Not to be racist, I am STILL cleaning up codes from an 
outsourced developer, despite their investment in OOP coding. It's not about 
procedural, or OO. It's the programming foundation and learning the best 
practices.
 
So go now and buy a Stas/ Damian (O'Reilly) book! 
:)
 
More importantly, how do you Reflect with 
Perl?

  - Original Message - 
  From: 
  Mark 
  Galbreath 
  To: modperl@perl.apache.org ; [EMAIL PROTECTED] 
  Sent: Thursday, February 16, 2006 10:42 
  PM
  Subject: Re: A question for the 
  newbies
  
  I've been developing apps for business, ecommerce, and government in Java 
  for 6 years.  I developed Web sites with Perl 5.0 CGI in the 
  mid-1990s but never much cared for it outside of its excellent string 
  maniulation, being attracted to the pure OO languages. I spent the last 2 
  years developing in C# ASP.NET and PHP 5.0.  Why did I come back to 
  Perl?
   
  Not voluntarily.  Competition from foreign developers, mostly from 
  India, and companies outsourcing to offshore companies, mostly in India and 
  Indonesia, depressed contracting rates all along the DC - Boston tech corridor 
  for Java programmers.  .NET has not been widely accepted as a replacement 
  for Java or the installed base of VB 6.0 apps and so opportunities are 
  sparse.  I came back to Perl because I was unemployed for 6 months and 
  this was the only decent job (pay the mortgage, college tuition, eat) I could 
  find.  Seems like I have come full-circle over 10 years.
   
  Nevertheless, I was very, very happy to find that in those intervening 10 
  years, Perl became OO with 5.6 and the 5.6 debug version, 5.8.  My perl 
  code is now rife with double colons and reference arrows.  I miss the 
  reference dot notation of Java and other OO languages, however.  Why 
  didn't Larry include that?  And the 'use v. require' issue seems silly to 
  me.  Why not a simple 'import' statement?  And the accessor schema 
  and issues of 'my v. our v. local' and package transparency seems hackneyed to 
  me.  Perhaps 6.0 will address issues like these?  I haven't 
  looked.
   
  Depsite my criticisms, I found that my fears of having to go "backwards" 
  to a procedural language were unfounded.  Like C++, you can write 
  procedural code in perl, but you'll soon be replaced by H1-B contractors if 
  you do.  :-)
   
  Mark<-|->kraM
  Perl does Reflection.>>> Clinton Gormley 
  <[EMAIL PROTECTED]> 16-Feb-06 08:41:02 AM >>>
  It seems to me that a lot of people new to 
  mod_perl and to Perl havejoined this mailing list recently.And 
  this is during a period when popular opinion (amongst those who knowno 
  better) seems to regard Perl as antiquated.I'm delighted that new 
  people are joining.My question is, what prompted you? What made you 
  choose Perl aboveJava/.Net/Python/Ruby etc etcDo you have 
  experience of those languages? What appeals to you aboutPerl? And how do 
  you find your community experience/support compared tothe other languages 
  you know?clint


Re: mod_perl 2.0.0 + Apache 2.0.55 on Cygwin Win2k3

2006-02-16 Thread Foo Ji-Haw



To give you some confidence in ActivePerl+mod_perl 
on Win32, I have 2 years back implemented a mini ERP system ENTIRELY on this 
same platform, with a call centre, reception, billing and invoicing, and 
other administrative components. It sits on a 2 simple servers: 1 for the 
application, and the other for the database. It is still working 
today.
 

  - Original Message - 
  From: 
  Jason J. Czerak 
  To: Mark Galbreath 
  Cc: [EMAIL PROTECTED] ; [EMAIL PROTECTED] 
  ; modperl@perl.apache.org 
  Sent: Thursday, February 16, 2006 10:34 
  PM
  Subject: Re: mod_perl 2.0.0 + Apache 
  2.0.55 on Cygwin Win2k3
  Let me make this CLEAR please.Activestate perl, or any 
  other perl/mod_perl/Apache that I found for windows fails under any load with 
  zero error messages in any of the log files.  I need to do some sort of 
  trace or something to get any real info for you developers, this I know. But 
  in the mean time I'm looking for a quick solution.  The problem with 
  native perl/apache/mod_perl is that randomly something will hang and just eat 
  up memory and about 30% cpu.  We did benchmark load testing and just are 
  loading up the splash page over and over and over. Even at the rate of 4 
  requests per second, it will hand, it will take time, but it will hand... the 
  exact same config on Solaris is perfect.I'm sure it's something in 
  Apache::ASP and the Apache2:proting / Apache2:compat modules that hosing 
  things up.On Thu, 2006-02-16 at 08:47 -0500, Mark Galbreath 
  wrote: 
  A word of caution from personal 
experience here. 
   
  First, I love ActiveState' s 
stuff - I bought (out of my pocket) personal and pro licenses for Komodo 3.2 
and 3.5.  I run ActivePerl 5.8 and ActivePython 2.4 on my Winblows and 
Linux boxes at home.  So what's the prob? 
   
  At the office, installing 
ActivePerl just annoyed the sysadmins because it didn't really break 
anything but I found myself in the position of begin able to take advantage 
of some pretty cool modules (like IO::ALL, e.g.) that have been upgraded or 
designed for 5.8 when the infrastructure remains at 5.6.  I didn't 
think of this (doh!) until I tried deploying a little app I wrote and found 
it wouldn't work.  Make sure your infrastructure will support your 
upgrade! 
   
  Second, and though way more 
serious for me but perhaps not for you, I did the same with ActivePython and 
it broke all the system utilities on my Red Hat Enterprise 4 
workstation.  This really pissed off the sysadmins and raised flags 
with the Security folks. 
   
  Third, one of the linux support 
folks here told me they were not supporting ActiveState products because the 
company was in the process of dissolving or being bought or something that 
made service and support continuity questionable.  Can anybody confirm 
this? 
   
  Mark<-|->kraM>>> Tom Schindl <[EMAIL PROTECTED]> 16-Feb-06 
09:20:29 AM >>>
  It's free ;-) http://www.activestate.com/TomJeff Pang 
wrote:>> Why don't you try ActivePerl 
instead of cygwin ?>  
> Is there any free version of 
ActivePerl£¿or how much should I pay for> 
it?thanks.> > - Original Message 
-> *From:* 
Jason J. Czerak > *To:* modperl@perl.apache.org 
> *Sent:* Thursday, February 16, 
2006 4:28 AM> 
*Subject:* mod_perl 2.0.0 + Apache 2.0.55 on Cygwin Win2k3> > I have an application that is 
based on Apache::ASP. Apache::ASP> requires Apache2::porting and 
Apache2::compat to be in the startup.pl.> 
> Everything is 
working very well. I some how got mod_perl to build> and running with out a segfault. 
This is good. The issue is when> startup.pl is called, either from 
the command line or within apache> I get this error:> > [Wed Feb 15 13:47:49 2006] 
[error] Can't load> 
'/usr/lib/perl5/site_perl/5.8/cygwin/auto/Apache2/ServerUtil/ServerUtil.dll'> for module Apache2::ServerUtil: 
No such process at> 
/usr/lib/perl5/5.8/cygwin/XSLoader.pm line 68.\n at> 
/usr/lib/perl5/site_perl/5.8/cygwin/Apache2/XSLoader.pm line> 30\nCompilation failed in require 
at /u01/startup.pl line 4.\nBEGIN> failed--compilation aborted at 
/u01/startup.pl line 4.\nCompilation> failed in require at (eval 2) 
line 1.\n> > Suggestions?> > I have also have this some what 
working on native Win32 install of> perl/apache/mod_perl. but apache 
goes into some sort of loop, eating> memory and a kill is required, 
but this is random and only after> some load 
testing.> > -- > Jason Czerak 
([EMAIL PROTECTED] )> > > > > > > 
__> This email transmission and any 
documents, files or previous ema

Re: A question for the newbies

2006-02-16 Thread Foo Ji-Haw
One of my hopes for mod_perl, is that it will evolve into a web
server-independent layer, that can be put on IIS as well (for example). I do
agree that Apache is a much stronger platform than IIS, but it is a bit iffy
to put all the eggs in the same basket...

- Original Message - 
From: "Arne Skjaerholt" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, February 16, 2006 11:11 PM
Subject: Re: A question for the newbies


> I'm not exactly a newbie anymore, but I came to mod_perl by way of Perl
> scripts for the shell. I'd already written some PHP, but when I learned
> Perl I saw the error of my ways as it were and realized that PHP really
> is quite the makeshift language and that developing in Perl was far more
> comfortable (and better for my sanity =).
>
> Also, once I understood what mod_perl was -really- about, I got all the
> more excited as it opens up a host of possibilities not available in
> PHP.
>
> Arne
> :wq



Re: mod_perl 2.0.0 + Apache 2.0.55 on Cygwin Win2k3

2006-02-16 Thread Foo Ji-Haw



The cause may be in your installation process 
(which should not be difficult). Maybe you relook the steps, or share the steps 
you took.

  - Original Message - 
  From: 
  Jason J. Czerak 
  To: Foo Ji-Haw 
  Cc: modperl@perl.apache.org 
  Sent: Thursday, February 16, 2006 10:28 
  PM
  Subject: Re: mod_perl 2.0.0 + Apache 
  2.0.55 on Cygwin Win2k3
  Note what I left in this reply... I suppose I should of 
  been more explicit in what I tried. AcriveState perl fails quicker then 
  perl.org perl binaries that I found.On Thu, 2006-02-16 at 10:43 
  +0800, Foo Ji-Haw wrote:
   
  Why don't you try 
ActivePerl instead of cygwin ? 
  
- Original Message - 

  
From: Jason J. Czerak 

  
To: modperl@perl.apache.org 

  
Sent: 
  Thursday, February 16, 2006 4:28 AM 
  
Subject: 
  mod_perl 2.0.0 + Apache 2.0.55 on Cygwin Win2k3 
  
  
. 
  
I have also have this some what 
  working on native Win32 install of perl/apache/mod_perl. but apache goes 
  into some sort of loop, eating memory and a kill is required, but this is 
  random and only after some load testing.
  


  -- 
Jason Czerak ([EMAIL PROTECTED])


  


  
  


  -- 
Jason Czerak ([EMAIL PROTECTED])


  


  __This email transmission and any documents, files or previous emailmessages attached to it may contain information that is confidential orlegally privileged. If you are not the intended recipient or a personresponsible for delivering this transmission to the intended recipient,you are hereby notified that you must not read this transmission andthat any disclosure, copying, printing, distribution or use of thistransmission is strictly prohibited. If you have received this transmissionin error, please immediately notify the sender by telephone or return emailand delete the original transmission and its attachments without readingor saving in any manner.


Re: mod_perl 2.0.0 + Apache 2.0.55 on Cygwin Win2k3

2006-02-16 Thread Foo Ji-Haw



I have not much experience with ActivePerl on non-Win32 
platforms, so this is mostly my conjecture:
 
While ActivePerl is available on most popular platforms, 
it's strengths are mostly on the Windows platform, where many administrative and 
windows-centric components can be controlled. I have spent much of my Perl time 
on the Windows platform, and while it has its quirks, ActivePerl's ppd bank 
makes it really easy to load in a new module, and I am grateful for that (I have 
to date not needed to compile any modules).
 
I don't know how most people use Perl, but for me, it's 
mostly for commercial purposes, and less an administrative tool. I love 
it!

  - Original Message - 
  From: 
  Mark 
  Galbreath 
  To: [EMAIL PROTECTED] ; [EMAIL PROTECTED] 
  
  Cc: modperl@perl.apache.org 
  Sent: Thursday, February 16, 2006 9:47 
  PM
  Subject: Re: mod_perl 2.0.0 + Apache 
  2.0.55 on Cygwin Win2k3
  
  A word of caution from personal experience here.
   
  First, I love ActiveState' s stuff - I bought (out of my pocket) personal 
  and pro licenses for Komodo 3.2 and 3.5.  I run ActivePerl 5.8 and 
  ActivePython 2.4 on my Winblows and Linux boxes at home.  So what's the 
  prob?
   
  At the office, installing ActivePerl just annoyed the sysadmins because 
  it didn't really break anything but I found myself in the position of begin 
  able to take advantage of some pretty cool modules (like IO::ALL, e.g.) that 
  have been upgraded or designed for 5.8 when the infrastructure remains at 
  5.6.  I didn't think of this (doh!) until I tried deploying a little app 
  I wrote and found it wouldn't work.  Make sure your infrastructure will 
  support your upgrade!
   
  Second, and though way more serious for me but perhaps not for you, I did 
  the same with ActivePython and it broke all the system utilities on my Red Hat 
  Enterprise 4 workstation.  This really pissed off the sysadmins and 
  raised flags with the Security folks.
   
  Third, one of the linux support folks here told me they were not 
  supporting ActiveState products because the company was in the process of 
  dissolving or being bought or something that made service and support 
  continuity questionable.  Can anybody confirm this?
   
  Mark<-|->kraM>>> Tom Schindl 
  <[EMAIL PROTECTED]> 16-Feb-06 09:20:29 AM >>>
  It's free ;-) http://www.activestate.com/TomJeff 
  Pang wrote:>> Why don't you try ActivePerl instead of cygwin 
  ?>  > Is there any free version of ActivePerl£¿or how much 
  should I pay for> it?thanks.> > 
  - Original Message -> *From:* Jason J. 
  Czerak > 
  *To:* modperl@perl.apache.org > 
  *Sent:* Thursday, February 16, 2006 4:28 AM> 
  *Subject:* mod_perl 2.0.0 + Apache 2.0.55 on Cygwin Win2k3> 
  > I have an application that is based on 
  Apache::ASP. Apache::ASP> requires 
  Apache2::porting and Apache2::compat to be in the startup.pl.> 
  > Everything is working very well. I some how 
  got mod_perl to build> and running with out a 
  segfault. This is good. The issue is when> 
  startup.pl is called, either from the command line or within 
  apache> I get this error:> 
  > [Wed Feb 15 13:47:49 2006] [error] Can't 
  load> 
  '/usr/lib/perl5/site_perl/5.8/cygwin/auto/Apache2/ServerUtil/ServerUtil.dll'> 
  for module Apache2::ServerUtil: No such process 
  at> /usr/lib/perl5/5.8/cygwin/XSLoader.pm line 
  68.\n at> 
  /usr/lib/perl5/site_perl/5.8/cygwin/Apache2/XSLoader.pm 
  line> 30\nCompilation failed in require at 
  /u01/startup.pl line 4.\nBEGIN> 
  failed--compilation aborted at /u01/startup.pl line 
  4.\nCompilation> failed in require at (eval 2) 
  line 1.\n> > Suggestions?> 
  > I have also have this some what working on 
  native Win32 install of> perl/apache/mod_perl. 
  but apache goes into some sort of loop, eating> 
  memory and a kill is required, but this is random and only 
  after> some load testing.> > -- 
  > 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.> 
  > > --> Jeff

Re: mod_perl 2.0.0 + Apache 2.0.55 on Cygwin Win2k3

2006-02-15 Thread Foo Ji-Haw



Why don't you try ActivePerl instead of cygwin 
?

  - Original Message - 
  From: 
  Jason J. Czerak 
  To: modperl@perl.apache.org 
  Sent: Thursday, February 16, 2006 4:28 
  AM
  Subject: mod_perl 2.0.0 + Apache 2.0.55 
  on Cygwin Win2k3
  I have an application that is based on Apache::ASP. Apache::ASP 
  requires Apache2::porting and Apache2::compat to be in the 
  startup.pl.Everything is working very well. I some how got mod_perl to 
  build and running with out a segfault. This is good. The issue is when 
  startup.pl is called, either from the command line or within apache I get this 
  error:[Wed Feb 15 13:47:49 2006] [error] Can't load 
  '/usr/lib/perl5/site_perl/5.8/cygwin/auto/Apache2/ServerUtil/ServerUtil.dll' 
  for module Apache2::ServerUtil: No such process at 
  /usr/lib/perl5/5.8/cygwin/XSLoader.pm line 68.\n at 
  /usr/lib/perl5/site_perl/5.8/cygwin/Apache2/XSLoader.pm line 30\nCompilation 
  failed in require at /u01/startup.pl line 4.\nBEGIN failed--compilation 
  aborted at /u01/startup.pl line 4.\nCompilation failed in require at (eval 2) 
  line 1.\nSuggestions?I have also have this some what working 
  on native Win32 install of perl/apache/mod_perl. but apache goes into some 
  sort of loop, eating memory and a kill is required, but this is random and 
  only after some load testing.
  


  -- 
Jason Czerak ([EMAIL PROTECTED])


  


  __This email transmission and any documents, files or previous emailmessages attached to it may contain information that is confidential orlegally privileged. If you are not the intended recipient or a personresponsible for delivering this transmission to the intended recipient,you are hereby notified that you must not read this transmission andthat any disclosure, copying, printing, distribution or use of thistransmission is strictly prohibited. If you have received this transmissionin error, please immediately notify the sender by telephone or return emailand delete the original transmission and its attachments without readingor saving in any manner.


Re: MP2 PerlTransHandler and VirtualHosts

2006-02-14 Thread Foo Ji-Haw
Title: MP2 PerlTransHandler and VirtualHosts



I'd like to ask a question in tangent to 
yours:
What happens you load a package via 
PerlPostConfigRequire? I usually 'require' a script, but if it is possible to 
execute a package instead, that may be better.

  - Original Message - 
  From: 
  Peter, 
  Attila 
  To: modperl@perl.apache.org 
  Sent: Wednesday, February 15, 2006 6:16 
  AM
  Subject: MP2 PerlTransHandler and 
  VirtualHosts
  
  List, 
  Is there any method to restore Apache's default 
  PerlTransHandler (or in general any other 
  handler) in VirtualServer container after a 
  PerlTransHandler was set up in the main server config? 
  Consider the following: 
  PerlLoadModule    
  MyApp::ConfigParameters PerlPostConfigRequire  MyApp/DeviceProxy.pm PerlTransHandler  
  MyApp::DeviceProxy 
   PerlOptions +Parent # don't use the main server's perl 
  interpreter pool …. PerlLoadModule    
  MyApp::ConfigParameters …. _ Don't want the main server's TransHandler to run here 
  _ _ No PerlTransHandler directive is 
  present _  
  In the main server  
  PerlPostConfigRequire  MyApp/DeviceProxy.pm is used to load some big chunk of data into memory that is then 
  used by the PerlTransHandler to rewrite the 
  uri and eventually dispatch the request  to one of the several virtual servers. (This in-memory data is 
  huge and not needed for handlers defined 
  VirtualHosts) The handler sub for the 
  TransHandler is defined in the MyApp::DeviceProxy module as well and it returns DECLINED. 
  At server start-up the stuff is loaded into memory 
  before the very first request and requests 
  ending up on the main server are serverd fast. When, however, I go for the doc root on any of the virtual servers I 
  notice that there is a huge delay for the 
  first request (further requests are served fast). 
  What happens is that for the first request the 
  MyApp::DeviceProxy is loaded for the virt 
  host.. But there is not a single line in the virt host that would cause loading that module! It is crucial for me to avoid loading that module again and 
  again for every virtual server. And it is 
  also required for the virtual servers to have their own independent 
  interpreter pool. 
  I compiled apache+mod perl with worker mpm. 
  And here is the relevant info on the components: 
  Apache/2.2.0 (Unix) mod_perl/2.0.2 
  Perl/v5.8.7 
  Please give me a hint what I'm doing wrong 
  
  Thanks, --Attila 


Re: libapreq2-2.07 prerequisites (CPAN install)

2006-02-13 Thread Foo Ji-Haw
modperl and Apache::* libraries are generally for the Apache platform.
modperl2 and Apache2::* libraries are for the Apache2 platform. so if you
end up installing modperl on your Apache2, you've stumbled on the wrong end.

Take note that not all Apache2 modules are labelled this way. For example
Apache::DBI works for mp2 as well. So there's some tricky issues you need to
know abt.

- Original Message - 
From: "Jonathan Mangin" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, February 14, 2006 12:10 AM
Subject: libapreq2-2.07 prerequisites (CPAN install)


> Hi all,
>
> I've just begun looking at mod_perl2 and have a few scripts
> running under ModPerl::Registry.  Following a thread here,
> I wanted to install Apache::Request and look at the source.
>
> During install, mod_perl is listed as a prerequisite.
> Answering [yes] begins installation of mod_perl-1.29 which
> surprised me (and is useless?).
>
> Will 1.29 installation bung up usage of 2.0.2 in any way?
>
> Thanks alot,
> Jon



Re: More on httpd2.2, libapreq2, apr and mod_perl2 not playing nice

2006-02-12 Thread Foo Ji-Haw
Is 2.07 out already? http://theoryx5.uwinnipeg.ca/ppms/ still lists it as
2.06-dev


- Original Message - 
From: "Ryan Perry" <[EMAIL PROTECTED]>
To: "ben syverson" <[EMAIL PROTECTED]>
Cc: 
Sent: Monday, February 13, 2006 5:44 AM
Subject: Re: More on httpd2.2, libapreq2, apr and mod_perl2 not playing nice


> FYI,
>
> Problems I've been having with Apache2 on FreeBSD 6.0 seem to have
> been resolved by installing the new libapreq2-2.07
>
> Thanks!



Re: detecting server start, stop, graceful in startup.pl

2006-02-12 Thread Foo Ji-Haw
You're lucky already. You didn't see what happens on the same script running
on Win32 Apache2...

- Original Message - 
From: "Ken Perl" <[EMAIL PROTECTED]>
To: 
Sent: Sunday, February 12, 2006 3:02 PM
Subject: detecting server start, stop, graceful in startup.pl


> >From the Apache2::ServerUtil API doc, to do something only when server
> restarts (httpd -k start or httpd -k graceful), check whether
> restart_count() is bigger than 1:
>
>   my $cnt = Apache2::ServerUtil::restart_count();
>   do_something() if $cnt > 1;
>
> However, the API doesn't work as above. I tried to add some debug code
> to my startup.pl script and tried all the command options of
> apache2ctl, start, stop, graceful, the $cnt is always equal 1.
> I also tried to write the value $cnt to a /tmp/out file just like in
> the API doc and got same result, that is
>  % apache2ctl -k start
>   cnt: 1
>   cnt: 2
>
>   % apache2ctl -k graceful
>   cnt: 1
>   cnt: 3
>
>   % apache2ctl -k graceful
>   cnt: 1
>   cnt: 4
>
>   % apache2ctl -k stop
>   cnt: 1
>
> But, I can't detecting start, stop, graceful in startup.pl coding just
> like in the API doc, Could you give me some comments? thanks.
>
> --
> perl -e 'print unpack(u,"62V5N\"FME;G\!E ")'



Make your next million Stas!

2006-02-12 Thread Foo Ji-Haw
Speaking of which, when will the mp2 version of Practical Mod Perl be coming
out? I'm sure Stas will make a handsome lot (I would use 'bomb' but these
are sensitive times...) when he releases it, cause we're all depending so
much on the book...

- Original Message - 
From: "Frank Wiles" <[EMAIL PROTECTED]>
To: "Mark Galbreath" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; 
Sent: Saturday, February 11, 2006 4:29 AM
Subject: Re: read query params


> On Fri, 10 Feb 2006 15:19:30 -0500
> "Mark Galbreath" <[EMAIL PROTECTED]> wrote:
>
> > I have one whineI bought "Practical mod_perl" from amazon.com and
> > was v e r y disappointed that it only covered version 1 (only a brief
> > reference to MP2).  I understand that MP2 is so different that I've
> > wasted $30 (well, at least Stas and Eric will get about 10 cents out
> > of it). mark
>
>   The book was published in 2003 and mod_perl 2.0 wasn't released until
>   the middle of 2005. I think Stas' time machine must have been in the
>   shop. :)
>
>  -
>Frank Wiles <[EMAIL PROTECTED]>
>http://www.wiles.org
>  -



Re: read query params

2006-02-09 Thread Foo Ji-Haw



That's hard to say. I've been using mp2 
professionally, and so far installing libapreq2 has been pretty painless; both 
on Win32 and FreeBSD platforms. Win32 is pre-packaged, so it's quite 
predictable. FreeBSD's version is compiled from source, but still it's 
problem-free.
 
You really need to get libapreq2 working if you 
want the easy way of extracting POST/ GET params.
 
Your main grouse is not with mp2, but rather your 
problems in INSTALLING libapreq2. So shooting mp2 will not solve your 
problem. I'm sure there's someone in this 
community who can help you out, if you ask nicely. :)
 
 

  - Original Message - 
  From: 
  M J 
  To: modperl@perl.apache.org 
  Sent: Friday, February 10, 2006 1:22 
  AM
  Subject: read query params
  
  I’m 
  very disappointed regarding the mod_perl 2 documentation and changes that have 
  been made.
  I’m 
  searching for several hours already how can I read the query params using only 
  mod_perl2 API.
  I had 
  problem installing libapreq2-2.06-dev and I’m tired to debug that 
  library.
  I want 
  to use mod_perl2 API to do the simplest job possible: read the parameters sent 
  using GET or POST. I am looping around and I did not find a clear example or 
  explanation regarding this.
  I can 
  use $r->args() but then I need to split that string in order to get my 
  param value. I doubt that this is a good solution.
  
  P.S.
  With 
  the modification that you made for mod_perl2 you will loose a lot of perl 
  programmer and I doubt that you will get new ones.
  
  M 
  J
  
  
  Brings words and photos together (easily) withPhotoMail 
  - it's free and works with Yahoo! Mail.


Re: How to set Content-Type header on custom_response()?

2006-02-05 Thread Foo Ji-Haw
How about returning a self-designed error page, instead of using Apache's?

- Original Message - 
From: "Geoffrey Young" <[EMAIL PROTECTED]>
To: "Andrew Ho" <[EMAIL PROTECTED]>
Cc: "mod_perl List" 
Sent: Sunday, February 05, 2006 2:24 AM
Subject: Re: How to set Content-Type header on custom_response()?


> 
> 
> Andrew Ho wrote:
> > Hello,
> > 
> > I have a mod_perl (Apache 1.3.33, mod_perl 1.29) handler which returns
> > HTTP error codes on several conditions, and uses a custom_response() to
> > set a custom body. The custom body is XML (this is a middleware
> > component and errors are read by machines, not humans), so I'd like to
> > send a
> > "Content-Type: text/xml" header.
> 
> sorry, but you just can't do it. see this from the archives
> 
>   http://www.mail-archive.com/modperl@apache.org/msg20549.html
> 
> --Geoff


Re: Edit .pm file; Why must bounce Apache?

2006-01-22 Thread Foo Ji-Haw
Try 
PerlSwitches "-Ic:/ps"

- Original Message - 
From: "Pete Alvin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; 
Sent: Sunday, January 22, 2006 1:28 AM
Subject: Re: Edit .pm file; Why must bounce Apache?


> Thanks!  I'm 90% of the way there.  But I have a @INC issue:
> 
> I've been using:
> 
> use lib 'C:/ps';
> 
> to specify where my Perl modules are.  According to:
> 
> http://perl.apache.org/docs/2.0/api/Apache2/Reload.html
> 
> I need to modify @INC when the server is started.  I tried this:
> 
> PerlSetEnv PERL5LIB C:/ps
> 
> at multiple points in httpd.conf and it seems to have no effect. I 
> still get this:
> 
> [Sat Jan 21 10:07:08 2006] [error] Can't locate FormManager.pm in 
> @INC (@INC contains: C:/Program Files/Perl/lib C:/Program 
> Files/Perl/site/lib . C:/Apache2) at C:/ps/FormManagerWebTest line 
> 10.\nBEGIN failed--compilation aborted at C:/ps/FormManagerWebTest 
> line 10.\n
> 
> in the error log when I re-start Apache.  As an alternative the page 
> says to add this:
> 
> PERL5LIB=C:/ps; export PERL5LIB
> 
> to the "script that starts Apache."  
> 
> ==> Does anyone know where this file is on Windows?  What directory 
> to look in?  I've Googled and I can't find it.  Apache is running as 
> a service on my Windows XP laptop.
>  
> Peter Alvin
> mobile 719.210.3858
> AJAX consultant,
> PHP, Perl, .Net, Java,
> Search Engine Optimization,
> and Human Factors Web Consulting
> 
> 
> On Sat, 21 Jan 2006 17:00:07 +0100, Jens Gassmann wrote:
> >Hi Pete,
> >
> >>Is there a setting I can change to make modperl look to see if
> >>Perl
> >>files have changed so I don't have to keep re-starting Apache?
> >
> >take a look at Apache2::Reload
> >
> >jens
> 
> 
> 
> 


Re: restart_count() on Win32

2006-01-17 Thread Foo Ji-Haw
Hello Randy,

Do let me know if I am on the right track.

The Windows implementation of Apache2 uses a 2 processes. The worker process
creates the threads upon start/restart. This differs from Unix
implementations where it forks process instead of threads.

In Unix, the main process running modperl loads up the Perl modules, then
forks. In Windows, the worker process (not the supervisor process) loads up
modperl, then creates the threads.

If I am right so far, I still don't understand William's explanation of the
parent process and child process loading up the Perl modules. Does the
supervisor process need to load up modperl as well, thereby giving the
1,2,1,2 result (for restart_count() ) in my test?

Also, how does it generate the 3,1,2 in my server restart test (I have
quoted the codes below)? Does this mean that in a restart, the supervisor
process reloads modperl, then creates the worker process, which loads up and
restarts once?

Let me know if I don't make any sense...thanks.

- Original Message - 
From: "Randy Kobes" <[EMAIL PROTECTED]>
To: "Foo Ji-Haw" <[EMAIL PROTECTED]>
Cc: "William A. Rowe, Jr." <[EMAIL PROTECTED]>; 
Sent: Wednesday, January 18, 2006 11:56 AM
Subject: Re: restart_count() on Win32


> On Wed, 18 Jan 2006, Foo Ji-Haw wrote:
>
> > Hello William,
> >
> > Thanks for the insight into the inner workings of mp2 on Win32. I'd like
to
> > read up more on the parent-child setup, and digging through
perl.apache.org
> > (mostly in http://perl.apache.org/docs/2.0/) I don't seem to be able to
get
> > any information on mp2 on Win32.
> >
> > Can you share your source of information on this issue? Thanks.
>
> You may want to check out
>   http://f-m-c.org/projects/apache/html/4_3Multitasking_server.html
> for a basic discussion.
>
> -- 
> best regards,
> randy kobes
>

Quote from my ealier mail:
In my httpd.conf:
PerlModule startup

in startup.pm:
package startup;
use strict;
use warnings;

BEGIN
{
open OUTFILE,'>debug.log';
print OUTFILE Apache2::ServerUtil::restart_count()."\n";
close OUTFILE;
}

1;

The log file shows this when Apache starts:
1
2
1
2

And the log file shows this when Apache restarts:
3
1
2



Re: restart_count() on Win32

2006-01-17 Thread Foo Ji-Haw
Thanks Randy, for the pointer. Will give it a good read.

- Original Message - 
From: "Randy Kobes" <[EMAIL PROTECTED]>
To: "Foo Ji-Haw" <[EMAIL PROTECTED]>
Cc: "William A. Rowe, Jr." <[EMAIL PROTECTED]>; 
Sent: Wednesday, January 18, 2006 11:56 AM
Subject: Re: restart_count() on Win32


> On Wed, 18 Jan 2006, Foo Ji-Haw wrote:
>
> > Hello William,
> >
> > Thanks for the insight into the inner workings of mp2 on Win32. I'd like
to
> > read up more on the parent-child setup, and digging through
perl.apache.org
> > (mostly in http://perl.apache.org/docs/2.0/) I don't seem to be able to
get
> > any information on mp2 on Win32.
> >
> > Can you share your source of information on this issue? Thanks.
>
> You may want to check out
>   http://f-m-c.org/projects/apache/html/4_3Multitasking_server.html
> for a basic discussion.
>
> -- 
> best regards,
> randy kobes



Re: restart_count() on Win32

2006-01-17 Thread Foo Ji-Haw
Hello William,

Thanks for the insight into the inner workings of mp2 on Win32. I'd like to
read up more on the parent-child setup, and digging through perl.apache.org
(mostly in http://perl.apache.org/docs/2.0/) I don't seem to be able to get
any information on mp2 on Win32.

Can you share your source of information on this issue? Thanks.

- Original Message - 
From: "William A. Rowe, Jr." <[EMAIL PROTECTED]>
To: "Foo Ji-Haw" <[EMAIL PROTECTED]>
Cc: 
Sent: Wednesday, January 18, 2006 5:01 AM
Subject: Re: restart_count() on Win32


> Foo Ji-Haw wrote:
> >
> > I am trying my luck again on this issue, which I never quite understood/
> > resolved.
> >
> > The log file shows this when Apache starts:
> > 1  (parent/healthcheck process)
> > 2  (parent/healthcheck process)
> > 1  (child/real server process)
> > 2  (child/real server process)
>
> In 1.3, the child 'owned' the logs and overwrote everthing.  2.0 uses
locking
> to allow the parent's log entries to be preserved.
>
> The win32 'parent' never serves a request.  It's resources are also not
really
> inherited by the child, so each child must 'do it's own thing' with
respect to
> fully initializing the server.
>
> > And the log file shows this when Apache restarts:
> > 3 (parent/healthcheck process)
> > 1 (child/real server process)
> > 2 (child/real server process)
>
> The parent signals the 'old child' to begin to shut down (and quit
listening
> for new connections) while it spawns up a new full blown child process,
with
> the same child behavior as you noted on first-start.



Re: Using MP2 and CPAN modules

2006-01-17 Thread Foo Ji-Haw
> > Just for curiosity how long do you think Geoff Apache1.x will be
> > maintained
>
> for a very, very long time.
According to the Yahoo! slides you gave, they are planning a shift to
Apache2.2 this year...they are side-stepping Apache2?!?

> mind you, with both apache 1.3 and mp1 it may seem like the project is a
> little stagnant, but I don't think that's the case at all - when you reach
> this level of stability you don't necessarily go mucking around with it,
> taking changes lightly.  but I think if there was a real bug discovered
> you'd see a truckload of people jumping on it.  and in that sense, I don't
> think 1.3 is going away any time soon.
I have not had much history with mp1, but from what I read, very few people
ever found the impetus to jump onto mp2. I guess the only guys who do so
are:
1. People who started learning modperl after mp2 is out
2. People who run modperl on Windows as an alternative to PerlEx.





Re: restart_count() on Win32

2006-01-17 Thread Foo Ji-Haw
Hello Tom,

Thanks for confirming for me it is a Windows Thing.

- Original Message - 
From: "Tom Schindl" <[EMAIL PROTECTED]>
To: "Foo Ji-Haw" <[EMAIL PROTECTED]>
Cc: 
Sent: Tuesday, January 17, 2006 5:43 PM
Subject: Re: restart_count() on Win32

Hi,

I gave it a try on linux:

- for start you get:
1
2

- for restart 1 you get:
3
- for restart 2 you get:
4
- for restart 3 you get:
5
- for restart 4 you get:
6

There's no difference between prefork and worker-mpm. I'm not a win32
guy so I cann't help you here.

Tom


Re: restart_count() on Win32

2006-01-17 Thread Foo Ji-Haw
Hello Tom,

Thanks for your reply. Perhaps you can help explain why I am receiving 2
'1's and 2 '2's upon Apache start (not restart). I can code to only load
stuff on restart_count() == 2, but this works only for restarts, since
starts give me 2 '2's on restart_count(). If I can figure out how to do
initialise once, I can even try to spawn threads properly.

Can anyone confirm if this is a Windows Thing, or it happens to FreeBSD/
Linux installations as well?

- Original Message - 
From: "Tom Schindl" <[EMAIL PROTECTED]>
To: "Foo Ji-Haw" <[EMAIL PROTECTED]>
Cc: 
Sent: Tuesday, January 17, 2006 5:12 PM
Subject: Re: restart_count() on Win32

Hi,

i'd say that the thing you are seening is that 3rd restart is the one
where the actually running apache is checking that a restart is possible
and else refusing to stop?

Try logging the PID's of the process trying to restart?



restart_count() on Win32

2006-01-17 Thread Foo Ji-Haw



Hello all,
 
I am trying my luck again on this issue, which I 
never quite understood/ resolved.
 
Whenever Apache starts/ restarts, it actually does 
this twice (the second time to see if it can restart properly). 
 
In my httpd.conf:
PerlModule startup
 
in startup.pm:
package startup;
use strict;
use warnings;
 
BEGIN
{
open OUTFILE,'>debug.log';
print OUTFILE 
Apache2::ServerUtil::restart_count()."\n";
close OUTFILE;
}
 
1;
 
The log file shows this when Apache 
starts:
1
2
1
2
 
And the log file shows this when Apache 
restarts:
3
1
2
 
I don't understand why I get 2 '1's and 2 '2's when 
Apache starts. According to the documentation, I should expect only 1 '1' and 1 
'2'. Similarly for restarts, the order looks wrong (the doc says to expect '1' 
'3' instead of '3' '1' and no '2').
 
Hope someone can enlighten me on this subject. 
Thanks.


Re: Where to find Apache2::PAR for Windows?

2006-01-10 Thread Foo Ji-Haw

Thanks for helping to look Philip. :)

- Original Message - 
From: "Philip M. Gollucci" <[EMAIL PROTECTED]>

To: "Foo Ji-Haw" <[EMAIL PROTECTED]>
Cc: "mod_perl List" 
Sent: Tuesday, January 10, 2006 1:14 AM
Subject: Re: Where to find Apache2::PAR for Windows?



Foo Ji-Haw wrote:

Hi all,
 
I've been using PAR and mp2. Just thought to try out Apache2::PAR, but 
realise that it does not come with the mp2 installation. Checked out 
http://www.bribes.org/perl/ppm/ but it's not there either.

Normally, I would suggest
http://theory.uwinnipeg.ca/ppms/

but I looked and its not there.

You could always make one and submit it :)


--

"Love is not the one you can picture yourself marrying,
but the one you can't picture the rest of your life without."

"It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone..."

"I wanna hold ya till I die ... I wanna hold ya till the fear in me 
subsides."


Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F


Re: Where to find Apache2::PAR for Windows?

2006-01-10 Thread Foo Ji-Haw

Hey Randy,

You're one amazing guy. Did your wife tell you that? :)

Anyway for the effort. Appreciate it. Will definately try it out.

- Original Message - 
From: "Randy Kobes" <[EMAIL PROTECTED]>

To: "Philip M. Gollucci" <[EMAIL PROTECTED]>
Cc: "Foo Ji-Haw" <[EMAIL PROTECTED]>; "mod_perl List" 


Sent: Tuesday, January 10, 2006 1:59 AM
Subject: Re: Where to find Apache2::PAR for Windows?



On Mon, 9 Jan 2006, Philip M. Gollucci wrote:


Foo Ji-Haw wrote:

Hi all,
 I've been using PAR and mp2. Just thought to try out Apache2::PAR, but 
realise that it does not come with the mp2 installation. Checked out 
http://www.bribes.org/perl/ppm/ but it's not there either.

Normally, I would suggest
http://theory.uwinnipeg.ca/ppms/

but I looked and its not there.

You could always make one and submit it :)


Normally I don't make up ppm packages based on CPAN
development packages (which Apache2-SOAP is), for
stability reasons. However, since there isn't
a non-development package for this, this wouldn't
be a problem - I just placed one up at
  http://theoryx5.uwinnipeg.ca/ppms/

--
best regards,
randy kobes 


Where to find Apache2::PAR for Windows?

2006-01-09 Thread Foo Ji-Haw



Hi all,
 
I've been using PAR and mp2. Just thought to try 
out Apache2::PAR, but realise that it does not come with the mp2 installation. 
Checked out http://www.bribes.org/perl/ppm/ but 
it's not there either.
 
Appreciate if anyone can point me in the right 
direction to the ppd repository. Thanks.


Re: Action vs Interaction

2006-01-02 Thread Foo Ji-Haw
Apologies. Sent to the wrong audience. :P


Action vs Interaction

2006-01-02 Thread Foo Ji-Haw
Quick tip from the Net:

2 different styles of expressing the same thing:

rect.moveLeft: 25 Down: 30

vs

Point p = rect.getLocation();
rect.setLocation( p.X() - 25, p.Y() + 30 );


Re: go crazy with me

2005-12-21 Thread Foo Ji-Haw
I know it's not exactly the most efficient, but will it work if we continue
with the current MPM model. The difference is that both the server and the
client use SOAP as the means of communication. When an event occurs, Apache
will delivers the event message via the client's SOAP interface. This way
there is no need to keep the connection for too long.

I am looking at an open-source messaging queue implemented in .NET
(wsmq.com). I wonder if this is equally and easily implemented in mp2.

- Original Message - 
From: "Ken Simpson" <[EMAIL PROTECTED]>
To: "Perrin Harkins" <[EMAIL PROTECTED]>
Cc: 
Sent: Thursday, December 22, 2005 2:44 AM
Subject: Re: go crazy with me


> > Okay, so you basically run two daemons -- mod_perl, and a separate
> > multiplexing one -- to handle this?  Did you investigate what would be
> > involved in changing apache to support multiplexing as an MPM?
>
> Yes -- we did look at that. The problem is that the MPM model assumes
> that the handler runs until it's finished and then dies -- i.e. in a
> single context of execution. To support an event driven model you
> would need to provide a way within the Apache API to allow the handler
> to post new event requests and return from handling without destroying
> the connection.
>
> i.e. the current Apache MPM model is:
>
>  1. Answer connection.
>  2. Call handler.
>  3. Handler runs.
>  4. Handler returns.
>  5. Disconnect.
>
> The event driven model would need to look something like this:
>
>  1. Answer connection.
>  2. Call handler.
>  3. Handler registers event callbacks on socket and returns.
>  4. ... MPM potentially answers other connections.
>... time passes ...
>  5. Event occurs on socket.
>  6. Handler callback called. Handler may register another callback...
>   ... time passes
>  7. Event occurs on socket.
>  8. Handler callback called. Handler decides the connection is over,
> and so disconnects from socket.
>  9. MPM goes on with life.
>
> TTUL
> Ken
>
> -- 
> MailChannels: Assured Messaging (TM) | http://mailchannels.com
>
> --
> Suite 203, 910 Richards St.
> Vancouver, BC, V6B 3C1, Canada
> Direct: +1-604-729-1741



Re: go crazy with me

2005-12-20 Thread Foo Ji-Haw
I usually go for the easy way out: buy more machines!

- Original Message - 
From: "Andreas J. Koenig" <[EMAIL PROTECTED]>
To: "Matt Sergeant" <[EMAIL PROTECTED]>
Cc: "Stas Bekman" <[EMAIL PROTECTED]>; "JT Smith" <[EMAIL PROTECTED]>;

Sent: Wednesday, December 21, 2005 6:25 AM
Subject: Re: go crazy with me


> > On Tue, 20 Dec 2005 09:40:43 -0500, Matt Sergeant
<[EMAIL PROTECTED]> said:
>
>   > I'm curious as to how you've mixed things up though - if the details
>   > aren't private IP I'd love to know more.
>
> Me too:-)
>
> I'd also like to hear what people are doing when the apache model has
> scaling problems. We have one problematic project here: we're a
> gateway and must server a high number of very slow customers to a high
> number of very slow feeds. Ideally we would run this in an event loop
> or in coroutines/continuations style, but we have not yet tried that
> out, mainly because so much of our infrastructure relies on everything
> being apache. Is there something in apache2 that would make our lives
> easier? (we have not yet switched to apache2 at all)
>
> -- 
> andreas



Re: Going mod_perl hourly rate?

2005-12-20 Thread Foo Ji-Haw
I think from a business perspective it's more on perceived value. If the
client does not care about the choice of language, or is more concerned
about being able to easily find freelance support, then Perl sounds like a
Bad Idea. Most business people know only about Java, .NET, and ASP.

But if the client is stuck with legacy Perl codes, then you are in luck.

My suggestion is to highlight your development experience, and how efficient
your solution is going to be. That's all they want to hear.

- Original Message - 
From: "John ORourke" <[EMAIL PROTECTED]>
To: "Chris" <[EMAIL PROTECTED]>
Cc: 
Sent: Wednesday, December 21, 2005 1:32 AM
Subject: Re: Going mod_perl hourly rate?


> I don't know what US rates are like but I'd suggest taking into account
> these:
>
>  + mod_perl is a rare skill in a world full of php 'coders'
>  + mod_perl can bring commercial benefits (cheaper hardware, faster
> sites etc)
>  - mod_perl is more expensive to maintain because it's harder to find
> people who can
>
> In my (humble) opinion the rate you can charge is more down to your
> sales skills than anything else.
>
> John
>
> Chris wrote:
>
> >Hi all,
> >
> >I have been working with mod_perl for a while now and want to start
> >expanding into doing mod_perl only contract work.
> >
> >What is the going hourly rate for projects done in mod_perl? I know
> >rates are based on overhead, etc but just want to get a general idea of
> >what people pay.
> >
> >Thanks!
> >
> >
> >
> >
> >



Re: How do I check a socket to know it is not closed?

2005-12-20 Thread Foo Ji-Haw
Have you tried syswrite()? If I read the manual right, it returns undef if
the socket is broken.

- Original Message - 
From: "Ivan Heffner" <[EMAIL PROTECTED]>
To: "David Nicol" <[EMAIL PROTECTED]>
Cc: ; "Foo Ji- [EMAIL PROTECTED]"
<[EMAIL PROTECTED]>
Sent: Wednesday, December 21, 2005 3:46 AM
Subject: Re: How do I check a socket to know it is not closed?


> No error is thrown to trap.  That's part of the problem. :-/
>
> On 12/20/05, David Nicol <[EMAIL PROTECTED]> wrote:
> > On 12/20/05, Ivan Heffner <[EMAIL PROTECTED]> wrote:
> > > pache2::Connection object.  It then reads a message from the
> > > socket (this is working correctly) and then goes off and does some
> > > work.  When the work is finished, the handler needs to make sure that
> > > the client is still listening on the other end of the socket before
> > > sending the response.
> >
> > Why?  What's wrong with trapping the error?
> >



Re: go crazy with me

2005-12-19 Thread Foo Ji-Haw
Just went to your company web site and read that you got the White Camel
award. Congrats, both on the award and your new career!

We're talking to the Director of Development here guys... :)

- Original Message - 
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "JT Smith" <[EMAIL PROTECTED]>
Cc: 
Sent: Tuesday, December 20, 2005 3:33 AM
Subject: Re: go crazy with me


> JT Smith wrote:
> > Yup, I've actually already done it that way with both
> > Parallel::ForkManager in one instance and Proc::Queue as an alternative.
> > I added in event handling with both Event and Event::Lib as seperate
> > trials. All those implementations were relatively easy to do. But the
> > question becomes, why? If everything else is running in Apache, why
> > start a seperate service to run these tasks? And again, I said I want to
> > go crazy. Let's not figure out how else we could do that (I already know
> > that), but how could we do it using Apache?
>
> Here at mailchannels.com we have first used mp2 to handle the email
> traffic shaping entirely inside mod_perl2, but the nature of our product
> is so different from serving HTTP, it just won't scale (mostly
> memory-wise, but also too many processes). We have now switched to having
> Event::Lib (over libevent) doing all the non-blocking IO and using mp2's
> protocol handler to do blocking IO (like network-bound operations). The
> performance is just amazing, hardly any memory used and we can easily
> handle a thousand concurrent connections on very low-end hardware.
>
> Switching to event based flow was a challenge, since you no longer have
> the normal logic flow. But we have written a few abstraction layers and
> now it's almost easy. We are planning to release our AsyncIO abstraction
> module on CPAN once we have some spare resources.
>
> I highly recommend Event::Lib, at least for its wonderful maintainer:
> Tassilo von Parseval, who's a great perl/C/XS expert and who is resolving
> any problems with Event::Lib almost as soon as we are posting the bug
> reports. I wish more CPAN authors were as responsive as Tassilo is :)
>
> -- 
> _
> Stas Bekman mailto:[EMAIL PROTECTED]  http://stason.org/
> MailChannels: Assured Messaging(TM) http://mailchannels.com/
> The "Practical mod_perl" book   http://modperlbook.org/
> http://perl.apache.org/ http://perl.org/ http://logilune.com/



Re: How do I check a socket to know it is not closed?

2005-12-19 Thread Foo Ji-Haw
I just asked this question elsewhere, and got a good working response. Below
is my trivialised code:

 my $BytesRead = $sock->sysread($buffer,1024);
   if (!defined($BytesRead))
   {
   print "WARNING: Connection lost!\n";
   exit;
   }

Because sysread is blocking (I don't know how to unblock it), use IO::Select
to test for data before calling sysread.

I'm working on a clean socket reading method. Write me if you've got it
before me.

- Original Message - 
From: "Ivan Heffner" <[EMAIL PROTECTED]>
To: "Philip M. Gollucci" <[EMAIL PROTECTED]>
Cc: 
Sent: Tuesday, December 20, 2005 9:10 AM
Subject: Re: How do I check a socket to know it is not closed?


> I tried that and it didn't work.  I have this code:
>
> my $len = $sock->recv($buff, $want);
>
> warn "got the message\n";
> sleep 10;
> warn "sending the response\n";
>
> my $wlen = eval { $sock->send( "I heard $buff\n" ) };
> if ($@) {
> warn "They hung up!\n";
> }
> else {
> warn "sent $wlen bytes\n";
> $sock->send( "It's been good talking to you.  Good-bye\n" );
> $sock->close();
> }
>
>
> I get the following in the log:
>
> got the message
> sending the response
> sent 13 bytes
> [Mon Dec 19 17:07:23 2005] [error] APR::Socket::send: (32) Broken pipe
> at /home/iheffner/proto/lib/ProtoConnection.pm line 55
>
> I need to know that the client app just stopped listening.  There is
> no explicit timeout on the socket.
>
> Ivan
>
> On 12/19/05, Philip M. Gollucci <[EMAIL PROTECTED]> wrote:
> > On Mon, 19 Dec 2005, Ivan Heffner wrote:
> > > Any ideas or pointers on how to do this.  Even a redirect to some
> > > (helpful) docs (Not the "Possible values: " docs) would be
> > > helpful.
> >
> > t/protocol/TestProtocol/echo_timeout.pm
> >
> >
> > 
> > "Love is not the one you can picture yourself marrying,
> > but the one you can't picture the rest of your life without."
> >
> > "It takes a minute to have a crush on someone, an hour to like someone,
> > and a day to love someone, but it takes a lifetime to forget someone..."
> >
> > Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
> > Consultant / http://p6m7g8.net/Resume/resume.shtml
> > Senior Software Engineer - TicketMaster - http://ticketmaster.com
> >
> >



Re: Re: Good mp2 books?

2005-12-15 Thread Foo Ji-Haw
All right!

- Original Message - 
From: "Allison Randal" <[EMAIL PROTECTED]>
To: "Stas Bekman" <[EMAIL PROTECTED]>
Cc: "mod_perl List" 
Sent: Friday, December 16, 2005 5:42 AM
Subject: Re: Re: Good mp2 books?


> Stas and I are working on an MP2 book, called simply "mod_perl 2.0  
> User Guide". It's based on the current user documentation, but edited  
> and expanded. If all goes well, it'll be available by the end of  
> February.
> 
> (If you'd like an early preview and have a little time, I'll be  
> looking for reviewers to comment on chapters in January.)
> 
> Allison
> 
> 
> >  Original Message 
> > Subject: Re: Good mp2 books?
> > Date: Wed, 14 Dec 2005 19:20:02 -0500
> > From: Jonathan Vanasco <[EMAIL PROTECTED]>
> > To: Peter Leonard <[EMAIL PROTECTED]>
> > CC: mod_perl List 
> > References: <[EMAIL PROTECTED]>
> >
> > Has anyone heard of someone being contracted to write a MP2 book for
> > O'reilly or another publisher?   Or are the publishers just tossing
> > money at potential authors php/mysql and rails books?
> >
> >
> > On Dec 14, 2005, at 3:27 PM, Peter Leonard wrote:
> >
> >>
> >> So I'm looking at a library update, and my shelves are tragically   
> >> thin on MP2 books.  Since an early New Year's resolution is to   
> >> start delving heavily into MP2, I'd love some recommendations on   
> >> what everyone considers to be the best MP2 books out there at the   
> >> moment?
> >
> > -- 
> > _
> > Stas Bekman mailto:[EMAIL PROTECTED]  http://stason.org/
> > MailChannels: Assured Messaging(TM) http://mailchannels.com/
> > The "Practical mod_perl" book   http://modperlbook.org/
> > http://perl.apache.org/ http://perl.org/ http://logilune.com/
> >


Re: Installing modperl with non-ActivePerl perl (eg. PXPerl)

2005-12-04 Thread Foo Ji-Haw
Thanks for the tip Randy.

- Original Message - 
From: "Randy Kobes" <[EMAIL PROTECTED]>
To: "Foo Ji-Haw" <[EMAIL PROTECTED]>
Cc: 
Sent: Sunday, December 04, 2005 11:29 PM
Subject: Re: Installing modperl with non-ActivePerl perl (eg. PXPerl)


> On Sun, 4 Dec 2005, Foo Ji-Haw wrote:
>
> > Hello all,
> >
> > I recently stumbled upon this Perl distribution called PXPerl (for
Windows). It sounds amazing, offering to compile modules directly from CPAN
(and works with 3 major free compilers).
> >
> > But I gotta ask this: I've been using ActivePerl + modperl for the
longest time. Can modperl work with PXPerl or any other distribution for the
matter? If so, how is it done? I hope it's not through (gulp) source code
compilation!
>
> As a general rule of thumb, it's a good idea to compile
> extensions with the same compiler as was used to build Perl
> (and, for mod_perl, the same compiler as was used to build
> Apache). The mod_perl ppm packages available from
> http://theoryx5.uwinnipeg.ca/ppms/ are compiled with
> VC++ 6, as that's what's used to build ActivePerl; if
> you use another compiler (even the freely available VC++ 7),
> you should compile mod_perl from the sources yourself.
>
> If you go this route and run into problems with the
> compilation, certainly post the details to this list.
>
> -- 
> best regards,
> randy kobes



Installing modperl with non-ActivePerl perl (eg. PXPerl)

2005-12-03 Thread Foo Ji-Haw



Hello all,
 
I recently stumbled upon this Perl distribution 
called PXPerl (for Windows). It sounds amazing, offering to compile modules 
directly from CPAN (and works with 3 major free compilers).
 
But I gotta ask this: I've been using ActivePerl + 
modperl for the longest time. Can modperl work with PXPerl or any other 
distribution for the matter? If so, how is it done? I hope it's not through 
(gulp) source code compilation!


Re: how to disable sending of headers? soap::lite sends its own headers

2005-11-27 Thread Foo Ji-Haw



Ok, I've figured out why PerlOptions -ParseHeaders 
does not work. It should be
PerlOptions +ParseHeaders

  - Original Message - 
  From: 
  Foo Ji-Haw 
  
  To: modperl@perl.apache.org 
  Sent: Friday, November 25, 2005 7:00 
  PM
  Subject: how to disable sending of 
  headers? soap::lite sends its own headers
  
  Hi all, I'm using Apache+MP2+Soap::Lite as a 
  service platform.
   
  One thing I notice is that my soap method returns 
  the standard headers, plus the ones that the soap generates. Below is a sample 
  of the actual response:
  Date: Fri, 25 Nov 2005 10:56:32 GMTServer: 
  Apache/2.0.52 (Win32) mod_perl/2.0.1 Perl/v5.8.6Content-Type: 
  text/xmlClient-Date: Fri, 25 Nov 2005 10:56:33 GMTClient-Peer: 
  127.0.0.1:8080Client-Response-Num: 1Client-Transfer-Encoding: 
  chunked
   
  Status: 200 OKContent-Length: 
  801Content-Type: text/xml; charset=utf-8SOAPServer: 
  SOAP::Lite/Perl/0.55
   
  
  ...
   
  Notice that there is a line between 
  'Client-Transfer-Encoding: chunked' and 'Status: 200 OK'.
   
  I tried adding PerlOptions -ParseHeaders, 
  but it does not help. Can anyone please guide me on this? Your help is much 
  appreciated. Thanks.
   
  Btw, have a nice weekend!
  


how to disable sending of headers? soap::lite sends its own headers

2005-11-25 Thread Foo Ji-Haw



Hi all, I'm using Apache+MP2+Soap::Lite as a 
service platform.
 
One thing I notice is that my soap method returns 
the standard headers, plus the ones that the soap generates. Below is a sample 
of the actual response:
Date: Fri, 25 Nov 2005 10:56:32 GMTServer: 
Apache/2.0.52 (Win32) mod_perl/2.0.1 Perl/v5.8.6Content-Type: 
text/xmlClient-Date: Fri, 25 Nov 2005 10:56:33 GMTClient-Peer: 
127.0.0.1:8080Client-Response-Num: 1Client-Transfer-Encoding: 
chunked
 
Status: 200 OKContent-Length: 
801Content-Type: text/xml; charset=utf-8SOAPServer: 
SOAP::Lite/Perl/0.55
 

...
 
Notice that there is a line between 
'Client-Transfer-Encoding: chunked' and 'Status: 200 OK'.
 
I tried adding PerlOptions -ParseHeaders, but 
it does not help. Can anyone please guide me on this? Your help is much 
appreciated. Thanks.
 
Btw, have a nice weekend!



Re: [ModPerl 2.0] Need help to start my project...

2005-11-22 Thread Foo Ji-Haw
Try perl.apache.org for the library documentation, as well as configuration
and installation tips.

- Original Message - 
From: "Rony Liemmukda" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, November 22, 2005 3:39 PM
Subject: [ModPerl 2.0] Need help to start my project...


> Hello,
>
> We have to do a project at college and  I've chosen to write an apache
> module which should handle xslt-transformation (server-side).
> Now tutorials about apache modules are a very rare as far as I see and
> although the documentation at perl.apache.org is well written I want to
know
> if my approach to solve my project with the help of Input/Output filters
> is correct or is there another (better) way ?
> It also would be nice if someone could tell me where to find a good
> tutorial about mod_perl 2.0 online ( can't find anything usable with
> google ).
> I really don't want to start this project twice because of an wrong
> beginning... ;)
>
> Thanks
>
>



mp2 - Determining restart count

2005-11-20 Thread Foo Ji-Haw



Hi all, I'd like to write a script that runs only 
once during serstart start/ restart. Below are my system specs
OS: Windows 2000 Server
Apache: 2.0.52 (Win32) mod_perl/2.0.1 
Perl/v5.8.6
 
I've read up on Apache2::ServerUtil::restart_count 
on http://perl.apache.org/docs/2.0/api/Apache2/ServerUtil.html#C_restart_count_
 
The demo shows that in a server start, only 2 calls 
are made (hence '1' and '2').
But in my copy-and-paste test, I realise that my 
log file shows
1
2
1
2
 
and a restart shows
3
1
2
 
It's like there's TWO processes instead of one. 
Is it because it's a 'windows thing'? Is there 
any other way to make sure the startup script runs only once?
 
Thanks for your help.


Re: [OT] Re: a new mod_perl problem

2005-10-18 Thread Foo Ji-Haw
I don't think closure is something that is something to avoid. When used
wisely (and perhaps with a bit of experience) it can be rather useful. I
have not used it myself, but I see the potential for it.

Thanks for the enlightenment Perrin.

- Original Message - 
From: "John ORourke" <[EMAIL PROTECTED]>
To: "Perrin Harkins" <[EMAIL PROTECTED]>
Cc: "angel flower" <[EMAIL PROTECTED]>; 
Sent: Tuesday, October 18, 2005 11:33 PM
Subject: Re: [OT] Re: a new mod_perl problem


> Perrin Harkins wrote:
>
> >
> >Good guess, but that's not what is happening here.  What our flowery
> >friend has stumbled onto is a closure.  When a subroutine references a
> >"my" variable that was declared outside of that subroutine's scope, the
> >sub will keep a private copy of that variable.  If it wasn't a closure,
> >
> >
>
> Ah, missed that bit in Perl 101... sounds like something to avoid
> anyway, thanks!
>
> John



Re: how to share data among modperl processes

2005-10-09 Thread Foo Ji-Haw
Hello Pratik,

Between yours and Michael's solutions, I think yours is a closer fit (thanks
Michael!) to my needs. According to Cache::FastMmap, I only need to
initialise the file during the PerlRequire stage in httpd.conf. Then the
rest of the scripts can just use it. Is this correct?

- Original Message - 
From: "Pratik" <[EMAIL PROTECTED]>
To: "Foo Ji-Haw" <[EMAIL PROTECTED]>
Cc: 
Sent: Sunday, October 09, 2005 10:21 PM
Subject: Re: how to share data among modperl processes


> Unless you are running the application in multiple server environment,
> http://search.cpan.org/~robm/Cache-FastMmap-1.09/ would be the best
> choice. But probably you should read up on AJAX as well. It looks like
> AJAX can help you accomplish what you are trying to do here.
>
> Thanks,
> Pratik
>
> On 10/7/05, Foo Ji-Haw <[EMAIL PROTECTED]> wrote:
> >
> > Hi all,
> >
> > I have a simple need where a process can take minutes to complete. But I
> > want to display some progress bar of sorts to the user.
> >
> > My idea is to have the handler call the local url which does the heavy
> > lifting. Something like this:
> > http://localhost/job/dojob => launches =>
> > http://localhost/job/actualjobworker
> >
> >
> > The local url will set some global hash to say that it is still working
on
> > the job. The original handler (/job/dojob) becomes a polling script to
check
> > on the global hash to see if the work is completed.
> >
> > I read from the wiki that it is possible to have a 'global' variable
where
> > all process can read/write to it. Can someone point me in the direction?
I
> > tried perl.apache.org but can't find anything there. A url should do the
> > trick.
> >
> > Thanks.
>
>
> --
> http://www.rails.info - Coming Soon !



Re: Configuration problem

2005-10-07 Thread Foo Ji-Haw



If 'LoadModule perl_module 
modules/mod_perl.so' is the only line you put in your httpd.conf, you are 
definately missing a few things. Do read up on the documentation in 
perl.apache.org for details. Snippet from the site:
 
Alias /perl/ 
/home/httpd/httpd-2.0/perl/    SetHandler 
perl-script  PerlResponseHandler 
ModPerl::Registry  PerlOptions 
+ParseHeaders  Options +ExecCGI  
 

  - Original Message - 
  From: 
  Stéphane Klein 
  To: modperl@perl.apache.org 
  Sent: Friday, October 07, 2005 7:36 
  PM
  Subject: Configuration problem
  
  
  Hi,
   
  I installed apache 2.0.54 with 
  mod_perl 2.0.1 in a debian 3.1 environment.
   
  I installed it with DSO 
  Method.
   
    % perl Makefile.PL 
  MP_APXS=/usr/local/apache2/bin/apxs
    % make && make 
  test
    % make 
  install
   
  I added the 
  directive:
   
  LoadModule perl_module 
  modules/mod_perl.so
   
  I restarted apache without any 
  error. No error un log files.
   
  When I tried to access this test 
  file (test.pl) with IE, IE asked me to download the file 
  test.pl.
   
  So I added this in my apache 
  configuration file:
   
  AddType application/x-httpd-perl 
  .pl
   
  It does not 
  work.
  Do you have an 
  idea?
   
  Regards


how to share data among modperl processes

2005-10-07 Thread Foo Ji-Haw



Hi all,
 
I have a simple need where a process can take 
minutes to complete. But I want to display some progress bar of sorts to the 
user.
 
My idea is to have the handler call the local url 
which does the heavy lifting. Something like this:
http://localhost/job/dojob => launches 
=> http://localhost/job/actualjobworker
 
 
The local url will set some global hash to say that 
it is still working on the job. The original handler (/job/dojob) becomes a 
polling script to check on the global hash to see if the work is 
completed.
 
I read from the wiki that it is possible to have a 
'global' variable where all process can read/write to it. Can someone point me 
in the direction? I tried perl.apache.org but can't find anything there. A url 
should do the trick.
 
Thanks.


Re: Looking for good MP2 reference material

2005-10-03 Thread Foo Ji-Haw
Thanks for the link. I stand corrected on the book sales then.

- Original Message - 
From: "Perrin Harkins" <[EMAIL PROTECTED]>
To: "Foo Ji-Haw" <[EMAIL PROTECTED]>
Cc: "Boysenberry Payne" <[EMAIL PROTECTED]>; "mod_perl"

Sent: Tuesday, October 04, 2005 12:56 PM
Subject: Re: Looking for good MP2 reference material


> Foo Ji-Haw wrote:
> > Ok, I did remember reading an interview with Tim O'Reilly about how he
was
> > talking about lowered sales of Perl books. But I dug the web and I can't
the
> > reference.
>
> Maybe you mean this one:
> http://www.oreilly.com/pub/a/oreilly/ask_tim/2004/perl_0707.html
>
> However, there is no mention of a sales slump in that, and the graph he
> links to there doesn't show any significant decline in sales of Perl
books.
>
> - Perrin



Re: Looking for good MP2 reference material

2005-10-03 Thread Foo Ji-Haw
> That's completely untrue.  No mod_perl development is waiting for Perl6
> in any way.
I agree on your point on mod_perl development. I am glad that it has finally
moved out of 1.999 and into its own namespace this year. I'm still
experiencing some problems with Apache2::Cookies, but that's another story
altogether. Overall MP2 is great.

> Alison Randal recently mentioned in a use.perl.org post that sales of
> O'Reilly's Perl books are up.
Ok, I did remember reading an interview with Tim O'Reilly about how he was
talking about lowered sales of Perl books. But I dug the web and I can't the
reference. So I guess I have to take that back for now.




Re: Looking for good MP2 reference material

2005-10-02 Thread Foo Ji-Haw
I know what you mean.

I have this feeling that Perl is generally 'frozen' until Perl 6 comes out.
Otherwise things must 'move along' quietly. Publishers (O' Reilly) are
complaining that Perl is not a sellout it used to be. That probably caused
the print slump as well.

- Original Message - 
From: "Boysenberry Payne" <[EMAIL PROTECTED]>
To: "mod_perl" 
Sent: Monday, October 03, 2005 12:58 AM
Subject: Re: Looking for good MP2 reference material


> I practically live there at times.
>
> What I'm looking for actually is something that will be up to date more
> when it comes to
> using perl modules with mod_perl.  I've noticed a lot of time either me
> or someone else
> mentioning examples given from Practical mod_perl, etc.  Then someone
> on the list
> will say the modules is old and there is a newer one that works better.
>
> I was hoping there was a book I could buy for when I'm not hooked up to
> the internet.
>
> Thanks,
> Boysenberry
>
> boysenberrys.com | habitatlife.com | selfgnosis.com
>
> On Oct 1, 2005, at 12:57 PM, Fred Moyer wrote:
>
> > On Sat, 1 Oct 2005 10:50 am, Boysenberry Payne wrote:
> >> Anyone know of some good apache2 mp2 related reading material that I
> >> could
> >> purchase for more up to date info than the stuff I'm getting from my
> >> old
> >> O' Reilly books?
> >
> > http://perl.apache.org/docs/2.0/index.html is free.
> >>
> >> Thanks,
> >> Boysenberry
> >>
> >> boysenberrys.com | habitatlife.com | selfgnosis.com
> >
> >



Re: Setting a module to handle the requests to /

2005-10-02 Thread Foo Ji-Haw
I would go with Frank's mod-redirect/ mod-rewrite alternative. It makes for
cleaner code. The downside though is that if your code references images in
the same directory via relative links, then you may have a problem.

- Original Message - 
From: "Frank Wiles" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>
Cc: 
Sent: Sunday, October 02, 2005 7:32 AM
Subject: Re: Setting a module to handle the requests to /


> On Sun, 2 Oct 2005 02:20:22 +0200
> "Octavian Rasnita" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > Is it possible to configure httpd.conf in such a way that when the
> > users request the / directory, that module will handle it, but if the
> > users request for a static file like /style.css for example, that
> > file is served?
> >
> > I have tried:
> >
> > 
> > SetHandler perl-script
> > PerlResponseHandler Foo::Bar
> > 
> >
> > If the dir / is requested, it is all right. If... for example /baz is
> > requested, and another perl module is set to handle the requests
> > to /baz, that module handles it, so it is all right in that case too,
> > but if a certain static file like .css or image file are requested,
> > they are not showed.
>
>   Well the easiest way to handle this is to put your modules on
>   something other than slash.  Have a redirect for / to /mymodule/,
>   and then you can put static content ( css, etc. ) into say /css/
>   and all will be well.
>
>   The other solution is to have your handler detect that the incoming
>   request is for static content and return Apache2::Const::DECLINED
>   which should pass control back to the normal static file processing
>   in Apache.
>
>   Hope this helps.
>
>  -
>Frank Wiles <[EMAIL PROTECTED]>
>http://www.wiles.org
>  -
>



Re: Setting a module to handle the requests to /

2005-10-02 Thread Foo Ji-Haw
>   The other solution is to have your handler detect that the incoming
>   request is for static content and return Apache2::Const::DECLINED
>   which should pass control back to the normal static file processing
>   in Apache.
I didn't know about DECLINED passing control back to normal flow. That's
cool man.

- Original Message - 
From: "Frank Wiles" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>
Cc: 
Sent: Sunday, October 02, 2005 7:32 AM
Subject: Re: Setting a module to handle the requests to /


> On Sun, 2 Oct 2005 02:20:22 +0200
> "Octavian Rasnita" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > Is it possible to configure httpd.conf in such a way that when the
> > users request the / directory, that module will handle it, but if the
> > users request for a static file like /style.css for example, that
> > file is served?
> >
> > I have tried:
> >
> > 
> > SetHandler perl-script
> > PerlResponseHandler Foo::Bar
> > 
> >
> > If the dir / is requested, it is all right. If... for example /baz is
> > requested, and another perl module is set to handle the requests
> > to /baz, that module handles it, so it is all right in that case too,
> > but if a certain static file like .css or image file are requested,
> > they are not showed.
>
>   Well the easiest way to handle this is to put your modules on
>   something other than slash.  Have a redirect for / to /mymodule/,
>   and then you can put static content ( css, etc. ) into say /css/
>   and all will be well.
>
>   The other solution is to have your handler detect that the incoming
>   request is for static content and return Apache2::Const::DECLINED
>   which should pass control back to the normal static file processing
>   in Apache.
>
>   Hope this helps.
>
>  -
>Frank Wiles <[EMAIL PROTECTED]>
>http://www.wiles.org
>  -



Re: Apache2::SOAP newbie

2005-09-23 Thread Foo Ji-Haw



Do they have a SOAP::Lite::Simple::Java as 
well?
 

  - Original Message - 
  From: 
  Leo Lapworth 
  
  To: John ORourke 
  Cc: mod_perl Mailing List 
  Sent: Friday, September 23, 2005 4:06 
  PM
  Subject: Re: Apache2::SOAP newbie
  
  
  On 23 Sep 2005, at 08:44, John ORourke wrote:
  
I've now got my Apache2::SOAP-based server talking 
with C#.NET clients, and auto-generating the WSDL using Pod::WSDL when they 
call http://url?wsdl, which is 
  nice!
  Probably not relevant for you 
  atm - but check out SOAP::Lite::Simple - and 
  SOAP::Lite::Simple::DotNet,
  this is a client - not server 
  - but might be of some use.
  
  Cheers
  
  Leo
  


Re: Apache2::SOAP newbie

2005-09-22 Thread Foo Ji-Haw
Yes, you need to do a bit of 'massaging' of the output SOAP XML to make the
.NET server happy. Most of the simple function calls may not work, so you
have to do a bit of a runaround instead. Let me know if you need some
examples.

- Original Message - 
From: "Kurt Hansen" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, September 22, 2005 9:07 PM
Subject: Re: Apache2::SOAP newbie


> John ORourke wrote:
>
> > A little OT, but has anyone got any experience or examples that use
> > Apache2::SOAP or some other means to create a mod_perl SOAP server?
> >
> > I'm rushing headlong into SOAP development and (as one does) tackled
> > something nice and big for my first project - a Perl SOAP server that
> > receives and sends MS .NET DataSet objects as parameters!
>
> Hi John,
>
> I recently got a SOAP::Lite client running and had some problems when
> communicating with a .NET server. The .NET server did not take too
> kindly to the XML SOAP::Lite was producing. Not sure if there was some
> standard being violated -- though I'd bet the violator is in Redmond, WA
> if there is one --, but I found the following article helpful:
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsoap/html/soapliteperl.asp
>
> The issue was with two things. One, I had to do something to "on_action"
> as noted below. The article has a different solution. Two, the Windows
> server did not like the XML that SOAP::Lite produced. Specifically, it
> was the data that the Windows server could not read. SOAP::Lite produced
>   XML that added a namespX: at the front of the data tag, e.g.
>
> data
>
> while the Windows server expected:
>
> data
>
> Strangely enough, I can't re-create what was going wrong right now so
> what you see above is partially from memory.
>
> I implemented the suggestions in the above article and it started working.
>
> Take care,
>
> Kurt Hansen
> [EMAIL PROTECTED]



'PL_memory_wrap' error when using PAR + 5.8.7

2005-09-21 Thread Foo Ji-Haw



Hi all,
 
I wonder if you have the same problem as me when 
trying to use PAR to create a standalone .EXE program. I'm using the latest PAR 
with ActiveState perl 5.8.7.
 
When I try to run the .EXE program, a dialog box 
pops out and show m the 'PL_memory_wrap' error. I've just upgraded my Perl from 
5.8.6 (which was error-free), so I don't know if it's to do with the PAR or the 
Perl base.
 
Any experience on this matter is appreciated. 
Thanks.


Creating multiple Win32::OLE instances (Outlook.Application)

2005-09-20 Thread Foo Ji-Haw



Hi all,
 
I am trying to see if mp2 is able to support 
modules that create Win32::OLE objects, process it, then destroy 
them.
 
I have a very simple script to try this 
task:
use strict;use warnings;use Apache2::Const 
-compile => qw(FORBIDDEN OK);use Apache2::RequestRec;use 
Apache2::Request;use Win32::OLE;BEGIN{ Win32::OLE-> 
Initialize(Win32::OLE::COINIT_MULTITHREADED);}use 
Win32::OLE::Variant;use Win32::OLE::Const 'Microsoft Outlook';
 
sub handler{ my $r = 
shift;  my $outlook = 
Win32::OLE->new('Outlook.Application'); $outlook->Uninitialize; print 
"Hello world!!";    return 
Apache2::Const::OK;}
 
1;
 
Unfortunately, the page hung. I've tried reading up 
on other people's responses, but it's all very vague to me as to whether this is 
actually possible. By the way, it works well from the command line (after taking 
out the MP2 overheads).
 
If you have any ideas how to get this working, 
please let me know! Thanks!


Apache2::Cookie bug, or just my misinterpretation?

2005-09-18 Thread Foo Ji-Haw



Hello all,
 
I am using the following setup:
Apache/2.0.52 (Win32) mod_apreq2-20050712/2.1.3-dev 
mod_perl/2.0.1 Perl/v5.8.7
 
I get the request cookie names like 
this:
my $jar = 
Apache2::Cookie::Jar->new($r);
my @keys = $jar->cookies();
 
I notice that the @keys list includes not just the 
cookie names, but also the name=value pair as well. That means the following 
does NOT work:
foreach my $key (@keys)
{
    print "$key\n";

#    print "$key : 
".$jar->cookies($key)->value."\n";}
 
Because I will end up with (pseudo):
cookie1=value1 : 
cookie1 :
cookie2 : 
cookie2=value2 :
...
 
Is this a Apache2::Cookie bug, an old library that 
I am using, or did I read the docs wrongly?


Re: Do I need Apache2::RequestUtil::request( )?

2005-09-14 Thread Foo Ji-Haw



There's not much changes to mp2, from your usage 
angle.
In mp1, you use Apache::Request
In mp2, the module is now called 
Apache2::RequestUtil. But it has generally the same methods as its mp1 
equivalent, including ->request(). 
 
You get the Apache2::RequestUtil the same way as in 
mp1:
sub handler
{
  my $r = shift;
  ...
}
 
 
You should also consider using Apache2::Request as 
a replacement for CGI:
 
my $request = 
Apache2::Request->new($r);
print $request->param('paramkey');
 
The 'preferred way' to set content type is 
simply:
$r->content_type('text/html');
 
Hope this helps.
 

  - Original Message - 
  From: 
  Justin Luster 
  To: 'mod_perl List' 
  Sent: Thursday, September 15, 2005 12:17 
  AM
  Subject: Do I need 
  Apache2::RequestUtil::request( )?
  
  
  Hi,
   
  I'm still struggling with trying 
  to understand how Mod_Perl 2 works.  All I want to do is to have a 
  regular Perl script run under Mod_Perl just to speed it up.
   
  In the past, in Mod_Perl 1 I’ve 
  used this:
   
  sub PrintHeader 
  {
  if ($ENV{'PERL_SEND_HEADER'}) 
  
  {
      
      print 
  "Content-type: text/html\r\n\r\n";
  }
  else
  {
      
  my $r = Apache->request;
      
  $r->content_type('text/html');
      
  $r->send_http_header;
  }
  }
   
  I then read the documentation 
  where it says:
   
  Apache->request has been 
  replaced with Apache2::RequestUtil::request( ).  
   
  There is also some other 
  documentation in that section that I don’t quite understand.  In testing 
  and messing around with this in Mod_Perl 2 I’ve noticed that the simple 
  
   
  print "Content-type: 
  text/html\r\n\r\n";
   
  just works.  My Apache 
  configuration looks like this:
   
  
      
  Options ExecCGI
      
  AddHandler cgi-script .pl
      
  AddHandler cgi-script .cgi
   
  #For ModPerl Only
      
  
      
  
      
  SetHandler perl-script
      
  PerlResponseHandler ModPerl::Registry
      
  Options ExecCGI
      
  allow from all
      
  PerlOptions +ParseHeaders
      
  
      
  
  
   
  I’m thrilled if:
   
  print "Content-type: 
  text/html\r\n\r\n";
   
  just works.  But I want to make sure I understand 
  it and that it is OK before releasing this.
   
  I’m just using ModPerl::Registry to speed regular Perl 
  CGI scripts up.  The code needs to work with regular CGI, Mod_Perl 1, 
  Mod_Perl 1.99, and Mod_Perl 2.
   
  And by the way $ENV{'PERL_SEND_HEADER'} does not 
  seem to exist any more.  Is this not available in Mod_Perl 2?  
  
  How do detect:
   
  PerlOptions 
  -ParseHeaders?
   
  Thanks for your 
  help,
   
  Justin


Re: Why does my MP2 crash intermittently?

2005-09-13 Thread Foo Ji-Haw
Hello Stephane,

Do you think that will make a difference? I am now running an instance of
the application on a W2K3 server. If it is stable there, then I will have to
disown W2K and set W2K3 as the baseline OS.

Maybe I will test on XP too, but since it is a server app, putting XP
support may not look nice. :)

- Original Message - 
From: "Stephane GUIBOUD-RIBAUD" <[EMAIL PROTECTED]>
To: "Foo Ji-Haw" <[EMAIL PROTECTED]>
Cc: 
Sent: Tuesday, September 13, 2005 5:21 PM
Subject: Re: Why does my MP2 crash intermittently?


> Foo Ji-Haw wrote:
>
> > Hello Nikolay,
> >
> > You mean you didn't use the ActivePerl distribution? You do this to
> > avoid the OEM licensing issue?
> > I am using the standard ActivePerl 5.8.7, with MP2.0.1 and Apache
> > 2.0.52. I hope this is not the cause of the problem.
>
> Did you try to upgrade to 2.0.54 ?
> I have a pretty similar configuration as you except that I'm running
> apache on Windows XP (SP1) and apache 2.0.53 (not upgraded now to 2.0.54).
>
> Stephane
>
> -- 
> Stéphane GUIBOUD-RIBAUDSTMicroelectronics
> HPC/PMG/AP3  Grenoble
> Tel.: +33 (4) 76 585 246   TINA: 041 5246
>
>



Re: Why does my MP2 crash intermittently?

2005-09-13 Thread Foo Ji-Haw




Hello Nikolay,
 
You mean you didn't use the ActivePerl distribution? You do this to avoid 
the OEM licensing issue?
I am using the standard ActivePerl 5.8.7, with MP2.0.1 and Apache 2.0.52. I 
hope this is not the cause of the problem.
 
"Nikolay Ananiev" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]...> 
> Hello,> I had a similar problem with mp2 on windows. I was using 
Visual Studio .NET> 2002 to compile mod_perl and this> was the 
source of all evil. A bug in .NET.> I had to download service pack 1 for 
.NET 2002 from microsoft.com and> recompile mod_perl.> > If 
this doesn't help you should supply a backtrace. (I hope you have visual> 
studio?)> > First read this> http://perl.apache.org/docs/2.0/devel/debug/c.html#Analyzing_Dumped_Core_Files> 
then recompile your perl, apache and mod_perl with the debbuging flags.> 
Then start your visual studio.> Start your apache server and wait for the 
bad message window to appear> again,> and when it happens, click 
Cancel. A new window should> show up asking you whether to use VS to 
debbug the application - click OK.> Check "Native" for the "Program type 
to debug".> If the call stack doesn't appear go to 
Debug->Windows->Call Stack.> Then copy the stack and paste it 
here.> It should be something like this:> >   
USER32.DLL!77e41706()>   perl58.dll!win32_msgwait(interpreter * 
my_perl=0x01a43a64, unsigned long> count=0, void * * handles=0x, 
unsigned long timeout=30, unsigned> long * resultp=0x)  
Line 1950 + 0x18 C>   perl58.dll!win32_sleep(unsigned int 
t=300)  Line 2135 + 0x16 C>   
perl58.dll!PerlProcSleep(IPerlProc * piPerl=0x015d2780, unsigned int> 
s=300)  Line 1656 + 0x9 C++>   
perl58.dll!Perl_pp_sleep(interpreter * my_perl=0x01a43a64)  Line 4535 
+> 0xb C> > > >"Foo Ji-Haw" <[EMAIL PROTECTED]> wrote in 
message> news:[EMAIL PROTECTED]...> 
>Hello all,> >> >I have set up my MP2 application, which 
in the course of development has> been reasonably stable. But when I put 
it under reasonably load (I have a> daemon with >5 threads that call 
it periodically, and I browse around the> pages with 2 other collegues), 
sometimes I get this error (see attached for> the actually 
screenshot):> >The instruction at "0x280877f1" referenced memory at 
"0x515ee28". The> memory coudl not be "read".> >> 
>The application basically freezes at this point. Clicking on the OK 
button> seems to bring MP2 back to operations immediately. Looking at the 
log,> Apache seems to have restarted.> >> >This is 
very annoying, as my app is generally ready to go, but intermittent> 
errors like this makes it otherwise. Nothing else is capture in the log, 
so> I don't know >where to go to discover the culprit.> 
>> >Can anyone please advise me on this? Appreciate it!> 
> 


Re: Why does my MP2 crash intermittently?

2005-09-13 Thread Foo Ji-Haw
Hello Stephane,

I've had a good tip from Mike (thanks Mike!) that the problem is Windows
related. Check out http://support.microsoft.com/?kbid=262490 for details.

Although they claimed that it is a pre-SP1 problem, I'm running SP4 on W2K
and I'm still seeing it. Will try the same setup on W2K3 and see if the
problem persists.

My situation seems to be worse than yours. I have the following already in
my httpd.conf:
PerlModule Apache2::Reload
PerlInitHandler Apache2::Reload

But it did not change anything.

- Original Message - 
From: "Stephane GUIBOUD-RIBAUD" <[EMAIL PROTECTED]>
To: "Foo Ji-Haw" <[EMAIL PROTECTED]>
Cc: 
Sent: Tuesday, September 13, 2005 3:45 PM
Subject: Re: Why does my MP2 crash intermittently?


> I had the same problem. The only way to solve it was to use the
> Apache2::Reload module. By using this module, the apache that crashed is
> killed and a new process is started immediately. However, this not solve
> the real problem but the popup is not displayed.
>
> Moreover, I'm using Apache 2.0.54 and mod_perl 2.0.1 (precompiled
> version) on Windows XP and I had a lot of memory leak problem with the
> Apache::ASP module. This module causes also an internal server error
> when the cleanup_register handlers is called: it seems that Apache::ASP
> has detected mod_perl 2 at startup and went back to mod_perl 1 at
> sometime so he didn't call the right handler. Have you check your
> error_log ?
>
> Foo Ji-Haw wrote:
>
> > Hello all,
> >
> > I have set up my MP2 application, which in the course of development
> > has been reasonably stable. But when I put it under reasonably load (I
> > have a daemon with 5 threads that call it periodically, and I browse
> > around the pages with 2 other collegues), sometimes I get this error
> > (see attached for the actually screenshot):
> > The instruction at "0x280877f1" referenced memory at "0x515ee28". The
> > memory coudl not be "read".
> >
> > The application basically freezes at this point. Clicking on the OK
> > button seems to bring MP2 back to operations immediately. Looking at
> > the log, Apache seems to have restarted.
> >
> > This is very annoying, as my app is generally ready to go, but
> > intermittent errors like this makes it otherwise. Nothing else is
> > capture in the log, so I don't know where to go to discover the culprit.
> >
> > Can anyone please advise me on this? Appreciate it!
>
> -- 
> Stéphane GUIBOUD-RIBAUDSTMicroelectronics
> HPC/PMG/AP3  Grenoble
> Tel.: +33 (4) 76 585 246   TINA: 041 5246
>
>



Re: Why does my MP2 crash intermittently?

2005-09-12 Thread Foo Ji-Haw



Hello Mike,
 
You are right. I automatically assumed that this is 
a MP2 problem, when actually it is a Windows issue!
 
The strange thing is, that I'm already running on 
SP4 of Windows 2000. This problem should have been resolved by then. It is true 
that I do load lots of stuff via a db call. But normal contiguous calls to the 
page does not return errors; the error seems to be quite 
unpredictable.
 
I wonder if the problem will go away in Windows 
2003...
 
Did anyone else face this issue as well? Or is it 
just me?

  - Original Message - 
  From: 
  Mike OK 

  To: Foo Ji-Haw ; modperl@perl.apache.org 
  Sent: Tuesday, September 13, 2005 11:04 
  AM
  Subject: Re: Why does my MP2 crash 
  intermittently?
  
  Hi
   
      Looks like you should have done a Google 
  search.  The problem looks to be an operating system error.  
  Here is a quote from the Microsoft Knowledge base (http://support.microsoft.com/?kbid=262490) 
  
  "This behavior occurs because the operating system does not 
  allocate a large enough buffer for the maximum string length permitted. When 
  the data is greater than the buffer size, the Winlogon service terminates 
  abnormally and your computer generates the error message. "
   
  Gotta love Microsoft eh???  Mike
  
- Original Message - 
    From: 
    Foo 
Ji-Haw 
To: modperl@perl.apache.org 
Sent: September 12, 2005 10:51 PM
Subject: Why does my MP2 crash 
intermittently?

Hello all,
 
I have set up my MP2 application, which in the 
course of development has been reasonably stable. But when I put it under 
reasonably load (I have a daemon with 5 threads that call it periodically, 
and I browse around the pages with 2 other collegues), sometimes I get this 
error (see attached for the actually screenshot):
The instruction at "0x280877f1" referenced 
memory at "0x515ee28". The memory coudl not be "read".
 
The application basically freezes at this 
point. Clicking on the OK button seems to bring MP2 back to operations 
immediately. Looking at the log, Apache seems to have 
restarted.
 
This is very annoying, as my app is generally 
ready to go, but intermittent errors like this makes it otherwise. Nothing 
else is capture in the log, so I don't know where to go to discover the 
culprit.
 
Can anyone please advise me on this? Appreciate 
it!



No virus found in this incoming message.Checked by AVG 
Anti-Virus.Version: 7.0.344 / Virus Database: 267.10.21/96 - Release 
Date: 2005-09-10


Why does my MP2 crash intermittently?

2005-09-12 Thread Foo Ji-Haw



Hello all,
 
I have set up my MP2 application, which in the 
course of development has been reasonably stable. But when I put it under 
reasonably load (I have a daemon with 5 threads that call it periodically, and I 
browse around the pages with 2 other collegues), sometimes I get this error (see 
attached for the actually screenshot):
The instruction at "0x280877f1" referenced 
memory at "0x515ee28". The memory coudl not be "read".
 
The application basically freezes at this point. 
Clicking on the OK button seems to bring MP2 back to operations immediately. 
Looking at the log, Apache seems to have restarted.
 
This is very annoying, as my app is generally ready 
to go, but intermittent errors like this makes it otherwise. Nothing else is 
capture in the log, so I don't know where to go to discover the 
culprit.
 
Can anyone please advise me on this? Appreciate 
it!


apache-error.gif
Description: GIF image


Re: a faster html::template?

2005-09-09 Thread Foo Ji-Haw
Hello Perrin,

I meant the time it takes to render the output, as in calling
$template->output;

Thanks for your help anyway.

- Original Message - 
From: "Perrin Harkins" <[EMAIL PROTECTED]>
To: "Foo Ji-Haw" <[EMAIL PROTECTED]>
Cc: 
Sent: Tuesday, September 06, 2005 11:39 PM
Subject: Re: a faster html::template?


> On Fri, 2005-09-02 at 10:53 +0800, Foo Ji-Haw wrote:
> > I'm a happy user of HTML::Template on my mp2 setup. But when it comes
> > to performance, I notice that to populate a loop of some 1500 records,
> > the system takes 2-3 seconds on my P4 2GHz machine.
>
> Populating the loop happens before running HTML::Template.  Are you
> saying that your code to set up the data is too slow, or that running
> HTML::Template after setting up the data is too slow?
>
> > I tried to load the template with 'cache=>1', but the performance
> > improvement is not much.
>
> It makes a big difference in the actual template processing speed.  It
> will not make any difference in the speed of setting up your data
> though.
>
> - Perrin
>
>



Re: a faster html::template?

2005-09-07 Thread Foo Ji-Haw
I would think that HTML::Template is faster, for the simple argument that it
does not need to parse the XSLT and XHTML, though the library may be
C-compiled.

- Original Message - 
From: "Perrin Harkins" <[EMAIL PROTECTED]>
To: "Praveen Ray" <[EMAIL PROTECTED]>
Cc: 
Sent: Tuesday, September 06, 2005 11:37 PM
Subject: Re: a faster html::template?


> On Mon, 2005-09-05 at 06:42 -0700, Praveen Ray wrote:
> > XSLT transforms are VERY fast
>
> Compared to what?  Certainly not compared to HTML::Template.
>
> - Perrin



Re: a faster html::template?

2005-09-04 Thread Foo Ji-Haw
I notice something an interesting behavior about HTML template.

The delay is usually within loops, especially if you have a big record list
(like 1500). If the text within the loop is huge (ie lots of text), then the
loop can take a really long time. But for very short loops it can be very
fast.

Running it by a cache (cache=>1) seems to make the NEXT interation faster
though. But the first one is always slow.

- Original Message - 
From: "David Hodgkinson" <[EMAIL PROTECTED]>
To: "Foo Ji-Haw" <[EMAIL PROTECTED]>
Cc: 
Sent: Monday, September 05, 2005 5:50 AM
Subject: Re: a faster html::template?


>
> On 2 Sep 2005, at 03:53, Foo Ji-Haw wrote:
>
> > Hi all,
> >
> > I'm a happy user of HTML::Template on my mp2 setup. But when it
> > comes to performance, I notice that to populate a loop of some 1500
> > records, the system takes 2-3 seconds on my P4 2GHz machine. I
> > think that's way too long, especially on a development machine.
> >
> > I tried to load the template with 'cache=>1', but the performance
> > improvement is not much. I hear some talk on the newsgroup about
> > HTML::Template::JIT. Is there anyone who has optimised on a 1000+
> > record loop in HTML::Template? I am a strong believer in templating
> > engines, and I think reverting to embedded code should be avoided
> > at best.
> >
>
> 1500 record? don't do it: page or use AJAX.
>
> Been there. It was horrible.
>



a faster html::template?

2005-09-04 Thread Foo Ji-Haw



Hi all,
 
I'm a happy user of HTML::Template on my mp2 setup. 
But when it comes to performance, I notice that to populate a loop of some 1500 
records, the system takes 2-3 seconds on my P4 2GHz machine. I think that's way 
too long, especially on a development machine.
 
I tried to load the template with 'cache=>1', 
but the performance improvement is not much. I hear some talk on the newsgroup 
about HTML::Template::JIT. Is there anyone who has optimised on a 1000+ record 
loop in HTML::Template? I am a strong believer in templating engines, and I 
think reverting to embedded code should be avoided at best.
 
Thanks.


apache+mod_perl on Windows fails ungracefully?

2005-08-30 Thread Foo Ji-Haw



Hi all,
 
I have a small setup development setup on a Windows 
2000 Server+Apache 2+ActivePerl 5.8.6+mod_perl 2.0.1. With a setting of 5 
threads per child.
 
I have 3 external clients hitting the server 
simultaneously doing batch SOAP calls, plus my local web browser which I browse 
around my mp2 site looking at the SOAP call statistics as they happen. Once in a 
while, Apache will cause a dialog box with the message (attached):
The instruction at "0x2808771f1" referenced memory 
at "0x318e0c0". The memory could not be "read".
 
Looking at the Apache error log, I get this 
message:
[warn] Server ran out of threads to serve requests. 
Consider raising the ThreadsPerChild setting
 
The good news is that after clicking away the 
dialog box, Apache is back up on its own. 
 
Question is, why must the dialog box pop up? This 
is a bad thing, as it causes my web applications to hang until someone comes 
along to close the dialog box. Evidently, Apache is capable of restarting when 
it is under load (not difficult when you have only 5 threads). I have 
created some 3-4 mp2 apps and they all display the dialog box when under load. 

 
Perhaps I missed out something here. Can anyone 
enlighten me on this? Thanks.


error.gif
Description: GIF image


Re: mod_perl2 and PHP

2005-08-07 Thread Foo Ji-Haw
I agree with Eric. I love SOAP for the same reasons. You can argue until 
the cow comes home and there will still be PHP lovers and Perl lovers 
(and some .NETters as well). Diversity is important. But creating a 
happy unity is key.


Eric wrote:


At 10:07 AM 8/6/2005, Tony Clayton wrote:


Quoting Thomas Klausner <[EMAIL PROTECTED]>:

> Hi!
>
> Is it possible and advisable to write the complex part of an
> application
> (the Controller, if you like) in mod_perl2 and use PHP as a frontend
> (or
> View) ?

It should be possible, perhaps by calling php from apache subrequests
in
the mod_perl code, but it won't be efficient, and doesn't sound very
pratical.
As an alternative, you might be able to use SOAP/RPC requests in the
PHP
code to offload the backend work to a mod_perl SOAP/RPC server.  Again,
not very efficient or practical.



I don't agree. Ok, sure there is some loss in performance(I choose 
XML-RPC because it is lightweight next to SOAP IMHO), but I did 
something very much like this for "social" reasons. Our bosses and 
many of our lower end people only know PHP. I had also to adopt to 
some affiliate system code that was and would likely forever be 
written in PHP. The solution was to use XML-RPC with PHP being the 
client and mod_perl/apache being the server. It is not that efficient 
in comparison to a pure mod_perl setup or even a pure PHP system for 
that matter. But it does end up being very scaleable because many PHP 
servers can be handled by one mod_perl backend. And it allows all of 
the presentation to be handled in PHP/Smarty by the people who know 
how to do that. While at the same time all of the code is in hopefully 
fairly clean oop Perl. :) It has turned out to be a great compromise 
for us.


The best technical answer is not always the best answer.

Thanks,

Eric







Lead Programmer
D.M. Contact Management
250.383.8267 ext 229




Re: Bareword "Apache::OK" not allowed while "strict subs" in use

2005-06-28 Thread Foo Ji-Haw

Try:
return Apache2::Const::OK;

;)

Ronni wrote:

I have spent many days now searching through the archives and although 
they are close to what I am seeing none are exactly like what I have.


I am using Apache 2 and installing ModPerl 2 on a Linux Mandrake 10.1 
box.  Apache 2 is a recent install and ModPerl 2 is something I would 
like to get working soon.


I can run perl from cgi-bin but would like to keep the perl stuff in 
it's own directory.  I've set this up numerous times using the ModPerl 
online documentation as well as all the Apache/ModPerl info I can find.


I've added the following to the httpd.conf file:

PerlModule Apache2 ##This allows perl 
-V to look in /Apache2/ under the perl install
 Alias /perl/ /usr/local/apache2/perl/ ##The directory I would 
like to keep the perl scripts

 
 SetHandler perl-script
 PerlResponseHandler ModPerl::Registry
 PerlOptions +ParseHeaders
 PerlOptions -GlobalRequest
 Options +ExecCGI
 

The log file shows the following at apache startup:

   [Tue Jun 28 08:42:59 2005] [notice] Apache/2.0.54 (Unix) 
mod_perl/2.0.1 Perl/v5.8.5 configured --   resuming normal 
operations



So it appears that everything is fine.
Then when I use an address like the following:

   http://localhost/perl/rock.pl

with the following in rock.pl

  #!/usr/bin/perl

 print "Content-type: text/plain\n\n";
 print "mod_perl 2.0 rocks!\n";

I get an Internal Server Error page with the following in the error_log:

   [Tue Jun 28 13:00:31 2005] [error] [client 127.0.0.1] failed to 
resolve handler `ModPerl::Registry':   Bareword "Apache::OK" 
not allowed while "strict subs" in use at
   
/usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Apache2/ModPerl/RegistryCooker.pm 
line
   160.\nBareword "Apache::OK" not allowed while "strict subs" in 
use at
   
/usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Apache2/ModPerl/RegistryCooker.pm 
line
   162.\nBareword "Apache::OK" not allowed while "strict subs" in 
use at
   
/usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Apache2/ModPerl/RegistryCooker.pm 
line

   170.\nBEGIN not safe after errors--compilation aborted at
   
/usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Apache2/ModPerl/RegistryCooker.pm 
line
   200.\nCompilation failed in require at (eval 4) line 
3.\n\t...propagated at /usr/lib/perl5/5.8.5/base.pm line

   85.\nBEGIN failed--compilation aborted at
   
/usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Apache2/ModPerl/Registry.pm 
line

   25.\nCompilation failed in require at (eval 3) line 3.\n

Have I lost my mind?  I'm new to modperl.  Thanks in advance for any 
help that you would be able to offer!  Trust me!  It is GREATLY 
appreciated!


Thanks!
Ronni



Re: [mp2] A better way to set the Expire header

2005-06-22 Thread Foo Ji-Haw

Hello Perrin,

Thanks for the tip. I am just surprised that setting dynamic pages to 
expire immdiately is not a common line in the code for developers. Don't 
we want them (pages) to expire immediately, instead of worrying whether 
the browser will cache the page? Or am I missing something here?



Perrin Harkins wrote:


On Thu, 2005-06-23 at 12:16 +0800, Foo Ji-Haw wrote:
 


$r->headers_out->add('Expires'=>CGI::Util::expires('now','http'));

Notice that I have to 'use CGI::Util' to set this to work. CGI::Util 
does not expose the function, but it seems to work quite well.


I am sure there is a better way to do this via perhaps 
Apache::RequestRec. But I can't seem to find it. Any pointers for me?
   



Sounds like you want Apache2::Util::ht_time:
http://perl.apache.org/docs/2.0/api/Apache2/Util.html

- Perrin

 



  1   2   >