Re: mod_perl on win32

2009-08-26 Thread Foo JH

I'd suggest to get your mp2 up with the following stack:
Apache22 Windows binary
ActivePerl binary
precompiled mod_perl2 + libapreq2 from the repo

Michiel Beijen wrote:

Hi all,

I'd like to know if it's possible to build mod_perl on Win32; I'd like
to use mod_perl with StrawberryPerl. It seems to be that the only way
that could be done is to compile Apache also with MinGW, and that's not
possible because of limited support for Windows Shared Memory in MinGW.

Also if you'd try to compile mod_perl it will try to run "./configure"
on the Apache sources but that will fail on Win32 because 1. there is no
Configure in the win32 Apache sources and 2. Windows will try to execute
"." which is not exactly an executable file...

Does anyone have pointers or tips?

Thanks in advance,
  




[mp2] Apache2::Reload missing in FreeBSD ports

2009-09-03 Thread Foo JH

Hello guys,

I'm wondering if there is any1 using FreeBSD + Apache2 + mp2. In short: 
there's no Apache2::Reload.


I browsed around the web (in particular 
http://www.mail-archive.com/d...@perl.apache.org/msg12048.html) , and 
apparently I'm not the only one who noticed it. People mention 
Apache::Reload, but on my FBSD7.2:


1. Installing p5-Apache-Reload over package (at v0.07) throw out:
Can't locate object method "dir_config" via package 
"Apache2::RequestRec" at 
/usr/local/lib/perl5/site_perl/5.8.8/Apache/Reload.pm line 51.


2. I can't install p5-Apache-Reload over ports, as it will complain it 
expects Apache 1.3.


Any advice will be appreciated.

Thanks.


Re: [mp2] Apache2::Reload missing in FreeBSD ports

2009-09-03 Thread Foo JH

Thanks Craig,

I installed Apache::Reload via CPAN, and that shows up in my pkg_info as:
bsdpan-Apache2-Reload-0.10

Interestingly they installed Apache2::Reload for me. So far it looks good.




cr...@animalhead.com wrote:

I run FreeBSD + Apache2 + mp2.  CPAN 'test Apache::Reload'
yields 'pass'.  Subsequent CPAN 'test Apache2::Reload'
wants to use the same module, so it says 'Has already been
tested successfully'.

cmac

On Sep 3, 2009, at 3:59 AM, Foo JH wrote:


Hello guys,

I'm wondering if there is any1 using FreeBSD + Apache2 + mp2. In 
short: there's no Apache2::Reload.


I browsed around the web (in particular 
http://www.mail-archive.com/d...@perl.apache.org/msg12048.html) , and 
apparently I'm not the only one who noticed it. People mention 
Apache::Reload, but on my FBSD7.2:


1. Installing p5-Apache-Reload over package (at v0.07) throw out:
Can't locate object method "dir_config" via package 
"Apache2::RequestRec" at 
/usr/local/lib/perl5/site_perl/5.8.8/Apache/Reload.pm line 51.


2. I can't install p5-Apache-Reload over ports, as it will complain 
it expects Apache 1.3.


Any advice will be appreciated.

Thanks.






Re: [mp2] Apache2::Reload missing in FreeBSD ports

2009-09-03 Thread Foo JH

Thanks Hiro,

I wonder: if nobody is to advise otherwise, how will one know out that 
it is possible to install p5-Apache-Reload with the WITH_MODPERL2=yes 
option, without digging into the make file?


Hiroyuki Hanai wrote:

just FYI.

  

I'm wondering if there is any1 using FreeBSD + Apache2 + mp2. In short: there's 
no Apache2::Reload.



With ports-current, you will be able to install Apache2::Reload by:

$ cd /usr/ports/www/p5-Apache-Reload
$ sudo make WITH_MODPERL2=yes install

h.hanai
  




Re: PerlSwitches -I

2009-09-06 Thread Foo JH
I'm not sure if I remember right, but you may want to check out the 
PerlOptions +Parent

option.

http://modperlbook.org/html/24-5-6-3-Parent.html

Artem Kuchin wrote:

I have run into a problem. I want to have my packages
precompiled in apache process with

PerlModule X:Y

X:Y is my own package with is located in the site directory.
The site is a virtual host.

However, this apache also has many other virtual hosts with ALMOST the 
same

software with a package named X:Y, but a little bit modified.

So, in those virtual hosts i also need PerlModule X:Y

The problem is that mod_perl cannot find X:Y until i specify
PerlSwitches -I/host1/dir

But this works globally and cannot be specified per virtual host. I am 
stuck here,

but i need this personalizaed for each virtual host.

Any workaround?

Regards,
Artem






Re: [mp2] Apache2::Reload missing in FreeBSD ports

2009-09-06 Thread Foo JH

Philip M. Gollucci wrote:

WITH_MODPERL2=yes is std option used by many ports.
Also, you didn't read the output from www/mod_perl2 that tells you to
install it (www/p5-Apache-Relaod); though it doesn't mention the above var.

WITH_MODPERL2=yes will actually be dying sometime in 2010 and everything
will be derived from the APACHE_PORT /etc/make.conf var which will soon
default to www/apache22 instead of www/apache13.

  
Thanks for the clarification. I used to just set the ports to install 
with make install clean, then go get my coffee. I guess I should watch 
the first few screens before I go off.





Re: Plack

2009-10-21 Thread Foo JH
I've been - in my spare time - trying to figure this PSGI thing out. I'm 
a Windows guy you see, and I realised there's no PPM for Plack.


Is Strawberry the only alternative?

Jonathan Vanasco wrote:


On Oct 15, 2009, at 1:36 PM, Adam Prime wrote:

I haven't played with it, but i have read a bunch of Miyagawa's blog 
posts about it.  I do know that Jeff Horwitz is planning to support 
WSGI in mod_parrot / mod_perl 6, but i don't know exactly what that 
means ;)


Yeah I heard about that too.  Unfortunately, I seriously doubt I'll 
ever use Perl6.


The PSGI spec is really neat.  It's just a perl version of WSGI.  I'm 
hoping to play around with it on some spare time next month, and see 
if it can get around some of the weird stuff I've had to do with 
libapreq in the past.




Re: ApacheCon 2009 in Oakland

2009-10-21 Thread Foo JH

Damn, I left SF 3 weeks back. I'm never going to get to attend ApacheCon...

Fred Moyer wrote:

On Tue, Oct 20, 2009 at 5:43 AM, Jeff Trawick  wrote:
  

On Mon, Oct 19, 2009 at 12:15 AM, Fred Moyer  wrote:


Greetings,

Is anyone here attending ApacheCon in Oakland this year?  I am
organizing a mod_perl social.  I'll be at the conference at least one
day hacking mod_perl.
  

This lurker will be there.



I'll be the guy in the light blue Perl shirt.  Shouldn't be hard to find :)

I'm going to see about getting some mod_perlish people from SF.pm
over.  There must be more than one mod_perl hacker in commuting range
of the Bay Area besides me :)

Tuesday November 3rd in the evening for a mod_perl social?  I think
that time slot is pretty empty for official activities, and regular
conference attendees will likely be arriving around then.
  




Re: FreeBSD 7.2, mod_perl2 & Apache2::Cookie (libapreq2)

2009-10-30 Thread Foo JH
Just a thought: is install ap22 + mp2 + libapreq2 via pkg_add -r an 
option? That's what I normally do these days.



Adam Prime wrote:

You guys might want to take a look at this thread on apreq-dev

http://marc.info/?t=12420765987&r=1&w=2

Specifically the last couple of posts from pgollucci (who is a 
freebsd, and mod_perl committer).  If you can't get apreq2.12 to work, 
try 2.08.


Adam




Joe Niederberger wrote:

How do I find out what *all* the special options needed are?

Thanks,
Joe N.

- Original Message - From: 
To: "mod_perl list" 
Sent: Thursday, October 29, 2009 12:14 PM
Subject: Re: FreeBSD 7.2, mod_perl2 & Apache2::Cookie (libapreq2)


I've been using apache2/mod_perl2 on FreeBSD for years. Currently 
using 6.3 and 7.2. Installing from ports should work fine, but I 
prefer to install separate versions of apache2 and mod_perl2 from 
source. Haven't had a problem installing either of those in 
sometime. Installing libapreq2 on FreeBSD requires some special 
options, like passing --with-expat=/usr/local to configure and using 
gmake.


-Glenn








Re: FreeBSD 7.2, mod_perl2 & Apache2::Cookie (libapreq2)

2009-11-10 Thread Foo JH

Hello Joe,

Do you think you can post the changes that need to be made here, for us 
to reference when we hit the same problem?


Thanks.

Joe Niederberger wrote:

Thanks to everyone who contributed their insights to this thread - I
did get in touch with Mr. Galucci - and he did help straighten out
my installation. The main problem here was some remnants of Apache2
were still in the file system and lib pointers were not set correctly 
during

the install and so things didn't link up properly.
 
Thanks again,

Joe Niederberger

- Original Message -
*From:* macke...@animalhead.com <mailto:macke...@animalhead.com>
*To:* Sin <mailto:sinis...@gmail.com>
*Cc:* metacyc...@gmail.com <mailto:metacyc...@gmail.com> ;
mod_perl list <mailto:modperl@perl.apache.org>
*Sent:* Friday, October 30, 2009 11:56 AM
*Subject:* Re: FreeBSD 7.2, mod_perl2 & Apache2::Cookie (libapreq2)

The man you want at the FreeBSD lists is Philip M. Gollucci.  
He maintains libapreq2 in the ports collection, and was very
helpful to me when I was trying to get the module to build, 
earlier this year.


Good Luck and please report your results to this list when this is
settled,
cmac


On Oct 30, 2009, at 9:44 AM, Sin wrote:


When I build from ports the " make config " usually brings up a
window that has options for both 32 bit and 64 bit.   If I had to
guess I'd say its the same Makefile and source code that builds
the binary files.   Or in your case a 64 bit bin file.   But
honestly I really don't know, we should steer this thread over to
the FreeBSD mailling lists.  Perhaps its just a matter of
pointing this out to a maintainer or the governing group at the
FreeBSD mailling list people.   Maybe they know the next step? 


- Original Message -
*From:* metacyc...@gmail.com <mailto:metacyc...@gmail.com>
        *To:* Sin <mailto:sinis...@gmail.com>
*Cc:* Foo JH <mailto:jhfoo...@extracktor.com> ; Adam Prime
<mailto:adam.pr...@utoronto.ca> ; Joe Niederberger
<mailto:jniederber...@comcast.net> ; mod_perl list
<mailto:modperl@perl.apache.org>
*Sent:* Friday, October 30, 2009 12:36 PM
*Subject:* Re: FreeBSD 7.2, mod_perl2 & Apache2::Cookie
(libapreq2)

This may be completely unrelated, but I had similar headaches
installing libapreq2 on a 64 bit machine that had both 32 and
64 bit libs installed.  I had to uninstall the offending 32
bit libs (which I didn't need).

Do they have a similar setup?

Dimitri

On Fri, Oct 30, 2009 at 12:28 PM, Sin mailto:sinis...@gmail.com>> wrote:

pkg_add -r just goes to a package repository and gets a
package version thats allready complied for your
distribution.   So you can't build your options.

However this apreq2.12 issue is interesting.   I was
going to try this again.   I went to build this port but
make errored out with:

===>  libapreq2-2.12_1 : Error from bsd.apache.mk
<http://bsd.apache.mk>. apache13 is installed (or
APACHE_PORT is defined) and port requires 2.0+.
*** Error code 1


But if you look at the port it says apache-1.3.41_1 is
the build and run dependency.  So it should of built the
port (because I just happen to have apache 1.3 installed
).   I'm wondering if all the times I tried to build
Apache2.x with mod_perl2 the application couldn't
interface with it because of a missing dependency.


I'm not a BSD expert but it looks like this port needs
updating.   Here's the description in ports:



Port:   libapreq2-2.12_1
Path:   /usr/ports/www/libapreq2
Info:   Generic Apache2 Request Library
Maint:  s...@freebsd.org <mailto:s...@freebsd.org>

B-deps: apache-1.3.41_1 autoconf-2.62
autoconf-wrapper-20071109 expat-2.0.1 gettext-0.17_1
gmake-3.81_3 libiconv-1.13.1 libtool-2.2.6a_1 m4-1.4.13,1
perl-5.8.9_3

R-deps: apache-1.3.41_1 expat-2.0.1 perl-5.8.9_3
WWW:http://httpd.apache.org/apreq/



Port:   p5-libapreq2-2.12_1
Path:   /usr/ports/www/p5-libapreq2
Info:   Generic Apache2 Request Library
Maint:  s...@freebsd.org <mailto:s...@freebsd.org>

B-deps: apache-1.3.41_1 autoconf-2.62
autoconf-wrapper-20071109 expat-2.0.1 gettext-0.17_1
gmake-3.81_3 libiconv-1.13.1 libtool-2.2.6a_1 m4-1.4.13,1
mod_perl2-2.0.4_2,3 p5-BSD-Resource-1.2903
p5-ExtUtils-XSBuilder-0.28_1 p5-Parse-RecDescent-1.962

Unable to compile libapreq2

2006-09-20 Thread Foo JH

Hi guys,

I'm using FBSD6.0. I've done the latest cvsup on the ports, installed 
apache 2.0.59 and mod_perl 2.0.2,3 and and trying to install 
libapreq2-2.0.08.


Halfway through the compilation, I get this error:
cc -shared  .libs/util.o .libs/version.o .libs/cookie.o .libs/param.o 
.libs/parser.o .libs/parser_urlencoded.o .libs/parser_header.o 
.libs/parser_multipart.o .libs/module.o .libs/module_custom.o 
.libs/module_cgi.o .libs/error.o  -Wl,--rpath -Wl,/usr/local/lib/apache2 
-Wl,--rpath -Wl,/usr/local/lib/apache2 
/usr/local/lib/apache2/libapr-0.so 
/usr/local/lib/apache2/libaprutil-0.so -lexpat -liconv -lm -lcrypt 
-L/usr/local  -Wl,-soname -Wl,libapreq2.so.8 -o .libs/libapreq2.so.8

/usr/bin/ld: cannot find -lexpat
gmake[2]: *** [libapreq2.la] Error 1
gmake[2]: Leaving directory 
`/usr/ports/www/libapreq2/work/libapreq2-2.08/library'

gmake[1]: *** [all] Error 2
gmake[1]: Leaving directory 
`/usr/ports/www/libapreq2/work/libapreq2-2.08/library'

gmake: *** [all-recursive] Error 1

I've tried recompiling expat, but that did not change the problem.

Can any kind soul please drop some hints as to what may be the problem? 
Thanks.




Re: Unable to compile libapreq2

2006-10-03 Thread Foo JH

Hi all,

With Philip's encouragement and some extra work thrown in, I've made the 
following conclusion:
1. If I install Apache 2 + MP2 + libapreq2 using the existing port tree 
in FBSD6.1, it's fine.
2. If I install FBSD6.1 + cvsup-without-gui + updated port tree + 
Apache2 + MP2 + libapreq2, it reports 'cannot find -lexpat' error.
3. If I install FBSD6.1 + cvsup-without-gui + Apache2 + MP2 + libapreq2, 
it reports 'cannot find -lexpat' error.


Is there something in cvsup-without-gui that screws up expat?


Philip M. Gollucci wrote:

Foo JH wrote:
  

Hi guys,

I'm using FBSD6.0. I've done the latest cvsup on the ports, installed
apache 2.0.59 and mod_perl 2.0.2,3 and and trying to install
libapreq2-2.0.08.


Unfortunately its something in your local setup.  I do the FAMP stack ports 
compile almost daily.




Setting mp2 script timeout

2006-10-23 Thread Foo JH

Hi all,

Quick qn: does anyone know how to set the timeout for a running script? 
I'm thinking of using mp2 to execute an offline program, and if the 
running takes too long, I hope apache can timeout the script and abort 
it somehow...or alternatively leave it running for as long as it takes.


I've checked out the 'Timeout ' apache config command, but I 
don't think this is it.


Thanks for your advice.


Re: mod_perl install under Win32

2006-10-23 Thread Foo JH
Any particular reason why you stopped using the ActivePerl combo? It's a 
painkiller, and I depend on it most of the time.


Devin Austin wrote:

Hey everyone,
i'm brand new to this, so bear with me:

I'm trying to install mod_perl under strawberry-perl-5.8.8-alpha-2.exe 
, windows xp pro, and apache 2.2,3. I've 
extracted the mod_perl package into C:\, and i've cd'd to the 
directory and done "perl Makefile.pl". it asks for apxs, which i don't 
have, and so i just hit enter like it says to do if you don't have 
apxs installed.  That goes through and seems to be error free, however 
when using dmake to try and continue the process, i get this error: 
dmake: Error: -- Incomplete rule recipe group detected.


I'm not incredibly familiar with strawberry perl, last time i tried 
installing mod_perl i was using ActiveState and i just used PPM.  I 
obviously can't do that now, so I'm a bit lost.  Anyone have any ideas?


-devin

--
timorperfectus.com  - web design to 
frightening perfection.



One last song
Given to an Angel's Son
As soon as you were gone
As soon as you were gone 




Re: [mp2] PAR in production?

2006-11-06 Thread Foo JH
I've tried using Apache::PAR, but I think it needs some work to get it 
working on MP2 or MP2.2. There is a lazy way to go about it:


1. In your httpd.conf insert:
PerlRequire startup.pl
2. In your startup.pl load your PAR files.

Hope this helps.

Ali ISIK wrote:

Hi there, folks -- is the use of PAR with mp2
recommended in production?  We are considering
distribution options for an mp2 application, including
vmware and rPath, which can be rather expensive,
depending on your targeted market segment.  Is there
any consensus on this issue, any "standard"
recommendation among the wise/experienced mp
developers and admins?  How have you, for instance,
distributed your last application and how do you rate
the experience?

--Ali Isik




Re: [mp2] PAR in production?

2006-11-09 Thread Foo JH
I don't understand. What do you mean by 'perl is not relocatable'? I've 
put (Active)Perl in the same directory as the apache server in a 
copy-paste operation. But this is in Windows.


Michael Peters wrote:

Fred Moyer wrote:

  

I like this approach, but it still requires a perl binary to make
everything happen.  The default perl compile on a lot of systems out
there is threaded, and built for general use.  Have you found a way of
shipping a custom perl build in addition to all the other components?



It's problematic because perl is not relocatable. But Nicolas Clark's work will
make 5.10 relocatable and thus possible to bundle a custom build of perl with
the application.

  




Re: [mp2] PAR in production?

2006-11-13 Thread Foo JH
Are you guys referring to this tool ActiveState released for relocating 
Perl:

http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/site/lib/ActiveState/RelocateTree.html


Frank Wiles wrote:

On Mon, 13 Nov 2006 10:24:21 +0200
Issac Goldstand <[EMAIL PROTECTED]> wrote:

  

Frank Wiles wrote:


   I believe this is how Sophos' PureMessage installs itself.
Basically putting your own Perl binary and module paths in
   say /usr/local/myapp/bin/perl.  This is probably the best way to 
   ensure you have full control over everything about your
application. 
  

I actually imagine that Sophos does it exactly the same way
ActivePerl does it; until recently they owned ActiveState, and thus
had access to the ActivePerl setup scripts :-)



   hehe good point! :) 
 
  

FYI, it's not just @INC and binary - there are also changes needed,
for example, in Config.pm, or you won't be able to install new
modules to your new perl site...



   What I meant was build a custom Perl with say
   --prefix=/usr/local/myapp, install all of your modules with it, and
   reproduce the entire structure with your packager ( for example
   RPM ). 

   Most apps that are after this sort of setup aren't interested in 
   allowing the user to install new modules, they specifically want

   to control the entire environment to avoid version bugs and
   support issues. 


 -
   Frank Wiles <[EMAIL PROTECTED]>
   http://www.wiles.org
 -

  




Re: Web development platform contest and Perl / mod_perl

2006-11-18 Thread Foo JH
Agreed. I believe at this point in time (mod)Perl's extensive library 
support + Apache integration is still a unique value proposition. 
However I suspect because it is not based on a oop foundation, people 
tend to favour languages like Ruby instead.


To be realistic, whatever the outcome of this competition, it will not 
likely to change the perception of (mod)Perl much. The Perl environment 
needs to move forward, and be accepted by the general development and 
business community. Otherwise it will become the next Cobol.


I fear the lack of progress in Perl 6 is a sign of impending doom...:(

Octavian Rasnita wrote:

Oh yes in the last period I have seen that other languages are more and more
used comparing with perl.
I can see more and more programs made in Python, including in fields in
which there are no perl programs at all, like a screen reader for example.
I see a bigger and bigger interest in Ruby and Ruby on Rails framework and a
good promotion of them.

So I think that Perl should be also be promoted because otherwise less and
less programmers will become interested in it.

Teddy

- Original Message - 
From: "Hahn, Christopher" <[EMAIL PROTECTED]>

To: "Alvar Freude" <[EMAIL PROTECTED]>
Cc: "mod_perl list" 
Sent: Wednesday, November 15, 2006 2:32 AM
Subject: RE: Web development platform contest and Perl / mod_perl



...and yet I wonder if the gentleman is correct in suggesting that
"It would be good for the reputation for mod_perl and Perl"

If so, then while it might not be the smartest thing in everyone's
opinion,
I would still like to see Perl stand out well against other tools!

Just my $0.02

-Original Message-
From: Jonathan Vanasco [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 14, 2006 4:07 PM
To: Alvar Freude
Cc: mod_perl list
Subject: Re: Web development platform contest and Perl / mod_perl


On Nov 14, 2006, at 6:10 PM, Alvar Freude wrote:

  

Hi mod_perl and Perl users,

There is an international contest and comparison with scientific
evaluation about programming languages (and frameworks) for web
development.

  



honestly, that contest looks ridiculously stupid and ill conceived.

any developer worth hiring knows that different languages/platforms/
frameworks are better suited for different tasks.

if you build '1 web application' under 20 languages / frameworks, you're
sure to have some frameworks handle it amazingly well -- and others
horrible -- all because of the design specs.
If you tweak the parameters of that application ever so slightly, you'll
easily flip the results.

You'll also run into issues where benefits/limitations aren't from the
languages themselves, but from frameworks built on top of them.

Honestly, i don't understand how someone could hope garner an objective
comparison of any two platforms by simply comparing a 30hr project
across different implementations.



// Jonathan Vanasco

| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
| FindMeOn.com - The cure for Multiple Web Personality Disorder Web
| Identity Management and 3D Social Networking
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
| RoadSound.com - Tools For Bands, Stuff For Fans Collaborative Online
| Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -



  




Re: [mp2] PAR in production?

2006-11-18 Thread Foo JH
Depends if you plan to make money out of it. Otherwise iirc it doesn't 
cost you a cent.


Issac Goldstand wrote:

Cool!

But, what license does it have?

Foo JH wrote:
Are you guys referring to this tool ActiveState released for 
relocating Perl:
http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/site/lib/ActiveState/RelocateTree.html 




Frank Wiles wrote:

On Mon, 13 Nov 2006 10:24:21 +0200
Issac Goldstand <[EMAIL PROTECTED]> wrote:

 

Frank Wiles wrote:
  

   I believe this is how Sophos' PureMessage installs itself.
Basically putting your own Perl binary and module paths in
   say /usr/local/myapp/bin/perl.  This is probably the best way 
toensure you have full control over everything about your
application.   

I actually imagine that Sophos does it exactly the same way
ActivePerl does it; until recently they owned ActiveState, and thus
had access to the ActivePerl setup scripts :-)



   hehe good point! :)   

FYI, it's not just @INC and binary - there are also changes needed,
for example, in Config.pm, or you won't be able to install new
modules to your new perl site...



   What I meant was build a custom Perl with say
   --prefix=/usr/local/myapp, install all of your modules with it, and
   reproduce the entire structure with your packager ( for example
   RPM ).
   Most apps that are after this sort of setup aren't interested in 
   allowing the user to install new modules, they specifically want

   to control the entire environment to avoid version bugs and
   support issues.
 -
   Frank Wiles <[EMAIL PROTECTED]>
   http://www.wiles.org
 -

  




Windows + MP2 in a production environment

2006-11-18 Thread Foo JH

Hello guys,

Just want to get some feedback from people here who use MP2 on Windows 
for their production enviromment. For myself I have done MP2 on both 
FreeBSD and Windows platforms, and it seems to me that the FreeBSD combo 
is more reliable. The Windows version on occasion (but sure to happen) 
will throw out an error, and Apache will restart automatically. Does 
anyone share the same experience?


Re: JOB [CONTRACT] + Re: Windows + MP2 in a production environment

2006-11-19 Thread Foo JH
Why don't you post the error message here, and see if anyone has seen it 
before?


Issac Goldstand wrote:
YES!  While it's acceptable for light and smallish applications, I've 
never found it to be really usable once you're serving concurrent 
connections.


On that note, I have a contract (job) offer for anyone who knows their 
way inside Perl (5.8) and mod_perl  (2) enough to help troubleshoot a 
win32-related crash.  In short, once we put heavy load on the server, 
we see a crash reported from inside libperl58.dll - my theory is that 
it's thread-related, but I don't have the time to look into it 
properly.  If anyone thinks that they are capable of identifying and 
fixing the problem, please email me.


 Issac

Foo JH wrote:

Hello guys,

Just want to get some feedback from people here who use MP2 on 
Windows for their production enviromment. For myself I have done MP2 
on both FreeBSD and Windows platforms, and it seems to me that the 
FreeBSD combo is more reliable. The Windows version on occasion (but 
sure to happen) will throw out an error, and Apache will restart 
automatically. Does anyone share the same experience?




Re: JOB [CONTRACT] + Re: Windows + MP2 in a production environment

2006-11-19 Thread Foo JH
This is a disappointing piece of news. Perl itself is very useful on the 
Windows environment. If modperl cannot be reliably deployed on Windows, 
how can we expect the Windows developers (which form the majority of 
developers) to consider adopting perl/ modperl for the enterprise?


I hope we can find people who can testify otherwise...

Issac Goldstand wrote:
YES!  While it's acceptable for light and smallish applications, I've 
never found it to be really usable once you're serving concurrent 
connections.


On that note, I have a contract (job) offer for anyone who knows their 
way inside Perl (5.8) and mod_perl  (2) enough to help troubleshoot a 
win32-related crash.  In short, once we put heavy load on the server, 
we see a crash reported from inside libperl58.dll - my theory is that 
it's thread-related, but I don't have the time to look into it 
properly.  If anyone thinks that they are capable of identifying and 
fixing the problem, please email me.


 Issac

Foo JH wrote:

Hello guys,

Just want to get some feedback from people here who use MP2 on 
Windows for their production enviromment. For myself I have done MP2 
on both FreeBSD and Windows platforms, and it seems to me that the 
FreeBSD combo is more reliable. The Windows version on occasion (but 
sure to happen) will throw out an error, and Apache will restart 
automatically. Does anyone share the same experience?




Re: Windows + MP2 in a production environment

2006-11-19 Thread Foo JH

Issac Goldstand wrote:

We were originally using 5.8.3, but reproduced the problem with both
activeperl 5.8.8.819 with mod_perl-2.0.3-dev (from your PPM repository)
as well as our own built perl + mod_perl 2.0.3-rc2
  

I wonder if modperl on apache 2.2 will resolve this issue...


Re: SV: JOB [CONTRACT] + Re: Windows + MP2 in a production environment

2006-11-21 Thread Foo JH

Henrik Schak Hansen wrote:

Hi All,

I think we are a lot of windows users experiencing the same problem with mod_perl/apache: 
"The famous 3221225477 exit status".
My company will also be willing to donate some money If it will help solving 
the problem.
Yes! It's really (in)famous! :) The more detailed error message seems to 
be captured in the Event Application log instead. I wonder why error.log 
wasn't more verbose on this one.




Re: SV: JOB [CONTRACT] + Re: Windows + MP2 in a production environment

2006-11-21 Thread Foo JH


In the list of all modules you are using in your application, are you 
sure that all modules are thread-safe ? If only one is not 
thread-safe, you may encounter an error at a time while running your 
application ?

For my part, I use mainly CPAN libraries. This includes:
HTML::Template
DBI
DBD::ODBC
DBD::MySQL
XML::Simple
Apache::DBI

I suspect DBI may not be thread-safe (at least I don't know how to share 
a DBI object across threads), but since I doing connection pooling via 
Apache::DBI, I suppose it helps.


The problem with Apache restarting itself, is that it is not predictable 
at all. I created a simple app that uses all of the above libraries, and 
hit the page 10,000 times. It's still fine. But then again, the test is 
overly simplistic...


I'd never found a way to configure apache 2 + mod_perl 2 to work in a 
pre-forked environment on windows. Is there anyone who knows if it's 
possible ?


Stéphane




Re: SV: JOB [CONTRACT] + Re: Windows + MP2 in a production environment

2006-11-21 Thread Foo JH

William A. Rowe, Jr. wrote:

Foo JH wrote:
  

Yes! It's really (in)famous! :) The more detailed error message seems to
be captured in the Event Application log instead. I wonder why error.log
wasn't more verbose on this one.



Because, once it crashes it's no longer logging?
  
Yet it is able to restart itself automatically? I think there may be a 
piece of code that catches the fault. I just don't know if that piece of 
code can still log at that point in time.




Re: JOB [CONTRACT] + Re: Windows + MP2 in a production environment

2006-11-21 Thread Foo JH

Hey Stephane,

Thanks for zeroing in on the problem libraries. I don't remember using 
LibXML, but I'll see if I can replicate the problem as well, in a 
simplified model.


Stephane GUIBOUD-RIBAUD wrote:
I had a similar issue one year ago with mod_perl 2.0.0-RC4 and perl 
5.6.1 (same issue with perl 5.8).


The problem was due to the use of LibXML (which is the fastest xml 
parsing library I found to parse large XML files) with mod_perl and 
apache in a multi-threaded environment. I also had some issues with 
SOAP-Lite module in my environment.


I had to go back to a CGI application to solve this problem, but I 
don't have a highly loaded server at this time.


Stéphane

Issac Goldstand wrote:

We were originally using 5.8.3, but reproduced the problem with both
activeperl 5.8.8.819 with mod_perl-2.0.3-dev (from your PPM repository)
as well as our own built perl + mod_perl 2.0.3-rc2

Randy Kobes wrote:

On Sun, 19 Nov 2006, Foo JH wrote:


Issac Goldstand wrote:

YES!  While it's acceptable for light and smallish applications, I've
never found it to be really usable once you're serving concurrent
connections.

On that note, I have a contract (job) offer for anyone who knows
their way inside Perl (5.8) and mod_perl  (2) enough to help
troubleshoot a win32-related crash.  In short, once we put heavy load
on the server, we see a crash reported from inside libperl58.dll - my
theory is that it's thread-related, but I don't have the time to look
into it properly.  If anyone thinks that they are capable of
identifying and fixing the problem, please email me.

What version of perl are you using? There were some
threads-related fixes introduced in perl-5.8.8 that
solved some problems with earlier versions.







Re: Windows + MP2 in a production environment

2006-11-22 Thread Foo JH

Sorry to hear about your accident. Glad you're OK.

Your analysis seems to point to Perl being unable to free memory blocks 
in Windows (will it happen in Linux as well?). Appending to my 
experience, this problem happens when there is a huge block of memory to 
release.


I'm not much of a C/C++ developer, so my question is: for those of us 
who depend on the ActivePerl track for modperl, is there a workaround we 
can use?


You should give your developer a pat on the back for coming up with such 
an ingenious workaround!


Issac Goldstand wrote:

It took me a while to get everything together, and I was involved in a
minor pile-up car accident (I'm fine - car needs body work) so this got
delayed more than I originally intended.  Apologies to people who were
standing by with test environments to try to work this out.

Getting to the point (quoting this from the developer who was in charge
of this issue):
--- BEGIN QUOTE ---
The crash occurs on computer with Microsoft Windows Server 2003 Standard
Edition Service Pack 1. With dual Intel XEON HyperThreading CPU 3.00 GHZ
and 3.00 GB RAM

We originally found the bug when We used Apache 2.0.2 ,Mod_perl
1.99-dev,Perl 5.8.3, and also the bug still occurred when we upgraded
the server to Apache 2.2.3,Mod_perl 2.0.3 RC2,Perl 5.8.8

The event log message is "Faulting application httpd.exe version
2.2.3.0, faulting module perl58.dll version 0.0.0.0, fault address
0x0015bdb4"

The configuration of the server:
PerlInterpMax 10 and more
# Creates 7 interpreter threads when Apache starts up (def 3)
PerlInterpStart 7 and up
# Leave a maximum of 7 spare threads (not used threads)
PerlInterpMaxSpare 7 and up.
Httpd.conf :
ThreadsPerChild 250
MaxRequestsPerChild 0

After compiling the perl with debug symbols and running it using the
Windbg application I got the following stack trace:
perl58!VMem::Free+0x5e
perl58!CPerlHost::FreeShared+0x2a
perl58!PerlMemSharedFree+0x1a
perl58!Perl_newCONSTUB+0x28a
perl58!S_cv_clone2+0x8ce
perl58!Perl_cv_clone+0x1a
perl58!Perl_pp_anoncode+0x46
perl58!Perl_runops_debug+0x18f
perl58!S_call_body+0x52
perl58!Perl_call_sv+0x703
perl58!S_call_list_body+0x57
perl58!Perl_call_list+0x18a
perl58!Perl_newATTRSUB+0x1306
perl58!Perl_utilize+0x4e3
perl58!Perl_yyparse+0x1543
perl58!S_doeval+0x3a8
perl58!Perl_pp_require+0x19c9
mod_perl!modperl_pp_require+0xd
perl58!Perl_runops_debug+0x18f
perl58!S_call_body+0x52

In order to avoid the problem I used the __try and __catch which are
used in Microsoft win32 applications changing  :
inline void FreeShared(void* ptr)
{
GetLockShared();
__try{
m_pVMemShared->Free(ptr);
}
__except(EXCEPTION_EXECUTE_HANDLER)
{   
}   
FreeLockShared();
};
Located in win32\perlhost.h file.
The crash occurs in VMem::free function  probably during freeing  of the
block of memory there.

--- END QUOTE ---

  Issac


Issac Goldstand wrote:
  

Unfortunately, so far not yet...  We haven't been able to get it to
reproduce on a test machine yet - the setup on the problematic machine
is Dual hyperthreading 3.0Ghz Xeons with 3GB RAM, running Win2003 Server
SP1.
The closest we've got to match that setup is with a dual core Pentium-D
3.4 Ghz machine with XP SP2, or a VMWare VM with 2 virtual processors
(host machine is a Pentium 4-HT 2.8 Ghz machine) with 1.2GB RAM running
win2003 SP1.

I'll post the exact error messages, as well as a workaround that someone
put together (definitely workaround and not fix - he just wraps the
deepest crashing subroutine in a Visual C __try {} block, as I
understand; I haven't seen it myself yet), as soon as I can.

 Issac

Randy Kobes wrote:


On Sun, 19 Nov 2006, Issac Goldstand wrote:

  

Foo JH wrote:


Issac Goldstand wrote:
  

We were originally using 5.8.3, but reproduced the problem with both
activeperl 5.8.8.819 with mod_perl-2.0.3-dev (from your PPM
repository)
as well as our own built perl + mod_perl 2.0.3-rc2



I wonder if modperl on apache 2.2 will resolve this issue...
  

We're using 2.2.3 - Upgrading everything to the latest stable versions
was the first thing we tried.


Is it possible to provide a minimal script that illustrates
the problem? There's some people on the list that have
threads-enabled unix setups; it would be interesting to
see if it's also a problem there.

  




Re: mod_perl installation

2007-01-14 Thread Foo JH
If you're running on Linux/ Sun, I think most people avoid threading for 
performance reasons. If you're going to be on Windows, you don't have a 
choice: threading is compulsory.


You may want to read up on the various MPM models for each OS.

Octavian Rasnita wrote:

Hi,

How it is recommended to install perl if I also want to use it with 
mod_perl?

With or without threading support?
With or without support for multiplicity?

It gives an error when installing with Apache 2.24, and I am trying to 
see if I don't make some mistakes.


Thank you.

Octavian





Re: How to extract a parameter

2007-01-14 Thread Foo JH

Fred Moyer wrote:

Tracy12 wrote:

Hi,

Is there a easy way to extract the ticket(may be using a Regular 
Expression)

parameter from a URL as follows

http://localhost/myTest.pl?ticket=ST-2-zbwAtOlYlfzoC6knUXP9&name=test


There is an easy way, that emulates CGI's methods. It's called 
libapreq2, and the class you're looking for is Apache2::Request. To get 
the ticket for example, you create an instance of the class, and called 
$req->param("ticket");


It's not part of the mod_perl package, but it is easily available.


Re: Modperl crashes on win32

2007-01-28 Thread Foo JH
For your reference, I am running Apache 2.2.3 + mp2 2.0.3 + libapreq 
2.6.0 dev + Perl 5.8.8 fine on my 2K3 and XP boxes, regardless of the 
concurrency setting. No special config used. You may want to relook your 
setup, or try installing on a clean machine.


Tümer Garip wrote:

Hi,
No need for any specific code.
A simple CGI script writing some silly sentences to the browser will do
the same.
However I noticed something else.
1-When i test with a concurrency level above 1 right after a fresh
server start it crashes almost 100%.
2-If I gradually increase the concurrency as 1,3,5,10 and keep testing
than it works and it will segmenfault intermittently.
3-I tested with 2.0.4-dev as well. It didnot compile until i upgraded
threads::shared to CPAN version. Things have improved and number of
crashes is reduced.

Thats all i can say at the moment.

Thanks 
Tumer


Perin Harkins wrote:

  

On 1/25/07, Tümer Garip <[EMAIL PROTECTED]> wrote:


We have a production working library system with the above platform.
Recently we are trying to use Modperl with either PerlRun or Registry
Everything looks smooth except the intermittent faults i quoted
  

above.
  

Can you attempt to isolate the part of  your perl code that's running
when it hits this segfault?

- Perrin




  




Re: ANNOUNCE: HTML::Template v2.9

2007-01-30 Thread Foo JH

Just want to comment that I enjoy using HTML::Template. :)

Sam Tregar wrote:

CHANGES
   - New Feature: the force_untaint option makes sure you do not
 pass tainted values to param(). [Sven Neuhaus]

   - New Feature: Added ESCAPE="none" as a synonym for ESCAPE="0".
 Fixed both to work with default_escape. [EMAIL PROTECTED]

   - Bug Fix: DEFAULT didn't work with URL and JS escaping.

   - Bug Fix: Long-standing bug where variables set in a loop weren't
 available inside inner loops under global_vars if the variable
 wasn't actually used in the outer loop.  (Thanks to Richard Fein
 for help debugging the fix.)

   - Doc Fix: Changed references to CVS in the docs to Subversion now
 that the switch is complete.

   - Test Fix: At long last, the work from the Phalanx project has
 been merged!  The tests are now more complete and easier to work
 on.  Thanks Phalanx guys!

DESCRIPTION

This module attempts to make using HTML templates simple and
natural. It extends standard HTML with a few new HTML-esque tags -
, , , , 
and .  The file written with HTML and these new tags
is called a template. It is usually saved separate from your
script - possibly even created by someone else! Using this module
you fill in the values for the variables, loops and branches
declared in the template. This allows you to separate design - the
HTML - from the data, which you generate in the Perl script.

This module is licensed under the same license as Perl. See the
LICENSE section of the docs for more details.

TUTORIAL

If you're new to HTML::Template, I suggest you start with the
introductory article available on the HTML::Template website:

   http://html-template.sourceforge.net

AVAILABILITY

This module is available on SourceForge.  Download it at:

   http://html-template.sourceforge.net

The module is also available on CPAN.  You can get it using
CPAN.pm or go to:

   http://www.cpan.org/authors/id/S/SA/SAMTREGAR/




How to obtain the raw http content?

2007-02-13 Thread Foo JH

Hi all,

Can anyone point me in the right direction? I am expecting POST with XML 
content, so the usual parser won't work...I think.


Hope this helps.


Re: mod_perl 2 and Forms?

2007-02-20 Thread Foo JH
Install libapreq2, which emulates the CGI->param() method. Depending how 
refactored your existing codes are, you may not need to rework much.


[EMAIL PROTECTED] wrote:


I'll admit that I'm a mod_perl newbie.  I've always just used plain 
ol' CGI scripts in the past.  Obviously I have relied's upon CGI's 
param() method to get form parameters.  Looking around the 
documentation, I can see how to do the equivalent using mod_perl, but 
nothing with mod_perl 2.  In fact, many a google search has suggested 
that this is more or less broken in mod_perl 2 and to use CGI.pm 
instead.  However, before I did this, which I consider to be a kludge, 
I figured it would be best to ask the community since I can find 
nothing about it on the mod_perl documentation site.


So here's the basic question.  What method(s) do I use in standard 
mod_perl 2 modules to perform tasks similar to CGI.pm's param() method?


Dan Kelley
Sr. Network Analyst
SSM Health Care, Information Center
(314) 768-5144 / (314) 256-9272


*Confidentiality Notice: This email message, including any 
attachments, is for the sole use of the intended recipient(s) and may 
contain confidential and privileged information. Any unauthorized 
review, use, disclosure or distribution is prohibited. If you are not 
the intended recipient, please contact the sender by reply email and 
destroy all copies of the original message. *






Re: Have I got mod_perl installed?

2007-02-28 Thread Foo JH
To be really sure, turn on the server signature and see what your telnet 
trick gives you.


amend in your http.conf:
ServerSignature on

Beginner wrote:

Hi,

I am a bit confused.

If I do:
telnet localhost 80


I get:
HTTP/1.1 403 Forbidden
Date: Wed, 28 Feb 2007 16:53:29 GMT
Server: Apache/2.0.52 (Fedora)  <- Note no mod_perl here
Accept-Ranges: bytes
Content-Length: 3931
Connection: close
Content-Type: text/html; charset=UTF-8


Yet I have a number of mod_perl handlers that appear to work fine. I 
have /usr/lib/httpd/modules/mod_perl.so which (presumably) get loaded 
via a ~/conf.d/perl.conf.


Also my package manager (yum) says that mod_perl is installed as 
version 1.99_16-3.  My httpd is Server version: Apache/2.0.52.


My main problem is that other modules are not seeing the mod_perl 
installation, EG: SOAP::Apache.


Is my configuration messed up? Do I need to start again?
TIA,
Dp.

  




Re: Have I got mod_perl installed?

2007-03-01 Thread Foo JH
If the signature is on and you don't see it, chances are it's not loaded 
properly.


Beginner wrote:

Lot's of replies, thanx.

On 1 Mar 2007 at 10:50, Foo JH wrote:
  
To be really sure, turn on the server signature and see what your telnet 
trick gives you.


amend in your http.conf:
ServerSignature on



ServerSignature is already on:

httpd.conf:ServerSignature On

Can we draw any conclusions from this?

  

Beginner wrote:


Hi,

I am a bit confused.

If I do:
telnet localhost 80


I get:
HTTP/1.1 403 Forbidden
Date: Wed, 28 Feb 2007 16:53:29 GMT
Server: Apache/2.0.52 (Fedora)  <- Note no mod_perl here
Accept-Ranges: bytes
Content-Length: 3931
Connection: close
Content-Type: text/html; charset=UTF-8
  

...

I have a number of handler configured like so:


SetHandler perl-script
  PerlHandler MY::calendar
  Order...


These work fine and use the following pragmas;

package MY::calendar;

use Apache2::Const qw(OK DECLINED NOT_FOUND);
use APR::Table;
use Apache2::RequestUtil ();
use strict;
use Calendar::Simple;
use Date::Calc qw(Month_to_Text);
use CGI;
use Template;
use warnings;

$| = 1;

sub handler {
...

The issue with SOAP::Lite is interesting. During the install you get 
a list of transports;


...
Standalone HTTP server   [*] HTTP::Daemon   [ yes ]
Apache/mod_perl server   [ ] Apache  [ no ]
FastCGI server[ ] FCGI  [ no ]
POP3 server   [ ] MIME::Parser  [ no ]
...


I'm not sure if the formating will show it here but SOAP::Lite 
doesn't see mod_perl installed. However is does install as does 
SOAP::Apache so presumbly I can use in the same way I do with my 
other modules. 

Still I have the feeling that my installation is not standard and the 
mis-match in version is a concern.


Would any one recommend a course of action? Should I remove the 
binary RPMs that my package manager installed and install from 
source?


Thanx,
Dp.

  




Re: Perl and ASP.Net

2007-04-25 Thread Foo JH



ASP.Net tries to do both the server and client side (sometimes the programmer
doesn't even know if his C# code is actually going to be run on the server or
the client). Perl (and on this list mod_perl) takes care of the server side but
leaves the client side up to you.
  
I believe that's the grand strategy for C# developers. If they can write 
code that can easily be ported from the web to (for example) a mobile 
platform, it is a very good business strategy.




I think the OSS community is actually ahead of .Net in this regard since you
aren't tied to a particular back-end system. Choice does mean you need more
knowledge though. Start looking around and evaluate and pick one that suits your
needs.
I'm actually quite glad that we have two options (or more, in favour of 
the Perl TIMTOWTDI mantra) of implementation a web-based application. 
The ASP.NET way makes putting together an application quick and easy, 
abstracting the details of client-server communication as much as 
possible. This is aligned to the real-world scenario where too many 
businesses expect 'instant applications' to respond to their new-fangled 
ventures.


The we-do-purely-backend-stuff alternative that is modperl concentrates 
on making the web app agile yet robust. To put it objectively, it is the 
tradditional approach to writing web applications. It works, it's 
proven, and there is good community and professional support for this 
kind of framework.


Looking forward, I personally believe in the pervasiveness of the 
dynamic and asynchronous interactivity between the client and the 
browser. Module(s) that enable such features will be a milestone in 
making modperl (and Perl itself) relavant in the ever changing web 
landscape.


Re: Perl and ASP.Net

2007-04-26 Thread Foo JH

Boysenberry Payne wrote:

One of the draw back that seems to be evident to me as I've looked
into the client side frameworks is changes in the code are ought
of your control.  WIth a purely server side solution it would seem
to give the coder the choice to upgrade when there is time, etc.
With the 3rd party frameworks they choose when you upgrade.
For the more stable solutions this is less of a problem.  For the
newer technologies I've heard a lot of grumbling about having
to recode every time there is an upgrade... 
My take on the current situation on client-side frameworks 
(AJAX-styled?) is that it's a bit wild. We have scriptaculous, 
prototype, yui, rico and more. Each of them do parts of a framework (eg. 
drag-n-drop, controls), but even the concept of a client-side framework 
is kinda hazy. What constitutes a client-side framework exactly?


So until some organisation big enough comes along to offer a defacto 
implementation that everybody will take reference from, expect changes 
and more changes. This of course is good news for web ui developers - 
more jobs stability for everybody! On the flip side, IE7-8-9 will 
continue to make a nuisance of themselves.


Are you FireFoxed yet?


Re: Weird startup includes

2007-04-26 Thread Foo JH

Are you running Apache on Windows?

Martin Moss wrote:

I seem to have something weird going on. a Module I've
written seems to be being included twice at server
startup, but the second time its included the
Apache::ServerStarting flag is set to 0... and is
therefore causing all sorts of grief... (e.g. $dbh
being forked)..
Ive never noticed before that if you have you module
declared twice (in httpd.conf and in startup.pl) that
it would load the module twice 


I'm running apache 1.33 and mod perl... Any ideas?

###startup.pl

use MY::Module;

---

## httpd.conf

PerlModule MY::Module
PerlHandler My::Module->handler
.
http://uk.answers.yahoo.com/ 
  




Re: Apache::DBI - Can two different connection handles have the same reference/address at different times?

2007-05-07 Thread Foo JH
My suspicion is that when you do a disconnect, the connection is 
actually not released. That's the idea of connection pooling isn't it?


You can confirm this by checking the number of connections stated on 
your sql server after a call.


Lionel MARTIN wrote:

Hello,
 
As you know,
 
use Apache::DBI;

DBI->connect()
 
returns a db/connection handle.
 
I am wondering if it is possible, at different times during the server 
life, that Apache::DBI returns twice the same memory reference, while 
the connection is in fact physically not the same.
 
The reason for this question is simple: I would like to know if I can 
reuse statement handles (for example doing a $sth->execute) without 
having to recreate them if the conection handle is the same with an 
algorithm like this simplified one:
 
our $sth;

our $currentdbh ;
our $olddbh;
$currentdbh = DBI->connect();
 
if ($currentdbh != $olddbh){

$sth = $currentdbh->prepare(...)
}
 
$sth->execute();

$olddbh = $currentdbh;
 
This would save me the need to prepare at every request, while I could 
benefit from old prepared statements.
 
What I'm afraid of, by doing that, are situations where db handles 
appear to be the same (same address) while they are not in fact the same.
 
Thanks,
 
Lionel.
 




Re: After retrieving data from DB, the memory doesn't seem to be freed up

2007-05-10 Thread Foo JH




I would even say PER THREAD or PER PERL INTERPRETER.

Indeed, I'm running Per/mod perl under Windows, and there's one unique 
Apache process (except the parent one) hosting all perl interpreters.
Something to ask about modperl and memory in Windows. I know modperl 
uses threads in Windows. But does modperl respond to the 
MaxRequestsPerChild setting?


In other words, if I specify that the 'child' should serve only 100 
requests before respawning, does Perl free up all memory allocated by 
the thread before respawning the thread?


Re: catching a segmentation fault

2007-05-16 Thread Foo JH

Are you running Apache 2.0 on Windows?

Tyler Bird wrote:

Hi all,

I was wondering how I could use the %SIG has to catch a segmentation 
fault.


I am setting up a new server with mod_perl + apache 2.0 + some legacy 
code
and am sporadically rececing a segmentation fault to my apache logs 
like so.


child pid 15077 exit signal Segmentation fault (11)

%SIG{'SEGV'} = sub { }; ?

Thanks so much,

Tyler




Re: What would cause a SEGFAULT on startup

2007-05-20 Thread Foo JH
If you're starting modperl from scratch, I'd suggest that you go with 
modperl2 on apache 2.2 than legacy apache 1.3 + modperl 1


Tuc at T-B-O-H.NET wrote:

Hi,

I'm running :


apache+mod_ssl+mod_deflate-1.3.37+2.8.28
perl-threaded-5.8.8
mod_perl-1.30

all installed via the FreeBSD ports collection.

When I try to start it, using just the default httpd.conf
with nothing but it being loaded, I get a segfault. The backtrace is :

(gdb) bt
#0  0x286e9350 in Perl_newSVpvn ()
   from /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so
#1  0x2873e1bd in PerlIO_open ()
   from /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so
#2  0x2868736a in S_open_script ()
   from /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so
#3  0x28684267 in S_parse_body ()
   from /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so
#4  0x286837fe in perl_parse ()
   from /usr/local/lib/perl5/5.8.8/mach/CORE/libperl.so
#5  0x2861ddb4 in perl_startup () from /usr/local/libexec/apache/libperl.so
#6  0x2861d82a in perl_module_init () from /usr/local/libexec/apache/libperl.so
#7  0x0805683e in ap_init_modules ()
#8  0x0805f5df in main ()


Is this because I'm using threaded perl?  I know it was
an issue on FreeBSD at one time.

Thanks, Tuc
  




Re: File Handle Issues in Mod_Perl 2.0

2007-05-20 Thread Foo JH

Could be some internal optimsation issue.

But I'd say that your best bet is to really close the file after you're 
done with it, and not let it hang around. This so especially when you 
are expecting multiple threads/ processes accessing the same file.


Justin Luster wrote:


Hi,

A while back I posted an issue that I was having with mod_perl 2.0 
regarding file handles. Today I found an interesting clue to the problem.


In my test script below I’m opening the same file twice in a row on 
purpose without closing it. I’m trying to replicate a possible error 
condition where the file might not be closed properly. When I run this 
script on Apache 1.3 outside of Mod_Perl it works fine. When I run 
this script on Apache 1.3 with Mod_Perl 1.0 it works fine. When I run 
this script under Apache 2.0 Mod_Perl 2.0 it breaks (I’m on Red Hat 
Linux). Basically on the 2^nd open the file offset does not start at 
the beginning of the file as it does in my other tests. Further more 
it is not consistent but starts doing the Mod_Perl weirdness of 
sometimes working and sometimes not.


The code that is breaking has been working for years but has started 
to show errors when run under Mod_Perl 2.0 Apache 2.0.


Does anyone know what might have changed in Mod_Perl 2.0 to have 
caused this problem?


Thanks for your help,

Justin

Here is my test script:

my $strCGIPath = "";

if ((exists($ENV{'SCRIPT_FILENAME'}) || (defined 
($ENV{'SCRIPT_FILENAME'}


{

#Get absolute path to cgi-bin

$strCGIPath = $ENV{'SCRIPT_FILENAME'};

}

$strCGIPath =~ s/\/test.pl//;

my $strFileName = $strCGIPath . "/" . "test.txt";

open (QUESTIONFILE,'<' . $strFileName) or print "Cant find file";

binmode QUESTIONFILE;

#Get first line

$_ = ;

open (QUESTIONFILE,'<' . $strFileName) or print "Cant find file";

binmode QUESTIONFILE;

seek QUESTIONFILE, 0, 0;

#Get first line

$_ = ;

print $_;





Re: File Handle Issues in Mod_Perl 2.0

2007-05-21 Thread Foo JH

What kind of errors specifically are you getting?

Justin Luster wrote:

I'm not closing the file on purpose to try and simulate an error
condition.  My main question is why would it work differently from
mod_perl 1.0 to 2.0?

Thanks,

Justin

-Original Message-
From: Foo JH [mailto:[EMAIL PROTECTED] 
Sent: Sunday, May 20, 2007 7:15 PM

To: Justin Luster
Cc: modperl@perl.apache.org
Subject: Re: File Handle Issues in Mod_Perl 2.0

Could be some internal optimsation issue.

But I'd say that your best bet is to really close the file after you're 
done with it, and not let it hang around. This so especially when you 
are expecting multiple threads/ processes accessing the same file.


Justin Luster wrote:
  

Hi,

A while back I posted an issue that I was having with mod_perl 2.0 
regarding file handles. Today I found an interesting clue to the


problem.
  
In my test script below I'm opening the same file twice in a row on 
purpose without closing it. I'm trying to replicate a possible error 
condition where the file might not be closed properly. When I run this



  
script on Apache 1.3 outside of Mod_Perl it works fine. When I run 
this script on Apache 1.3 with Mod_Perl 1.0 it works fine. When I run 
this script under Apache 2.0 Mod_Perl 2.0 it breaks (I'm on Red Hat 
Linux). Basically on the 2^nd open the file offset does not start at 
the beginning of the file as it does in my other tests. Further more 
it is not consistent but starts doing the Mod_Perl weirdness of 
sometimes working and sometimes not.


The code that is breaking has been working for years but has started 
to show errors when run under Mod_Perl 2.0 Apache 2.0.


Does anyone know what might have changed in Mod_Perl 2.0 to have 
caused this problem?


Thanks for your help,

Justin

Here is my test script:

my $strCGIPath = "";

if ((exists($ENV{'SCRIPT_FILENAME'}) || (defined 
($ENV{'SCRIPT_FILENAME'}


{

#Get absolute path to cgi-bin

$strCGIPath = $ENV{'SCRIPT_FILENAME'};

}

$strCGIPath =~ s/\/test.pl//;

my $strFileName = $strCGIPath . "/" . "test.txt";

open (QUESTIONFILE,'<' . $strFileName) or print "Cant find file";

binmode QUESTIONFILE;

#Get first line

$_ = ;

open (QUESTIONFILE,'<' . $strFileName) or print "Cant find file";

binmode QUESTIONFILE;

seek QUESTIONFILE, 0, 0;

#Get first line

$_ = ;

print $_;





  




Re: What would cause a SEGFAULT on startup

2007-05-21 Thread Foo JH

Tuc at T-B-O-H.NET wrote:

Hi,

Thanks for the reply, but unfortunately I can't on both accounts.
I realize this sounds weird, because of certain issues I need to bring this
up like another server. The only reason difference was I wanted to see if I
could get threaded perl running on this one. 


Over the weekend I backed down to regular perl, deleted and reinstalled
all my modules, and now modperl runs. 


I'm going to suggest to the FREEBSD maintainer that he put a check
that if your running threaded perl, to stop the build.
IIRC there were some arguments against running threaded perl on FreeBSD. 
But I remember if the issue was specific to the OS. So if you're 
installing Apache 1.3 off ports chances are the default config is for 
non-threaded mode.


You may get a much more technical response if you asked the freebsd 
mailing list. It's very happening over there.




Is it advisable NOT to limit MaxRequestsPerChild in Win32 modperl?

2007-05-24 Thread Foo JH

Hi all (my turn to ask modperl questions this time),

My persistent peeve with the Win32 Apache2.2 modperl is that it 
sometimes throws out this odd error:


[Mon Mar 05 21:19:47 2007] [notice] Parent: child process exited with 
status 3221225477 -- Restarting.


It's not very nice to have clients see an intermittent error when 
running the modperl app, so I'm trying a trick to see if this error can 
be minimised: by making modperl reload itself after x requests. This I 
accomplish by setting a small number (for testing) to 
MaxRequestsPerChild to see how modperl recovers from a reload.


Unfortunately at least on Win32, it does not.

I get this error when apache:
[Thu May 24 19:55:02 2007] [notice] Child 2404: Process exiting because 
it reached MaxRequestsPerChild. Signaling the parent to restart a new 
child process.
[Thu May 24 19:55:02 2007] [notice] Parent: Received restart signal -- 
Restarting the server.
[Thu May 24 19:55:02 2007] [notice] Apache/2.2.4 (Win32) mod_perl/2.0.3 
Perl/v5.8.8 configured -- resuming normal operations

[Thu May 24 19:55:02 2007] [notice] Server built: Jan  9 2007 23:17:20
[Thu May 24 19:55:02 2007] [crit] (22)Invalid argument: Parent: Failed 
to create the child process.
[Thu May 24 19:55:02 2007] [crit] (OS 6)The handle is invalid.  : 
master_main: create child process failed. Exiting.
[Thu May 24 19:55:02 2007] [notice] Parent: Forcing termination of child 
process 36
[Thu May 24 19:55:02 2007] [warn] (OS 995)The I/O operation has been 
aborted because of either a thread exit or an application request.  : 
winnt_accept: Asynchronous AcceptEx failed.

[Thu May 24 19:55:03 2007] [notice] Child 2404: Released the start mutex
[Thu May 24 19:55:03 2007] [notice] Child 2404: Waiting for 1 worker 
threads to exit.
[Thu May 24 19:55:05 2007] [notice] Child 2404: All worker threads have 
exited.

[Thu May 24 19:55:05 2007] [notice] Child 2404: Child process is exiting

Does anyone have any ideas if this can be resolved? Or is it a 'windows 
thing'?




Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 modperl?

2007-05-25 Thread Foo JH

Hello Perrin and Lionel,

Lionel MARTIN wrote:
Unless I'm mistaken, and even if there is only one (child) Apache 
process and several thread under Windows (winnt MPM), the only 
directive that can be used is MaxRequestsPerChild  and not 
MaxRequestsPerThread.


It is not possible to restart individual threads (and associated Perl 
Interpreteers), but only restart the child (which means restarting all 
the threads at once). So, basically, the value indicated by 
MaxRequestsPerChild is shared among all threads. (and its defaults 
value is 0, which means that your child is never restarted because of 
having handled too many requests).

Makes sense. I've tried inserting:
MaxRequestsPerThread 2

to httpd.conf, but it complains that 'perhaps misspelled or defined by a 
module not included in the configuration'. Which is quite true: I don't 
see any  tags for WinNT. Any suggestions?




That's a bit of pity, because that's like an "all or nothing" 
behaviour, you can't kill individual threads because they are growing 
too much.

I know. It's the curse of being a Windows developer. We're all screwed.


Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 modperl?

2007-05-25 Thread Foo JH

Thanks Lionel,

You meant when you dev. php, your apache did not load modperl at all, or 
it's just not used? Will there be a performance enhancement (as in no 
unexpected server restart) if you unload modperl totally?


Yeah, that silly error page makes people unsure about Apache on Windows. 
A real bummer.


Lionel MARTIN wrote:

Hi,

Actually I didn't see your original question, about the following error:
[Mon Mar 05 21:19:47 2007] [notice] Parent: child process exited with
status 3221225477 -- Restarting.

Actually, I am not even sure that this is due to MP2.

Indeed, on my development computer (running under Win XP, 
Apache/2.0.59), I am developing both PHP and Perl applications.

When developing for PHP, my Apache Server doesn't know about Mod Perl.

And yet, I'm keeping having the error you have, time to time, when 
loading my PHP pages.


Actually, the messages below are taken from my logs (Apache/2.0.59 and 
PHP 5.2.1)


[Fri May 25 10:01:24 2007] [notice] Parent: child process exited with 
status 3221225477 -- Restarting.
[Fri May 25 10:01:24 2007] [notice] Apache/2.0.59 (Win32) PHP/5.2.1 
configured -- resuming normal operations

[Fri May 25 10:01:24 2007] [notice] Server built: Jul 27 2006 15:55:03
[Fri May 25 10:01:24 2007] [notice] Parent: Created child process 3828
[Fri May 25 10:01:24 2007] [notice] Child 3828: Child process is running
[Fri May 25 10:01:24 2007] [notice] Child 3828: Acquired the start mutex.
[Fri May 25 10:01:24 2007] [notice] Child 3828: Starting 64 worker 
threads.


But that's quite transparent to the client, as it seems that after the 
restart, the page is served anyway. (but I get an ugly Windows error 
message box)


So, I think the problems we are encountering are more due to Apache 
than to ModPerl.


Lionel.



- Original Message - From: "Foo JH" <[EMAIL PROTECTED]>
To: "Lionel MARTIN" <[EMAIL PROTECTED]>
Cc: "Perrin Harkins" <[EMAIL PROTECTED]>; 
Sent: Friday, May 25, 2007 10:29 AM
Subject: Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 
modperl?




Hello Perrin and Lionel,

Lionel MARTIN wrote:
Unless I'm mistaken, and even if there is only one (child) Apache 
process and several thread under Windows (winnt MPM), the only 
directive that can be used is MaxRequestsPerChild  and not 
MaxRequestsPerThread.


It is not possible to restart individual threads (and associated 
Perl Interpreteers), but only restart the child (which means 
restarting all the threads at once). So, basically, the value 
indicated by MaxRequestsPerChild is shared among all threads. (and 
its defaults value is 0, which means that your child is never 
restarted because of having handled too many requests).

Makes sense. I've tried inserting:
MaxRequestsPerThread 2

to httpd.conf, but it complains that 'perhaps misspelled or defined 
by a module not included in the configuration'. Which is quite true: 
I don't see any  tags for WinNT. Any suggestions?




That's a bit of pity, because that's like an "all or nothing" 
behaviour, you can't kill individual threads because they are 
growing too much.

I know. It's the curse of being a Windows developer. We're all screwed.







Re: Is it advisable NOT to limit MaxRequestsPerChild in Win32 modperl?

2007-05-25 Thread Foo JH

Perrin Harkins wrote:

On 5/25/07, Lionel MARTIN <[EMAIL PROTECTED]> wrote:
Unless I'm mistaken, and even if there is only one (child) Apache 
process
and several thread under Windows (winnt MPM), the only directive that 
can be

used is MaxRequestsPerChild  and not MaxRequestsPerThread.


You're right, MaxThreadsPerlChild is available in other MPMs, but not
the winnt one.

So...I'm screwed?



Re: Which template engine is best to create a perl site

2007-06-06 Thread Foo JH



Sorry, but I suspect there's a mistake in your test.  Possibly you
counted the time for JIT to do the initial compile, which is slow but
only happens once.  HTML::Template::Compiled is fast, but it's not as
fast as JIT.  I don't recommend actually using JIT though, since it's
harder to debug template coding mistakes with, and HTML::Template is
fast enough.

Just want to add: faster if you cache the template.


Loading Win32::OLE in a modperl package

2007-06-08 Thread Foo JH

Hi all,

I wonder if I am alone in experiencing this. Simply put: putting 'use 
Win32::OLE' in my modperl package will cause the Apache to fault. It 
basically can't start at all.
A window will pop up complaining about 'Apache HTTP Server has 
encountered a problem and needs to close'. No entry into the error log.


Does anyone know if this can be worked around?



Re: Loading Win32::OLE in a modperl package

2007-06-08 Thread Foo JH

Thanks Lionel,

I'm running Apache2.2 + Perl5.88.

Try this piece of code:

package MyPackage;
use strict;
use warnings;
use Win32::OLE;

sub handler
{
   my $r = shift;
  
   $r->content_type('text/plain');

   print 'hello';
  
   return Apache2::Const::OK;

}

1;

Lionel MARTIN wrote:

Basically,

Doing, in test.pl, run by ModPel::Registry, something like:

use Win32::OLE;
print 'Hello';

Works prefectly...

Which versions (Apache, MP and Perl) are you running?


----- Original Message - From: "Foo JH" <[EMAIL PROTECTED]>
To: "mod_perl" 
Sent: Friday, June 08, 2007 10:29 AM
Subject: Loading Win32::OLE in a modperl package



Hi all,

I wonder if I am alone in experiencing this. Simply put: putting 'use 
Win32::OLE' in my modperl package will cause the Apache to fault. It 
basically can't start at all.
A window will pop up complaining about 'Apache HTTP Server has 
encountered a problem and needs to close'. No entry into the error log.


Does anyone know if this can be worked around?






Re: Loading Win32::OLE in a modperl package

2007-06-08 Thread Foo JH

Hey Lionel,

Will try, and let you guys know...but I am officially 18 minutes from 
hitting the weekends...:)


Lionel MARTIN wrote:

Hi again,

Did you try finally try out with Apache 2.0?

If this works with Apache 2.0, but not with Apache 2.2, then, it would 
perhaps be useful to point this out.


Lionel.

- Original Message - From: "Foo JH" <[EMAIL PROTECTED]>
To: "Lionel MARTIN" <[EMAIL PROTECTED]>
Sent: Friday, June 08, 2007 11:21 AM
Subject: Re: Loading Win32::OLE in a modperl package



Thanks Lionel.

Damn. I was hoping I won't need to 'regress' into Apache 2.0. But 
thanks a lot for suggesting a way out for me.


Lionel MARTIN wrote:

Hi again,

I tried our code, using as well this directive in my httpd.conf file:

PerlResponseHandler MyPackage

To make your handler work as the main Response Handler.

Moreover I had to alter your code to make it work, adding a:

use Apache2::RequestRec;

because otherwise, the content_type method is not defined.

And it worked perfectly (returning 'hello';)









Re: Loading Win32::OLE in a modperl package

2007-06-10 Thread Foo JH

Thanks for the clarification. In other words: avoid Win32::OLE in modperl?


Jan Dubois wrote:

On Fri, 08 Jun 2007, Foo JH wrote:
  

I wonder if I am alone in experiencing this. Simply put: putting 'use
Win32::OLE' in my modperl package will cause the Apache to fault. It
basically can't start at all. A window will pop up complaining about
'Apache HTTP Server has encountered a problem and needs to close'. No
entry into the error log.

Does anyone know if this can be worked around?



Using Win32::OLE in a multi-threaded way is generally not safe.  It is
definitely not working correctly if you use the threads.pm module or
fork() emulation.

It could potentially work in a multi-threaded environment if each
interpreter is created independently (not using perl_clone()).  When
using the COM apartment threading model then each interpreter also
needs to be bound to a specific thread, as it is then invalid to
invoke methods on a COM object from any other thread than the one
that created it.

Cheers,
-Jan 



  




Re: [mp2] The right way to use CGI parameters in a handler

2007-06-10 Thread Foo JH
I've kinda moved out of CGI since I started using modperl for primarily 
2 reasons: speed and functionality.


You'd see that Apache2::Request exposes more stuff, which you can 
(lazily) use. Unless you are looking for some backward compatibility to 
tradditional CGI programming, why not embrace the entire modperl library?


Colin Wetherbee wrote:

Hello!

It's been about four years since I've used mod_perl to any great 
extent, and I'm afraid I'm somewhat rusty.  I'm trying to create a 
handler that can parse CGI parameters, but I'm unsure of the most 
modern way of doing that.


I know Apache2::Request is supposed to be able to grab CGI parameters; 
is that "better" than using CGI.pm?  How about these APR modules that 
seem to wind their way into the framework?


When I tried creating an Apache2::Request->new($r) object to use to 
get CGI parameters, I found that everything I tried to print after the 
object's instantiation wouldn't show up anywhere.  All the pages 
served were zero bytes, and I couldn't even print to STDERR.


Here's a simple handler I wrote.  It works, but I'm afraid I might be 
doing something incorrectly by mixing Apache2 and CGI.  I'm wondering 
how it would look if someone who was more up-to-date on mod_perl wrote 
it? :)


# BEGIN CODE BLOCK
use Apache2::Const -compile => qw(OK);
use CGI;

sub handler
{
  my ($r) = @_;

  my $cgi = CGI->new($r);

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

  if (defined $cgi->param('foo'))
  {
print 'foo: ' . $cgi->param('foo') . "\n";
  }

  return Apache2::Const::OK;
}
# END CODE BLOCK

Thanks. :)

Colin




Re: which module for this purpose?

2007-06-14 Thread Foo JH
A couple of ways I can think of. Code-wise, you can have modperl handle 
all requests to /download/. So a request to /download/test.flv will 
activate a modperl script which can do the checks you want (and return 
404 if needed). Otherwise it will load the file specified in the uri and 
send it back.


Jen mlists wrote:

Hello members,

I would config/write a modperl module to do this thing.
When someone access a file which is located on special directory,say 
it was,

/download/test.flv
we would do some auth check.If his IP or request time were
reasonable,we could let him access this file.Otherwise we would return
a 403 error.

What's the correct module/way for protect this directory?
Thanks!




Re: which module for this purpose?

2007-06-14 Thread Foo JH
Clinton's approach may be better (with PerlAccessHandler). Try that 
approach first...


Basically to return a file content over there's not much work to be done:
1. Set the content mime type to octet/ application
2. open a file for reading as you normally would - via the open() and 
close() functions

3. convert to base64 and send it over


Jen mlists wrote:

2007/6/14, Foo JH <[EMAIL PROTECTED]>:

Otherwise it will load the file specified in the uri and
send it back.


Then how can I "load the file and send it back" under modperl?Do I
need to call some routines like socket read/write?
Please show me more details.Thanks a lot.




modperl2 + apache2.2 unable to restart

2007-06-14 Thread Foo JH

Hi all,

I was hoping to migrate my apps to the apache2.2 platform. The apps are 
fine, except that I notice now it's not possible to restart the app - 
the message 'The requested operation has failed!' pops up.


I am running mp2 + libapreq2 + apache2.2 + perl 5.8.8

Can anyone confirm if they have the same problem as well? This needs to 
be rectified because apache on windows will throw a fault and restart 
occasionally.


My test code is as follows:
package AppTest;
use strict;
use warnings;
use Apache2::Request;
use Apache2::Const -compile => qw(OK);
  
sub handler

{
   my $r = shift;
  
   eval {

   $r->content_type('text/plain');
   print 'hello world '.time;
   };
   if ($@)
   {
   $r->content_type('text/plain');
   print "Error:\n\n".$@;
   }

   return Apache2::Const::OK;
}

1;

and my http.conf is as follows:
LoadFile "c:/Perl/bin/perl58.dll
LoadModule perl_module modules/mod_perl.so

LoadFile bin/libapreq2.dll
LoadModule apreq_module modules/mod_apreq2.so

Listen 

PerlSwitches "-Ilib"

   Order Allow,Deny
   Allow from all



   SetHandler perl-script
   PerlResponseHandler AppTest




Re: which module for this purpose?

2007-06-14 Thread Foo JH



All you need to do (assuming mod_perl2) is:
 - set the content-type (to whatever file type you are sending)
 - use $r->sendfile('filename')

See
http://perl.apache.org/docs/2.0/api/Apache2/RequestIO.html#C_sendfile_
  

Good point. Something learnt today.



Re: which module for this purpose?

2007-06-14 Thread Foo JH




Yes I did also consider using mp2.But when I searched on this list and
found many guys mentioned they install/run mp2 unsucessfully,so I
picked the easy way of mp1.:-)
You SHOULD seriously consider mp2. There's 2 platforms on mp2: Apache 
2.0 and Apache 2.2 If you're on Windows I'd suggest 2.0 (I seem to have 
some issues on restarting Apache2.2 with mp2 on).


Apache2 + mp2 is fine basically. Everything you need works and works 
well. Go fo it.




Re: modperl2 + apache2.2 unable to restart

2007-06-15 Thread Foo JH

Perrin Harkins wrote:

On 6/14/07, Foo JH <[EMAIL PROTECTED]> wrote:

I was hoping to migrate my apps to the apache2.2 platform. The apps are
fine, except that I notice now it's not possible to restart the app -
the message 'The requested operation has failed!' pops up.


What's the actual error from the error_log?

Below shows apache shutting and and restarting...and failed.

[Thu Jun 14 17:30:19 2007] [notice] Parent: Received restart signal -- 
Restarting the server.
[Thu Jun 14 17:30:19 2007] [notice] Child 5780: Exit event signaled. 
Child process is ending.
[Thu Jun 14 17:30:20 2007] [notice] Apache/2.2.4 (Win32) 
mod_apreq2-20051231/2.6.0-dev mod_perl/2.0.3 Perl/v5.8.8 configured -- 
resuming normal operations

[Thu Jun 14 17:30:20 2007] [notice] Server built: Jan  9 2007 23:17:20
[Thu Jun 14 17:30:20 2007] [crit] (22)Invalid argument: Parent: Failed 
to create the child process.
[Thu Jun 14 17:30:20 2007] [crit] (OS 6)The handle is invalid.  : 
master_main: create child process failed. Exiting.

[Thu Jun 14 17:30:20 2007] [notice] Child 5780: Released the start mutex
[Thu Jun 14 17:30:21 2007] [notice] Child 5780: Waiting for 20 worker 
threads to exit.
[Thu Jun 14 17:30:21 2007] [notice] Child 5780: All worker threads have 
exited.

[Thu Jun 14 17:30:21 2007] [notice] Child 5780: Child process is exiting
[Thu Jun 14 17:30:50 2007] [notice] Parent: Forcing termination of child 
process 36



Appreciate any insight you may have. I'd really like to move on to 2.2 
if possible.




Unable to install libapreq2-2.0 from theoryx5

2007-06-17 Thread Foo JH

Hello all,

Since the issue with the Apache restart has not been resolved, I've been 
looking into downgrading my Apache framework to 2.0 (instead of 2.2).


I have hit a minor issue: I can't install libapreq2-2.0. I keep getting 
this error:
ppm install failed: Can't find any package that provide mod_perl for 
libapreq2-2.0


Even though I am sure I have installed mod_perl 2.0:
ppm install http://theoryx5.uwinnipeg.ca/ppms/mod_perl-2.0.ppd

Can anyone confirm that libapreq2-2.0 is having strangely?

My server signature:
Apache/2.0.59 (Win32) mod_perl/2.0.3 Perl/v5.8.8 Server at localhost Port 80

Thanks.



Re: mod perl version

2007-06-20 Thread Foo JH

2 ways:
1. If you're using Apache 2, you can only using modperl2. There's no 
other way.
2. If you turn on ServerSignature in httpd.conf, you will see the 
signature at the footer of a http error page.


[EMAIL PROTECTED] wrote:

Hi Folks,
 
How will I find which mod perl version I am using, I am using Apache 
2.0 so I believe it should be mod perl 2 but is there any way to 
confirm this
 
Thanks,
 
 
 

The information contained in this electronic message and any 
attachments to this message are intended for the exclusive use of the 
addressee(s) and may contain proprietary, confidential or privileged 
information. If you are not the intended recipient, you should not 
disseminate, distribute or copy this e-mail. Please notify the sender 
immediately and destroy all copies of this message and any attachments.


WARNING: Computer viruses can be transmitted via email. The recipient 
should check this email and any attachments for the presence of 
viruses. The company accepts no liability for any damage caused by any 
virus transmitted by this email.


www.wipro.com





Re: Where to store uploads

2007-07-03 Thread Foo JH
Depending on the number of files you're expecting, you may want to limit 
the number of files you put in a single folder. For example, in your 
shared folder you may want to create 26 subfolders - one for each letter 
of the alphabet. Then you drop the files in the subfolder matching the 
first letter of the filename. There's a bit of creative play on the 
subfolder 'hash', depending again on your expected filename format.


Clinton Gormley wrote:

Following on from the thread "questions on serving big file & SQL
statement parsing", I have a related question:

Where do you store your uploads?

I can think of two approaches:

1) In the DB, store the name of the server to which your file has been 
   uploaded


2) Store your upload in a shared partition (eg on a SAN, NFS, 
   iSCSI/OCFS2)


The advantage I see in the second approach is redundancy, the
disadvantage is that there will be a slight performance cost.

Anybody have recommendations/war-stories about these or other
approaches?

thanks

Clint

  




Re: First time being here, Need Big help here!

2007-07-08 Thread Foo JH
I'm not too good with Debian either, but since you're installing a new 
OS, my guess is you can also choose the version of the applications as well.


Try installing Apache 2 or 2.2 with modperl 2, instead of Apache 1.3 + 
modperl. The latter is running on legacy support now.


Xin Chen wrote:

Hi All,

Finally I find this place, I think it is the right place for me to 
solve this issue, here it is:


My system: VMware Virtual System:

brainzvm:~# uname -a
Linux brainzvm 2.6.18-4-686 #1 SMP Mon Mar 26 17:17:36 UTC 2007 i686 
GNU/Linux

apache-perl 1.3 web server
Debian Linux

I got the following errors when I was trying to setup a debian web 
server.


[Thu Jul  5 18:53:42 2007] [error] Undefined subroutine 
&MusicBrainz::Server::Handlers::WS::1::Auth::handler called.\n
Cache MISS on istagger-192.168.11.1 at 
/home/httpd/musicbrainz/mb_server/cgi-bin/MusicBrainz/Server/Handlers.pm 
line 274
[Thu Jul  5 18:53:43 2007] [error] Can't locate 
Apache/AuthDigest/API.pm in @INC (@INC contains: 
/home/httpd/musicbrainz/mb_server/cgi-bin /etc/perl 
/usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 
/usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 
/usr/local/lib/site_perl /usr/local/lib/perl/5.8.7 
/usr/local/share/perl/5.8.7 . /etc/apache-perl/ 
/etc/apache-perl/lib/perl) at 
/home/httpd/musicbrainz/mb_server/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Auth.pm 
line 32.\nBEGIN failed--compilation aborted at 
/home/httpd/musicbrainz/mb_server/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Auth.pm 
line 32.\nCompilation failed in require at (eval 239) line 3.\n


Then I tried to install Apache::AuthDigest.
#cpan
#install Apache::AuthDigest
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1121: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1140: 
error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1141: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1142: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1143: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1147: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1149: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1150: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1155: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1156: 
error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1157: 
error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1160: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1161: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1165: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1170: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1173: 
error: expected declaration specifiers or '...' before 'server_rec'
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1174: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1175: 
error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1267: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1269: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1270: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1281: 
error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1282: 
error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1283: 
error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1284: 
error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1290: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1291: 
error: expected ')' before '*' token

API.c: In function 'XS_Apache__AuthDigest__API_note_digest_auth_failure':
API.c:24: error: 'Apache' undeclared (first use in this function)
API.c:24: error: (Each undeclared identifier is reported only once
API.c:24: error: 

Re: Performance Questions

2007-07-08 Thread Foo JH




Let us know how it goes - using XSLT that way is often desirable from 
a developer's point of view, but is usually impractical due to the 
processing overhead.  If you end up successfully using this technique 
in production without complaints from users please let the list know, 
I'm sure a few other people are curious too!
Just a personal opinion: wouldn't xslt juice out the cpu faster than a 
conventional template engine (eg. HTML::Template)? If you are running a 
fairly high-use environment, you may want to implement stuff that is 
easy on the processor.


Thinking aloud though, perhaps if the xslt engine caches the compiled 
xslt file, performance may improve...




Re: First time being here, Need Big help here!

2007-07-08 Thread Foo JH
I doubt. Apache2 is a major overhaul. You're better off installing 
apache2 or 2.2 from scratch.


Do note that modperl1 is not compatible with apache 2.

Xin Chen wrote:
Can I just update from apache1.3 to apache 2, and modperl 2 ? I will 
try this.

Thanks!

Foo JH wrote:

I'm not too good with Debian either, but since you're installing a 
new OS, my guess is you can also choose the version of the 
applications as well.


Try installing Apache 2 or 2.2 with modperl 2, instead of Apache 1.3 
+ modperl. The latter is running on legacy support now.


Xin Chen wrote:


Hi All,

Finally I find this place, I think it is the right place for me to 
solve this issue, here it is:


My system: VMware Virtual System:

brainzvm:~# uname -a
Linux brainzvm 2.6.18-4-686 #1 SMP Mon Mar 26 17:17:36 UTC 2007 i686 
GNU/Linux

apache-perl 1.3 web server
Debian Linux

I got the following errors when I was trying to setup a debian web 
server.


[Thu Jul  5 18:53:42 2007] [error] Undefined subroutine 
&MusicBrainz::Server::Handlers::WS::1::Auth::handler called.\n
Cache MISS on istagger-192.168.11.1 at 
/home/httpd/musicbrainz/mb_server/cgi-bin/MusicBrainz/Server/Handlers.pm 
line 274
[Thu Jul  5 18:53:43 2007] [error] Can't locate 
Apache/AuthDigest/API.pm in @INC (@INC contains: 
/home/httpd/musicbrainz/mb_server/cgi-bin /etc/perl 
/usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 
/usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 
/usr/local/lib/site_perl /usr/local/lib/perl/5.8.7 
/usr/local/share/perl/5.8.7 . /etc/apache-perl/ 
/etc/apache-perl/lib/perl) at 
/home/httpd/musicbrainz/mb_server/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Auth.pm 
line 32.\nBEGIN failed--compilation aborted at 
/home/httpd/musicbrainz/mb_server/cgi-bin/MusicBrainz/Server/Handlers/WS/1/Auth.pm 
line 32.\nCompilation failed in require at (eval 239) line 3.\n


Then I tried to install Apache::AuthDigest.
#cpan
#install Apache::AuthDigest
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1121: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1140: 
error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' 
token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1141: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1142: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1143: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1147: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1149: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1150: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1155: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1156: 
error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' 
token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1157: 
error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' 
token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1160: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1161: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1165: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1170: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1173: 
error: expected declaration specifiers or '...' before 'server_rec'
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1174: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1175: 
error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' 
token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1267: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1269: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1270: 
error: expected ')' before '*' token
/usr/lib/perl5/auto/Apache/include/modules/perl/mod_perl.h:1281: 
error: expected '=

ModPerl on Apache 2.2 not suitable for Windows platform

2007-07-09 Thread Foo JH

Hi all,

This is a summarised follow-up on my earlier post detailing my concerns 
with modperl on Apache2.2 (with the latest installations of ActivePerl + 
modperl) not being to restart gracefully. In other words, during a 
restart it crashed and stopped.


I have received similar observations from Randy Kobes. If there is 
someone who figured a way to resolve, hope to hear from you.


In the meantime, modperl on Apache 2.2 (in Win32 environment) seems to 
be more stable so far.


Hope this helps.



Re: First time being here, Need Big help here!

2007-07-09 Thread Foo JH

Don't understand what you mean. To rephrase myself:

Apache 1.3 uses modperl 1
Apache 2.0 and 2.2 uses modperl 2

Does this help?

[EMAIL PROTECTED] wrote:

In the sentence "> Do note that modperl1" is that mod_perl 1.x or is that an
extra 'el'?  i assume mod_perl 2 works with apache 2.x


On Mon, 09 Jul 2007 11:11:13 +0800 [EMAIL PROTECTED] wrote:
  
I doubt. Apache2 is a major overhaul. You're better off installing 
apache2 or 2.2 from scratch.


Do note that modperl1 is not compatible with apache 2




Re: DBI and threaded MPM

2007-07-11 Thread Foo JH

Anthony Gardner wrote:
Perrin, I never received your mail (actually, I hardly receive any 
mails form this list) I have to go to the archives to see if I've 
received any replies or to see what's been posted in general!!
You may want to check with your email admin on this. There's posting on 
this list almost daily!




Re: UTF-8 in mod_perl

2007-07-11 Thread Foo JH

You will want to do 2 things:
1. Set the content type to utf8 ($r->content_type)
2. Encode your output to utf8 (if it's not done already. Sometimes it's 
just latin1)



Cristina Nunes wrote:

Hi.

I was wondering how I could set the mod_perl (1.x) STDOUT (and STDERR)
to expect utf8 char encoding?

In perlrun, you can just set it by using -CS parameter, ie, `perl -CS
-le 'print "olé"'`, or at runtime binmode(STDOUT, ":utf8");

Thanks,
Cristina





Re: Can't call method "prepare" on an undefined value

2007-07-22 Thread Foo JH
Does this happen during idle period? MySQL does disconnect when the idle 
is too long.


Dustin D. wrote:
I'm having countless problems with mod_perl and not even sure where to 
start.  I thought I had mod_perl up and running in my development 
environment, so I pushed the new changes + apache configuration out to 
my production environment, and immediately began tail -f on the logs.


What I noticed was, most of the time, everything was working fine.  
But it seemed like every few minutes, there would be a burst of the 
following errors:


Can't call method "prepare" on an undefined value at 
modules//MySQLBroker.pm line 1059.\n


What's strange is, when this error would pop up, it would flood 5-10 
errors like this in a row, all within the span of a few seconds.  Then 
things would return to normal and I wouldn't get any errors for awhile.


On my site, I'm getting hits every couple of seconds, if not more 
frequently.  In my startup.pl, I have something like this to 
initialize the MySQL connection:


Apache::DBI->connect_on_init("DBI:mysql:mydb: 127.0.0.1 
", "dustin", "mypass",

{
 PrintError => 1, # warn( ) on errors
 RaiseError => 0, # don't die on error
 AutoCommit => 1, # commit executes immediately
}
);

(NOTE: for the hostname, I was using localhost for awhile, and decided 
to use a direct ip in case localhost is actually being resolved, to 
get rid of one more layer of translation)


My code around line 1059 in MySQLBroker.pm looks like this:

sub _mysql_exec {
  my ($self, $dbcall) = @_;
  my @resultsArray;
  my $count=0;
  my $sth = $self->{_dbh}->prepare("$dbcall");
  $sth->execute or die "Cannot execute database command!";
  while (my @array = $sth->fetchrow) {
push @resultsArray, [EMAIL PROTECTED];
  }
  $sth->finish;
  return [EMAIL PROTECTED];
}

Also, on a fairly inconsistent basis, I'm also getting "not a CODE 
reference" errors.


To me, it just seems like mod_perl is very unreliable and 
unpredictable.  The same code that worked reliably (albeit slow) in 
the CGI world is now extremely unpredictable in the mod_perl world.


FYI, I'm aware of the persistent state issues in a mod_perl world and 
have gone to great lengths to debug any persistent state issues that 
might be affecting things.


At this point in time, I'm extremely tempted to rewrite everything in 
PHP.  I really want to avoid that, but mod_perl is causing me too many 
headaches to justify it, as I've already wasted a week of effort 
trying to migrate my site from CGI to mod_perl.


Thanks,
Dustin




Re: [mp2+Win32] Frustration over Apache 2.0/ 2.2 restart failure

2007-08-10 Thread Foo JH

Hi all,

A little more tests reveal the following:

If Apache was not installed in the default location (c:\program 
files\apache foundation\apache2.2) and instead installed into a path 
that does not have spaces (eg. c:\Apache2.2), while restarting will 
still fail, you can manually start the service again much faster; almost 
immediately after it stops. It is possible to write a monitoring windows 
service to start the apache service if it detects that it has stopped, 
but it's not quite the elegent solution that people want to hear about.


So while it's better, it's still not good enough. Apache must still be 
able to perform a restart on its own.


Any suggestions?

Foo JH wrote:

Hi all,

I am rather disappointed (and a little frustrated as well) on 
modperl's inability to survive an Apache restart on the Windows 
platform. The platform combo tested are Windows 2003 + Apache 2.2 (and 
Apache 2.0) + modperl2 + libapreq2


I have come to accept the fact that once in a while modperl on Win32 
will segfault, but the old Apache I tried (year 2005 iirc) seems to 
recover, though it threw a windows fault dialog that scared the wits 
out of my clients. But this time it's just unacceptable. The odd thing 
is, if you try to start apache after it failed, it will fail again. 
You have to wait about a minute (or more) before starting the server.


I don't mind any creative workarounds. Please share with me any 
suggestions or tips that can circumvent this. Thanks much.






Re: SV: [mp2+Win32] Frustration over Apache 2.0/ 2.2 restart failure

2007-08-10 Thread Foo JH

Hello Henrik,

Yes we have conversed earlier and shared the pain on this same point. My 
FreeBSD installations were relatively painless in comparison to the 
Win32 counterparts.


The sad truth is that my clients are more comfortable with Windows OS, 
and I have to support our products on this platform. It's either I get 
modperl to work, or we have a product overhaul to move over to .NET 
(which I hope will not happen).


It's quite strange that nobody else has this problem. It's definately a 
critical operational concern. I am starting to suspect that Perl/ 
modperl is quietly exclusive to the non-Windows world.


I hope someone in this community can prove me wrong...

Henrik Schak Hansen wrote:

Hi Foo

I finally gave up on Apahce/modperl2 on win32 in various version
combinations. I kept hoping that newer versions of apache/modperl would
stabilize it but rather it seemed to get worse. Daily apache/modperl
would fail and modperl would restart maybe 10 time within a few minutes
before finally working again. Only because I have a load balancer in
front of several web servers have I been able to keep going.
Anyway, now I have moved to Linux a week ago, and so fare I haven't
experienced any problems (except having to tweak different parameters).
So I cross my fingers and hope it will stay this way.

Not much of help for you I know, but I remember we have talked about
this before

Regards
Henrik Schak Hansen




-Oprindelig meddelelse-
Fra: Foo JH [mailto:[EMAIL PROTECTED] 
Sendt: 10. august 2007 10:10

Til: modperl@perl.apache.org
Emne: [mp2+Win32] Frustration over Apache 2.0/ 2.2 restart failure

Hi all,

I am rather disappointed (and a little frustrated as well) on modperl's
inability to survive an Apache restart on the Windows platform. The
platform combo tested are Windows 2003 + Apache 2.2 (and Apache 2.0) +
modperl2 + libapreq2

I have come to accept the fact that once in a while modperl on Win32
will segfault, but the old Apache I tried (year 2005 iirc) seems to
recover, though it threw a windows fault dialog that scared the wits out
of my clients. But this time it's just unacceptable. The odd thing is,
if you try to start apache after it failed, it will fail again. You have
to wait about a minute (or more) before starting the server.

I don't mind any creative workarounds. Please share with me any
suggestions or tips that can circumvent this. Thanks much.


---
[Denne E-mail blev scannet for virus af Declude Virus]
[This E-mail was scanned for viruses by Declude Virus]

  




[mp2+Win32] Frustration over Apache 2.0/ 2.2 restart failure

2007-08-10 Thread Foo JH

Hi all,

I am rather disappointed (and a little frustrated as well) on modperl's 
inability to survive an Apache restart on the Windows platform. The 
platform combo tested are Windows 2003 + Apache 2.2 (and Apache 2.0) + 
modperl2 + libapreq2


I have come to accept the fact that once in a while modperl on Win32 
will segfault, but the old Apache I tried (year 2005 iirc) seems to 
recover, though it threw a windows fault dialog that scared the wits out 
of my clients. But this time it's just unacceptable. The odd thing is, 
if you try to start apache after it failed, it will fail again. You have 
to wait about a minute (or more) before starting the server.


I don't mind any creative workarounds. Please share with me any 
suggestions or tips that can circumvent this. Thanks much.




Re: SV: [mp2+Win32] Frustration over Apache 2.0/ 2.2 restart failure

2007-08-11 Thread Foo JH

Hello Perrin, William

Unfortunately I'm packaging a product based on modperl, so I can't 
really take any shortcuts on this one.


William, my installation process is (what I hope to be) straight out of 
the book. To elaborate:

1. Install ActiveState Perl MSI 5.8.8 (build 822)
2. Install Apache2.2.4 MSI
3. Install modperl as per documentation on httpd.apache.org. Ie: perl 
install http://theoryx5.uwinnipeg.ca/ppms/mod_perl.ppd

4. Install libapreq from theoryx5

In my http.conf, I only added the following:
LoadFile c:/Perl/bin/perl58.dll
LoadModule perl_module modules/mod_perl.so

LoadFile bin/libapreq2.dll
LoadModule apreq_module modules/mod_apreq2.so

Apache/ modperl starts up fine, but if I try to restart the service, it 
will not survive.


Please share with me any tips to improve the situation. I'm open to any 
ideas.


Thanks.



Perrin Harkins wrote:

On 8/10/07, Foo JH <[EMAIL PROTECTED]> wrote:
  

The sad truth is that my clients are more comfortable with Windows OS



Is it possible that if they have a small enough site to run
comfortably on Windows, they can run it through CGI?  I suspect that
whatever issue you're having with mod_perl could be fixed, but it
seems pointless to fight with it if the site has low traffic and can
run as CGI.

- Perrin
  




Re: SV: [mp2+Win32] Frustration over Apache 2.0/ 2.2 restart failure

2007-08-12 Thread Foo JH

William, the point I was trying to make is:

1. My restart test scope merely loads modperl + libapreq. There is ZERO 
application code loaded. In other words, all I did after installing 
modperl + libapreq is to ONLY load them into httpd.conf:

LoadFile c:/Perl/bin/perl58.dll
LoadModule perl_module modules/mod_perl.so

LoadFile bin/libapreq2.dll
LoadModule apreq_module modules/mod_apreq2.so

Noticed there is no other code loaded. No database used. Super duper 
minimal test model.


2. When you said that you managed to get modperl to survive an apache 
restart on a Win32 OS, I'm really keen to understand how you have done 
it differently. Is it because you are not using libapreq? Or is the 
default installation settings not optimal?



Foo, you missed my point all together.

Something in YOUR PERL APP is opening resources that are "locked" and will
prevent another process from obtaining them for approx 60 seconds.

What, why and how are your puzzles, I'm afraid.  There's nothing in the
"generic" apache/perl/modperl that did this to you.

More debugging logs, finer debugging details might help you pin it down.
  




Frustration over Apache 2.0/ 2.2 restart failure => possible package found

2007-08-13 Thread Foo JH

Hello Henrik, all,

With kind references from the modperl community, I've managed to confirm 
a working Win32 modperl stack that will survive an apache restart based 
on zero application code config. Not only does this stack do exactly 
that, it is based on a more recent Visual C++ compiler, and claims 
improved performance over the reference binary from Apache.


Please check out the binaries from:
http://www.apachelounge.com/download/

To summarise the procedures:
1. Install Apache 2.2 binaries from ApacheLounge
2. Install ActivePerl (I tested on build 822)
3. Install modperl via ppd from ApacheLounge
4. Install libapreq2 from http://theoryx5.uwinnipeg.ca/ppms/
5. Insert the following into httpd.conf
ServerSignature on
LoadModule perl_module modules/mod_perl.so
LoadFile "C:/Apache2/bin/libapreq2.dll"
LoadModule apreq_module modules/mod_apreq2.so

My test OS is Windows 2003.

Henrik, I hope this is good news for you.

Thanks guys.

Henrik Schak Hansen wrote:

Hi Foo

I finally gave up on Apahce/modperl2 on win32 in various version
combinations. I kept hoping that newer versions of apache/modperl would
stabilize it but rather it seemed to get worse. Daily apache/modperl
would fail and modperl would restart maybe 10 time within a few minutes
before finally working again. Only because I have a load balancer in
front of several web servers have I been able to keep going.
Anyway, now I have moved to Linux a week ago, and so fare I haven't
experienced any problems (except having to tweak different parameters).
So I cross my fingers and hope it will stay this way.

Not much of help for you I know, but I remember we have talked about
this before

Regards
Henrik Schak Hansen




-Oprindelig meddelelse-
Fra: Foo JH [mailto:[EMAIL PROTECTED] 
Sendt: 10. august 2007 10:10

Til: modperl@perl.apache.org
Emne: [mp2+Win32] Frustration over Apache 2.0/ 2.2 restart failure

Hi all,

I am rather disappointed (and a little frustrated as well) on modperl's
inability to survive an Apache restart on the Windows platform. The
platform combo tested are Windows 2003 + Apache 2.2 (and Apache 2.0) +
modperl2 + libapreq2

I have come to accept the fact that once in a while modperl on Win32
will segfault, but the old Apache I tried (year 2005 iirc) seems to
recover, though it threw a windows fault dialog that scared the wits out
of my clients. But this time it's just unacceptable. The odd thing is,
if you try to start apache after it failed, it will fail again. You have
to wait about a minute (or more) before starting the server.

I don't mind any creative workarounds. Please share with me any
suggestions or tips that can circumvent this. Thanks much.


---
[Denne E-mail blev scannet for virus af Declude Virus]
[This E-mail was scanned for viruses by Declude Virus]

  




Using modperl from ApacheLounge

2007-08-14 Thread Foo JH

Hi all,

Earlier on I was sharing the discovery of an alternative binary for 
Apache on Win32 at Apache Lounge (http://http://www.apachelounge.com). 
Here are some updates on the implementation:


1. There are binaries for Apache 2.2 and modperl2, but none for 
libapreq2. The ppd from theoryx5 works though.


2. Still have to be careful with spaces in directories. Seems to work, 
though OS will pop up a httpd failure message. Can be scary to the client.


3. Apache2::Reload seems to be responsible for crashing the httpd 
service at OS startup. But if you take omit it from httpd.conf during 
the first Apache service start, stop the service, add it 
(Apache2::Reload) back in, Apache will start and restart without 
problems. In other words, you can use it during development, but not 
during deployment.







Using Apache 2.2 from ApacheLounge for Win32 modperl

2007-08-18 Thread Foo JH

Hi all,

While ApacheLounge makes available a Win32 binary of Apache2.2 that 
seems to work better for modperl than the distribution from apache.com, 
be advised that if you intend to use libapreq2, you may not want to use 
the mod_perl binary from ApacheLounge.


I don't have the technical details, but if you try to use ApacheLounge's 
mod_perl and theoryx5's libapreq, you will not be able to use 
Apache2::Reload at the very least.


For some reason, the MSI version of ActivePerl (tested with build 822) 
is more stable than the AS version in terms of starting up httpd on 
system startup, and service restarts. So please avoid the latter.


My recommendation:
1. Use the Apache2.2.x binary from ApacheLounge
2. Use the MSI version of ActivePerl, NOT the AS version
3. Use the mod_perl library from theoryx5, NOT from ApacheLounge
4. Use the libapreq2 library from theoryx5

Tested on Windows XP SP2 x86



Re: Using Apache 2.2 from ApacheLounge for Win32 modperl

2007-08-20 Thread Foo JH



Actually note that it isn't a release and is being rerolled.  Seems
Apachelounge is doing themselves and their users a disservice, again.
  
I disagree. ApacheLounge's binary distribution is the only one that 
(configured with modperl) survives an application restart. As I posted 
in an earlier mail, ASF's binaries do not work in modperl setups. So far 
I have not received any response (only verifications) that contradict my 
findings.


I applaud the people who put in effort (AND maintain a web site for 
that) to fix a long-standing problem, and share it with the 
professionals at large. It's a lot of work, and it takes a great spirit 
to think for the rest of us code compiler noobs.





Re: Using Apache 2.2 from ApacheLounge for Win32 modperl

2007-08-20 Thread Foo JH




This might be a result of what was mentioned before about possible 
problems using the binaries from http://www.apachelounge.com/download/ 
(which is compiled with VC++ 2005) with ActivePerl and 
ActivePerl-compatible ppm packages (which are compiled with VC++ 6). 
Mixing these can lead to conflicts, as discussed at, eg,

 http://search.cpan.org/src/SHAY/Win32-UTCFileTime-1.46/INSTALL
You're probably right. The only saving grace is the Apache binaries seem 
to be nicely decoupled from the modperl/ libapreq2 code. I have not had 
much issues marrying them together. The only thorn I'm dealing with is 
that spaces in directory names is not good.


But I can live with that.




Re: Configuring Mod_perl and Apache web Server

2007-08-21 Thread Foo JH

Read up on this document and other related ones:
http://perl.apache.org/docs/2.0/user/config/config.html

Read this also:
http://perl.apache.org/docs/2.0/os/win32/index.html

usha rani wrote:

hi,
 
We would like to have information regarding configuration of 
MOD_PERL 2.0.3 with Apache Server -2.2.4 

version in cygwin.
  
 I need some information regarding configuration of httpd.conf  
file, what are the changes we have to make

 in httpd.conf file for MOD_PERL.
 
 If any one knows the information please reply back to me.
 
with thanks®ards,

Usha.

--
www.g-billboards.com 




Re: Internal Server Error

2007-08-21 Thread Foo JH


So on the first case,we need to write the handler as 
sub handler { my $r = shift; ...}

because Apache may call the function directly as Package::Name::handler.

on the second case,we write handler as,
sub handler { my $class = shift; my $r = shift; ... }
because '->' is a method calling.

Am I right?
btw,I always used the first config.
Are there any technical advantages with either method, or is it a 
TIMTOWDI option given to the developers?


Re: Internal Server Error

2007-08-23 Thread Foo JH

Hello Perrin,

I'm interested in how you defined your handler with the 'method' attribute:
sub handler : method {
...

I've read http://perldoc.perl.org/attributes.html about attributes, but 
it does not seem to suggest that tagging the method attribute to 
subroutine has any programming advantages, unless you're interested to 
list the subroutines with that attribute. But I suspect there's more to it.


Perhaps you can clue me in on this?

Perrin Harkins wrote:

On 8/21/07, Jeff Pang <[EMAIL PROTECTED]> wrote:
  

PerlHandler Package::Name

instead of:

PerlHandler Package::Name->handler

  

So on the first case,we need to write the handler as
sub handler { my $r = shift; ...}
because Apache may call the function directly as Package::Name::handler.

on the second case,we write handler as,
sub handler { my $class = shift; my $r = shift; ... }
because '->' is a method calling.



For method handlers, you also have to declare it differently.

In mod_perl 1:
sub handler ($$) {

In mod_perl 2:
sub handler : method {

- Perrin
  




Re: Migrate LWP::UserAgent + HTTP::Request to mod_perl2

2007-08-27 Thread Foo JH
What's the error msg you see?

Nguyen Vu Hung wrote:
> Hi all,
>
> The following code run without problems under Apache 1.3.29, Perl 5.6.1,
> mod_perl 1.29.
>
> Under the new environment which is Apache 2.0.52, Perl 5.8.8, mod_perl
> 2.0.3 ( Cent OS 4.5 ), it won't run.
>
> I have read through mod_perl2's compat page[1] and rename[2] page, but I
> didn't find any useful information on how to get this code running under
> the new environment.
>
> Please shed me a light!
>
> use LWP::UserAgent;
> use HTTP::Request;
>
> my $user_agent = LWP::UserAgent->new;
> my $ua_request HTTP::Request->request->new($some_request});
> $ua_request->content_type('application/x-www-form-urlencoded');
> $ua_request->content($param);
> my $rreq = $ua_request->content_ref;
> $$rreq =~ s/%2F/\//g;
> $req->header('Content-Length' => length($ua_request->content));
> my $respond = $user_agent->request($ua_request);
>
> unless ($respond->is_success) {
> # $respond failed HERE! why?
> }
>
> [1] http://perl.apache.org/docs/2.0/user/porting/compat.html
> [2] http://perl.apache.org/docs/2.0/rename.html
>   



Re: PerlRequire executed 4 times on apache startup

2007-08-28 Thread Foo JH
I've had this same experience on Win32 Apache 2 as well. It could be 
related to the MPM model that the Win32 implementation employs.


Tobias Zeising wrote:

Hi all,

I have a weird problem: on startup apache executes 4 times a Perl Script
I included via

 PerlPostConfigRequire startup.pl

in the httpd.conf. The startup script contains following code:

 #!/usr/bin/perl

 my $file = 'c:\tmp\test.txt';
 open(INFO ,">>$file") || die "Error $!";
 print INFO "test\n";
 close INFO;
 print STDERR "test...\n";
 1;

After starting the apache server (with an empty test.txt) the error.log
contains as expectet one time "test..." and the test.txt contains
curiously four times "test". That means apache has executed the
startup.pl four times.

I have found http://modperlbook.org/html/ch04_07.html but that "apache
config test" would only explain the execution of two times.

Actually the startup.pl contains some code for preloading a huge amount
of modules, so this needs about 10 seconds instead of 2 or 3.

Hope anybody knows or can explain this behaviour.

Thanks and best regards
 Tobi
  




Re: The "mod_perl2 User's Guide" book is out

2007-09-10 Thread Foo JH

I've been waiting for this book for the longest time...

Stas Bekman wrote:

Hi everybody,

Jim Brandt, Allison Randal and I are happy to announce that the first 
book about mod_perl2: The "mod_perl2 User's Guide" has been published 
and available for purchase. See the book's site: 
http://modperl2book.org/ for details.


50% of this book's proceeds will go The Perl Foundation 
[http://www.perlfoundation.org/].


Please help us spread the word using your favorite social bookmarks 
service: digg, reddit, del.icio.us, etc.. Feel free to post the links 
here for others to vote for to avoid splits. Here is a quick way to 
access many of those services at once:
http://socialposter.com/generator.php?c=all&tip=links&url=http%3A%2F%2Fmodperl2book.org%2F&title=mod_perl2%20User's%20Guide&text= 



Thank you and enjoy the book!





Re: apache2 graphs

2007-09-19 Thread Foo JH

You can consider ImageMagick. It works on standard Perl apps as well.

Eli Shemer wrote:


Hey there

What replacement do I have for Apache::GD to work on mod_perl 2 ?

 


Thanks.

 





Re: Newbie - Samples or Tutorials

2007-09-23 Thread Foo JH

aqua wrote:

Thanks for your email. I am actually looking for current "mod perl" related 
tutorials and not just Perl related. This HoptScripts site contains 3 mod_perl related 
tutorials and they are very old (2000).
Why not drop by Amazon and pick up the mod_perl 2 book instead? It's 
just released:

http://www.amazon.com/mod_perl-Users-Guide-Stas-Bekman/dp/0977920119


Re: booking should be captured only on the last page

2007-09-23 Thread Foo JH

Is there a qn to this?

Perl wrote:

I have two different pages having different form. All the forms are having
the same Action(input.htm). I need to modify  the code such that that the
details can be recorded in the database only after parsing the second page
.That means for the first page it should go to the loop (Declined)and for
the second page reverse.

 unless ( ($r->method eq "POST") && ($r->uri =~ /$bookingURL/)) 
  {

$log->info("$moduleName: skipping ". $r->method ." request to ", $r->uri
);
$log->info("$moduleName: Declining...");

return Apache2::Const::DECLINED;
  }



Page 1.html
Form
Id  NameMethod  Action
member  member  postinput.htm


Page 2.html
Form
Id  NameMethod  Action
bookerConfirm   bookerConfirm   postinput.htm

Thanks.
  




Best version of Apache for Win32 deployment

2007-10-02 Thread Foo JH

Hi all,

Just want to share something I read today (fairly old news) at ApacheLounge:
http://www.apachelounge.com/forum/viewtopic.php?t=1907

Since many (most?) people who use Apache from Apache Lounge also use 
mod_fcgid and/or mod_perl, it seems that 2.2.5 will remain the best 
Apache version to use until Apache 2.2.7 comes out.


It is expected that new versions of mod_fcgid and mod_perl will be 
needed for Apache 2.2.7, because the proposed changes will not be 
backward-compatible with Apache 2.2.5 and earlier.


My point is that for Win32 modperlers, you may want to check out 2.2.5, 
and hold out for 2.2.7 (and a potentially new release of modperl to 
support it).


Re: Best version of Apache for Win32 deployment

2007-10-03 Thread Foo JH


Right.  Except there is no 2.2.5; 
2.2.5 is not released on the Apache web site. Those who want this 
version can get it at ApacheLounge.



Of course 2.2.4 essentially worked, while 2.2.7 will give the modperl'ers
on Windows something they have BEGGED for forever, the chance to see parsing
errors at startup from their httpd.conf file(!!!)
  

Yes! It's been egging me for the longest blistering time!




Re: Best version of Apache for Win32 deployment

2007-10-03 Thread Foo JH

Octavian Rasnita wrote:
Regarding the best Apache for Windows, I have a problem running Apache 
under

windows and I think this thread might help me.

I tried Apache 2.2.4 with and without SSL support, and Apache 2.2.6 from
apachelounge, but they still don't work.
I'm using 2.2.4 now on Win32, and it's running good for me. Much much 
better than the 2.x.x series from the Apache site. Works on XP and W2k3.


A point to note though is that you should not use the modperl 
compilation from AL. Use the standard-issue one from theoryx5. Install 
libapreq2 from theoryx5 also.


Apache 2.2.6 is not recommended for Win32 iirc. Don't touch it.

Of course, your problems may be compounded (but I'm not sure) by the 
other components you are using (Catalyst)? For me, I'm just living off 
HTML::Template, DBI, and some other libraries. You may want to be more 
explicit on the errors you're encountering, and at which points did the 
install break.


Re: Best version of Apache for Win32 deployment

2007-10-03 Thread Foo JH



Because you used theoryx5's perl/modperl/libapreq2 built for VC8, along with
the AL build of 2.2.4 ALSO built for VC8, everything is dandy.

Equally if you used ActiveState perl (built VC6) + a VC6 build of modperl and
libapreq2 with the ASF distribution of httpd 2.2.4, everything is dandy.
  
Is there a VC6 build of modperl + libapreq2? I've been following the 
links on the ASF site, so it's always been theoryx5.


To date I've been using ActivePerl all the way, so it's still a combo of 
VC6 Perl + VC8 modperl. But so far so good...



Mix and match at your own risk.
  




Re: Best version of Apache for Win32 deployment

2007-10-03 Thread Foo JH



I haven't looked into this, but the fact that AL's
mod_perl (compiled, presumably, with VC8) doesn't
work with, again presumably, ActivePerl (compiled
with VC6) may be another example of the dangers
of mixing components compiled with VC6 and VC8.

Point taken.



Re: Best version of Apache for Win32 deployment

2007-10-03 Thread Foo JH
Sorry man, I'm not too familiar with Catalyst, so I can't pinpoint the 
problem. But if your tests are good with a clean install of Apache2 + 
mp2, you may want to check compiler used to build Catalyst (see Randy's 
email on the VC used for ActivePerl, Apache, and modperl). I suppose 
Catalyst is not a pure-perl implementation?


Re: Apache 2.2.6 and mod_perl 2.0.3

2007-10-03 Thread Foo JH
You may want to hold back on 2.2.6. Use either 2.2.4 from ASF or 2.2.5 
from ApacheLounge.


Tracy E Schreiber wrote:

Hi,

I believe that mod_perl 2.0.3 is not compatible with Apache 2.2.6. Starting 
Apache gives this error:


httpd.exe: Syntax error on line 31 of D:/Apache/conf/httpd.conf: Cannot load
D:/Apache/modules/mod_perl.so into server: The specified module could not be 
found.


This worked fine under 2.2.4, so the configuration is not the problem. The 
mod_perl.so was retrived using ppm install 
http://theoryx5.uwinnipeg.ca/ppms/mod_perl-2.0.ppd.


Any one able to get mod_perl.so to work with Apache 2.2.6

Thanks,
Tracy




  




Re: Apache 2.2.6 and mod_perl 2.0.3

2007-10-04 Thread Foo JH

Why don't you read about what's new in 2.2:
http://httpd.apache.org/docs/2.2/new_features_2_2.html

Jeff Pang wrote:

Hello,
Does apache2.2+mp2 have much advantage than apache2.0+mp2?

2007/10/4, Foo JH <[EMAIL PROTECTED]>:
  

You may want to hold back on 2.2.6. Use either 2.2.4 from ASF or 2.2.5
from ApacheLounge.

Tracy E Schreiber wrote:


Hi,

I believe that mod_perl 2.0.3 is not compatible with Apache 2.2.6. Starting
Apache gives this error:

httpd.exe: Syntax error on line 31 of D:/Apache/conf/httpd.conf: Cannot load
D:/Apache/modules/mod_perl.so into server: The specified module could not be
found.

This worked fine under 2.2.4, so the configuration is not the problem. The
mod_perl.so was retrived using ppm install
http://theoryx5.uwinnipeg.ca/ppms/mod_perl-2.0.ppd.

Any one able to get mod_perl.so to work with Apache 2.2.6

Thanks,
Tracy





  





  1   2   >