RE: mod_perl2: nmake test crashes apache

2002-05-10 Thread Alessandro Forghieri

Greetings.

[...]
 Apache builds and installs fine, mod_perl2 builds fine but running
 `nmake test` crashes the instance of apache2 created by the 
 TEST script.
[...]

I have exactly the same behavior with May 6 snapshots  (Visual Studio 6SP3,
WinNT SP6) - quoting myself from a different thread:

[RE: mod_perl failing on win32 (CVS snapshots)]
[...]
Yup. My 'nmake test' now segfaults at conftree.t, with an access violation
somewhere in perl56.dll

By running restricted test suites, I found out that the culprit appears to
hide somewhere
in compat2.t, i.e the sequence:

  perl -Mblib t\test t/apache/compat2.t t/apache/conftree.t

wedges, whereas:

   perl -Mblib t\test t/apache/cgihandler.t t/apache/compat.t
t/apache/conftree.t
   perl -Mblib t\test t/apache/cgihandler.t t/apache/conftree.t
   perl -Mblib t\test t/apache/compat.t t/apache/conftree.t


are clean.

(But note that for instance: perl -Mblib t\test t/apache/compat2.t
t/apache/post.t
also works. Combinatorial explosion, anyone?)
[...]

My test output is exactly the same as yours down to the memory addresses in
the segfault dialog box.

From hints in the above mentioned thread, looks like people running XP are
experiencing fewer or different problems in the test suite.

Cheers,
alf





Re: mod_perl2: nmake test crashes apache

2002-05-10 Thread pascal barbedor


 By running restricted test suites, I found out that the culprit appears to
 hide somewhere
 in compat2.t, i.e the sequence:

   perl -Mblib t\test t/apache/compat2.t t/apache/conftree.t

 wedges, whereas:

perl -Mblib t\test t/apache/cgihandler.t t/apache/compat.t
 t/apache/conftree.t
perl -Mblib t\test t/apache/cgihandler.t t/apache/conftree.t
perl -Mblib t\test t/apache/compat.t t/apache/conftree.t


 are clean.

 (But note that for instance: perl -Mblib t\test t/apache/compat2.t
 t/apache/post.t
 also works. Combinatorial explosion, anyone?)
 [...]

 My test output is exactly the same as yours down to the memory addresses
in
 the segfault dialog box.

 From hints in the above mentioned thread, looks like people running XP are
 experiencing fewer or different problems in the test suite.

Hi

about combinatorial I think not only compat2 is involved here in test suites
I have ran
on win2k (i have the same problem mentionned)
with apache 2.035 or 2.036 modeperl.1.99-02-dev
here is a resume of previous post

with perl t/test dirtest :

dirtest=api:
api/access :ok
api/aplog : apache segfault

dirtest=apr
apr/base34 :ok
apr/constants : ok
apr/date apache segfault

dirtest=apache
apache/cgihandler : ok
apache/compat: ok
apache/compat2:ok
apache/conftree : apache segfault

dirtest=directive
directive/env failed 1-3, 4 ok
directive/prelmodule : ok
directive/perlrequire : ok
directive/setupenv : apache segfault

dirtest=filter
all tests succesfull

dirtest=hooks
hooks/access : ok
hooks/authen : ok 2/4 and 3 segfault

dirtest=modperl
modperl/dirconfig : failed tests 6-12 failed 7/12 tests (this reminds me my
previous post about dir_config not working) and apache segfaults

dirtest=protocol
protocol/echo ok
protocol/filter ok
protocol/eliza skipped

dirtest=module
modules/cgi ok 2/5 and apache segfaults...

-

also running tests with

perl t\test -start-httpd
perl -Mblib t\test t/apache/conftree.t
perl -Mblib t\test t/apache/compat2.t

segfaults at compat2

perl t\test -start-httpd
perl -Mblib t\test t/apache/conftree.t
perl -Mblib t\test t/apache/compat.t

segfaults at compat

perl t\test -start-httpd
perl -Mblib t\test t/apache/write.t
perl -Mblib t\test t/apache/compat.t
perl -Mblib t\test t/apache/compat2.t
perl -Mblib t\test t/apache/conftree.t

segfault at conftree

perl t\test -start-httpd
perl -Mblib t\test t/apache/compat.t
perl -Mblib t\test t/apache/conftree.t
perl -Mblib t\test t/apache/compat2.t

segfault at compat2

perl t\test -start-httpd
perl -Mblib t\test t/apache/compat2.t
perl -Mblib t\test t/apache/conftree.t

segfault at conftree

---

also all test run individually perl t/test some_test_alone
pass

EXCEPT :

modules/cgi produces apache segfault

modperl/dir_config fails with message : error examine t\logs\error_log,
which log says the well known error with dir_config :

[Mon May 06 21:38:18 2002] [error] [client 62.147.163.25] Attempt to free
unreferenced scalar at C:\modperl-2.0\t\response/TestModperl/dir_config.pm
line 71.

best regards
pascal







Re: [RFC] Dynamic image generator handler

2002-05-10 Thread Mark Fowler

On Wed, 8 May 2002, Michael A Nachbaur wrote:

With regard to dynamic image creation

 The most basic uses of this application will to dynamically generate TTF
 text for titles, buttons, sidebars, etc. The current version of this
 code does this, and quite well. Foreground and background colors, font
 name (with bold/italic support), font size, image size (or automatically
 detected based on the size of the text), and rotation.

I've been working on something like this using GD. Mainly I've been 
thinking about the interface which (as always) seems to the hardest thing 
to do properly.

It's not an Apache module (though it is designed with mod_perl in mind.)  
Some form of wrapping module would have to go around it.

Hmm.  How about I upload the POD so you can see what I mean.

htpp://2shortplanks.com/temp/gdti/

Note that this is a work in progress.  This code doesn't work yet (though 
previous hacky versions did.)  Yours sounds much more advanced.

 The basic text support could be extended to allow for images to be
 overlayed on the text (or placed under the text), or stretch images
 similarly to how Enlightenment displays window manager themes.

Hmm, yes.  I have it so the image can be aligned in various ways.  It's 
not quite up to stretching it yet, but we shall see.

 Other uses planned would be to manipulate existing images. For instance,
 if an image on a website needs a thumbnail, medium size and full-size
 view, normally a person must make all versions by hand. If any
 formatting needs to be done, like borders or drop-shadows, this
 increases complexity. If a person could just drop an image in a
 directory, and link to that image, the image could automatically be
 resized, borders added, drop shadows put in place. The resulting image
 would then be cached, and outputted.

Hmm, getting a little complicated here.  My program outputs a GD::Image 
object when done.  The idea is that you can then use GD to implement any 
of the things you're missing.

Also, the stages where it draws the background, the border, the text, and 
so on are all different methods.  This allows you to override these 
methods with your own ones in subclasses, so you can intercept the image 
creation at various stages and step in to do things first (e.g. draw to 
the background before the bg image is drawn)

 *) URI Arguments
 
 Information about what is to be done is passed through the URI. This
 works for simple tasks like text display, but if anything more
 complicated is to be done, external configuration files must be used.
 We'll get to that in a bit.

I was working on several different encoding schemes that you could use on 
the URL.  Primarily these were:

 * Base64 alike encoding

 * A scheme where   was replaced with _ and entities could be used

Primely I'm only concerned about the text that you want rendered.  
Everything else was going to be read from a config file/set in the 
httpd.conf.

I was also planning to implement Template Toolkit plugins to allow you to 
easily create these images.

 Essentially, arguments are passed using the PATH_INFO HTTP header. We
 want the browser to think this is an actual file, instead of a
 dynamically generated image, so that the browser is more inclined to
 cache the content. So, a typical query would be:
 
   http://localhost/genText/font=ArialBold;size=24;fgcolor=#ff;
   bgcolor=#00;rotate=90;text=This+Is+The+Text

This is indeed a key concept.  More importantly I designed my schemes so 
that they could actually be saved to disk with that filename.  One 
possible idea would be to place the image creation in an ErrorHandler 
which returns the image and writes it to the correct location on disk.  
Thus the next time the image is called the perl code is skipped all 
together and the image is simply sucked off of the disk.  I think Randal 
did a column on something like this a while back.

 *) Configuration Files

I was thinking of using a system accessible in the httpd.conf for the 
apache module.

 The real important part here, is the name attribute of any
 element, as this identifies where input can be indicated.

In my scheme each location was a different font.  So:

 http://twoshortplanks.com/f/xmason/1st.jpg

Is the image 1st in the xmason style. (yes, that link works)

An important aspect is that styles in my system can be created from other
styles using the -clone() method.

So for example, to create heading2 you could use:

my $heading2 
  = $heading1-clone(text_size = ($heading1-text_size() * 0.8));

All the other attributes would stay the same (colour, background image
etc, etc.)

The configuration file should reflect that.

 *) Caching Schemes

I hadn't really considered caching systems.  Sounds good.

 Note: To prevent the filesystem from filling up, due to DoS attacks, it
 may be prudent to have a cron job periodically cull files that have the
 oldest access time.

Or have the handler do it itself after it's returned an image.  You'd also 
want the handler 

RE: mod_perl2: nmake test crashes apache

2002-05-10 Thread Alessandro Forghieri

Greetings,

[...]
Hi
 
 about combinatorial I think not only compat2 is involved here 
 in test suites I have ran
[...]

Wow. this is great detective work you have done Pascal.
I have tried to go deeper and actually debug the thing. However, while I can
get a debug version of apache I am stumped on a few counts:

o) mod_perl does not compile with MP_DEBUG=1 
  (complains about an undefined _MP_debug_level) - and I doubt it is doing
THE RIGHT
  THING anyways, because it adds a truely gcc-ish  '-g' flag to the command
line...
   
o) mod_perl does not build against 5.007003 bleadperl 
   (I wanted to test whether bleadperl had the same problem)

o) the crash erases the call stack so all I can do is staring  at 

mov edi,dword ptr [esi]

Not very useful.

And for the Curioser and curioser! department: I happened to run the test
suite with
a shell anvironment containing DEBUG=0 and TRACE=0 (ask not why...). Under
these circumstances the test suite spins endlessly on conftree.t (rather
than crashing). Folklore, perhaps, and hardly an improvement, but I am
wondering who is checking those two variables? If I remove them from my
environment, I get my  old friend the crash back.

Cheers,
alf




Re: mod_perl2: nmake test crashes apache

2002-05-10 Thread Stas Bekman

Alessandro Forghieri wrote:

about combinatorial I think not only compat2 is involved here 
in test suites I have ran

 Wow. this is great detective work you have done Pascal.

Actually you didn't have to do the detective work. Apache::Test comes 
with a detective of its own. Just run t/SMOKE and it'll find all the 
combinations that fail.

Though I cannot help you on WinFU :( Hopefully Randy or Doug will hear you.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: [RFC] Dynamic image generator handler

2002-05-10 Thread Randal L. Schwartz

 Michael == Michael A Nachbaur [EMAIL PROTECTED] writes:

Michael This is a mod_perl handler, not directly tied in with my
Michael content management system, but is/will be used extensively by
Michael it. The premise is to dynamically generate images, cache
Michael them, and present them to browser clients. The URI, as well
Michael as Apache configuration directives, is used to determine what
Michael is to be generated.

Like http://www.stonehenge.com/merlyn/LinuxMag/col33.html
perhaps?  Been there, Done that.  Feel free to steal the code.

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



Re: mod_perl2: nmake test crashes apache

2002-05-10 Thread Randy Kobes

On Fri, 10 May 2002, Stas Bekman wrote:

 Alessandro Forghieri wrote:

 about combinatorial I think not only compat2 is involved here
 in test suites I have ran

  Wow. this is great detective work you have done Pascal.

 Actually you didn't have to do the detective work. Apache::Test comes
 with a detective of its own. Just run t/SMOKE and it'll find all the
 combinations that fail.

 Though I cannot help you on WinFU :( Hopefully Randy or Doug will hear you.

I haven't been able to come up with much more either ...
Running individual tests as, eg,
perl -Mblib t/TEST t/apache/post.t
shows most pass (some, like dir_config.t, partially fail, but
the error log, or running in verbose mode, shows why).
However, when running groups of tests, like
nmake test
or
perl -Mblib t/TEST t/apache
things hang, or crash, after about the 2nd or 3rd test in
the group. It's hard to see which particular one's at
fault, though, as running the tests randomly:
perl -Mblib t/TEST t/apache -order=random
still hangs after about the 2nd or 3rd test, whichever one
that happens to be. Running in verbose mode shows that,
when a test hangs, it doesn't even get to the 1st subtest.

I tried running the tests by, rather than using Win32::Process,
having Apache-Test install and start a service, but there was no
difference in the results. As well, this seems to be a problem
particular to the mod_perl tests, as such behaviour doesn't arise
with the httpd-test suite in testing pure httpd-2. However, in
some limited random manual testing, I haven't seen an analogous
problem outside of the Apache-Test framework - does anyone have
such an example?

best regards,
randy




RE: [modperl2] Note on the win32 docs

2002-05-10 Thread Randy Kobes

On Wed, 8 May 2002, Alessandro Forghieri wrote:

 The script that follows *DOES* in fact send a header (so my previous msg. is
 partly wrong; I am used to read/write print
 $q-header(-content_type=text/html) rather than  simply print header,
 but then I am rather long winded. OTOH the  script coming *before* the
 section does not send the content-type header).

 I still think that PerlSendheader On is needed in the conf: when I omit it,
 I see an extra content-type header in the page content itself, that
 disappears after I insert the above directive.

You're right - PerlSendHeader On should be there ... I'll
modify the draft accordingly. Thanks.

best regards,
randy





Problems with mod_perl installation(HELP!!!)

2002-05-10 Thread Jose Ortiz



People :



 I had spent more than 2 months trying to make mode_perl on my RH 72. First I tried with

the RPMSbut it didn't works. Then I tryied with the tar.gz and I can't neither.

It prompts the following compilation error:util.c: In function `ap_find_token':


util.c:1410: `test_char_table' undeclared (first use in this function)
util.c:1410: (Each undeclared identifier is reported only once
util.c:1410: for each function it appears in.)
util.c:1410: `T_HTTP_TOKEN_STOP' undeclared (first use in this function)
util.c: In function `ap_escape_shell_cmd':
util.c:1469: `test_char_table' undeclared (first use in this function)
util.c:1469: `T_ESCAPE_SHELL_CMD' undeclared (first use in this function)
util.c: In function `ap_escape_path_segment':
util.c:1596: `test_char_table' undeclared (first use in this function)
util.c:1596: `T_ESCAPE_PATH_SEGMENT' undeclared (first use in this function)
util.c: In function `ap_os_escape_path':
util.c:1625: `test_char_table' undeclared (first use in this function)
util.c:1625: `T_OS_ESCAPE_PATH' undeclared (first use in this function)
make[4]: *** [util.o] Error 1


and some times it says that can't open the shared file libperl.so

--
Jose R. Ortiz Ubarri
Cs. Student  Programmer



Re: [RFC] Dynamic image generator handler

2002-05-10 Thread Michael A Nachbaur

On Fri, 10 May 2002 08:32:55 +0200
Robert [EMAIL PROTECTED] wrote:

 Take a look at Apache::ImageMagick

In my benchmarks I ran, ImageMagick was way slower than GD.  I wrote a
little test, rendering a little text image of 120x30.  With ImageMagick,
I was getting 0.3 rps, and under GD with similar circumstances I was
getting 1.5rps.  I'm sure I could've optimized the ImageMagick one a bit
further, but that quick test settled it for me.

I looked at Apache::ImageMagick last night however, and although it
seems pretty usefull, it doesn't really address what I want to do with
my module.

-- 

-man
Michael A Nachbaur

PGP Public Key at http://www.nachbaur.com/pgpkey.asc
PGP Key fingerprint = 83DC 7C3A 3084 6A21 9A3F  801E D974 AFB4 BFD7 2B6F



RE: [modperl2] Note on the win32 docs

2002-05-10 Thread Doug MacEachern

On Fri, 10 May 2002, Randy Kobes wrote:
 
 You're right - PerlSendHeader On should be there ... I'll
 modify the draft accordingly. Thanks.

actually, the 2.0 config is:

 PerlOptions +ParseHeaders

PerlSendHeader On is just alias of that for backwards compat.





Re: [RFC] Dynamic image generator handler

2002-05-10 Thread Michael A Nachbaur

On Fri, 10 May 2002 10:52:31 +0100 (BST)
Mark Fowler [EMAIL PROTECTED] wrote:
  The basic text support could be extended to allow for images to be
  overlayed on the text (or placed under the text), or stretch images
  similarly to how Enlightenment displays window manager themes.
 
 Hmm, yes.  I have it so the image can be aligned in various ways. 
 It's not quite up to stretching it yet, but we shall see.

I'm not either, all my module supports currently is text.

  Essentially, arguments are passed using the PATH_INFO HTTP header.
  We want the browser to think this is an actual file, instead of a
  dynamically generated image, so that the browser is more inclined to
  cache the content. So, a typical query would be:
  
http://localhost/genText/font=ArialBold;size=24;fgcolor=#ff;
bgcolor=#00;rotate=90;text=This+Is+The+Text
 
 This is indeed a key concept.  More importantly I designed my schemes
 so that they could actually be saved to disk with that filename.  One 
 possible idea would be to place the image creation in an ErrorHandler 
 which returns the image and writes it to the correct location on disk.
  Thus the next time the image is called the perl code is skipped all 
 together and the image is simply sucked off of the disk.  I think
 Randal did a column on something like this a while back.

Yes, like I say in my caching section, I sort the arguments and then MD5
them, and thats the name of the file on disk. So
/tmp/Imagecache/0/1/A/098FAD9 etc.

I actually do this process in the URI Transformation phase.  I intercept
a request, check to see if the given arguments already has a cache entry
on disk, and if so, I change $r-filename() to that location on disk. 
Otherwise, I generate it, and again point to that filename...I then let
Apache serve the file.

  *) Configuration Files
 
 I was thinking of using a system accessible in the httpd.conf for the 
 apache module.

I want to stay away from httpd.conf-based config files.  Although great
for most things, the configuration of different image styles can be very
site-specific, so I wouldn't want to have to reboot every time someone
makes a change.  In addition to this, I would like image styles to be
editable through my Content Management System; if it's based in the
httpd.conf (or even an .htaccess file), that means I'm giving a customer
access to the control of the webserver, and that makes the hair stand up
on the back of my neck.

Rather, I could define an XML configuration file, and use a directive in
the httpd.conf (or .htaccess) to point to the relevant configuration
file for that site/location.

  *) Caching Schemes
 
 I hadn't really considered caching systems.  Sounds good.
 
  Note: To prevent the filesystem from filling up, due to DoS attacks,
  it may be prudent to have a cron job periodically cull files that
  have the oldest access time.
 
 Or have the handler do it itself after it's returned an image.  You'd
 also want the handler to keep a scoreboard of how many images have
 been generated in the last x minutes to stop generating for things
 like runaway spiders (though OTOH, this could probably be better
 handled by another module somewhere else in the chain)

I'm trying to keep from tying up the httpd processes unnecessarily.  I
just want to generate an image, and then pass it off to apache as fast
as possible.  If I have to disk scan (or even maintain a scoreboard in
memory), I'm not sure how that would affect performance.  It might not
be a bad idea to add a scoreboard, but I don't want it to have to do too
much.

  Looking forward, I would like to be able to use this for more than
  just text. I'd like my customers to be able to select an image, set
  the maximum size, check a few boxes or radio buttons to say what
  formatting options they'd like, and the image is automagically
  resized without wasting disk space or taking a long time to
  download.
 
 Disk space cheap, CPU cycles expensive.

Disk space cheap, CPU cycles expensive, web developer time *really*
expensive.  So, auto-generate, and load from disk cache.

  I'm sure there are plenty of other uses for this, but I'll leave it
  at this.
 
 I'm warey of creating a all too powerful module.  It's taken me an age
 to come up with an interface that I think (IMHO) that has a sensible
 user interface.  I wouldn't want to create something too powerful.

Unfortunately for me, I need to add these fancy-dancy features.  The
reason I'm coming back to this module of mine is because I need to have
background images behind text, semi-transparency of multi-layered
images, and resizing/scaling of images with borders and shadows, etc.

-- 

-man
Michael A Nachbaur

PGP Public Key at http://www.nachbaur.com/pgpkey.asc
PGP Key fingerprint = 83DC 7C3A 3084 6A21 9A3F  801E D974 AFB4 BFD7 2B6F



Re: mod_perl2: nmake test crashes apache

2002-05-10 Thread Doug MacEachern

the issue with all segfaults on win32 is related to the use of the 
internal perl variable PL_sv_no.  not sure what the real problem is, but 
avoiding use of PL_sv_no has cured all segfaults on win32.  the fixes have 
been checked into cvs.
there are still a few tests that fail, but none that trigger a segfault.






Re: Problems with mod_perl installation(HELP!!!)

2002-05-10 Thread Stas Bekman

[Please make sure to reply back to the list! Thanks]

Jose Ortiz wrote:
 People :
 
 I had spent more than 2 months trying to make mode_perl on my RH 72. First I 
tried with
 
 the RPMS but it didn't works.  Then I tryied with the tar.gz and I can't neither.

very unlikely that it doesn't work, try following the steps as explained 
in the guide: perl.apache.org/guide/install.html

make sure that you get the latest apache-1.3.24 and mod_perl_1.24

when reporting bugs/problems, please follow the instructions here:
http://perl.apache.org/preview/modperl-docs/dst_html/docs/1.0/guide/help.html#How_to_Report_Problems

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




PerlVINC and Can't locate Foo.pm in @INC ...

2002-05-10 Thread Aaron J Mackey


Banging my head against the wall a bit, 'cause this is just so simple, but
still not working:

Versions: Apache 1.3.22, mod_perl 1.26, perl 5.6.1

relevant lines from httpd.conf:

  PerlWarn On
  PerlModule Apache::PerlVINC

  Location /dat-ajm6q
SetHandler  perl-script
PerlHandler DAT::Client::WWW

PerlINC /home/ajm6q/cvs/dat-head/lib
PerlFixupHandlerApache::PerlVINC
PerlVersion DAT/Client/WWW.pm
  /Location

Error log when access is attempted (other standard directories edited out
for brevity):

[Fri May 10 13:39:39 2002] [error] Can't locate DAT/Client/WWW.pm in INC
(INC contains: /home/ajm6q/cvs/dat-head/lib [... edited out ...]) at
/usr/lib/perl5/site_perl/5.6.1/i386-linux/Apache/PerlVINC.pm line 55.

The file is, of course, actually there:

% ls -l /home/ajm6q/cvs/dat-head/lib/DAT/Client/WWW.pm
-rwxrwxr-x1 ajm6qwebwork   394 May 10 12:40 
/home/ajm6q/cvs/dat-head/lib/DAT/Client/WWW.pm


What am I missing?

thanks for any help,

-Aaron




Re: Problems with mod_perl installation(HELP!!!)

2002-05-10 Thread Geoffrey Young



Stas Bekman wrote:

 [Please make sure to reply back to the list! Thanks]
 
 Jose Ortiz wrote:
 
 People :

 I had spent more than 2 months trying to make mode_perl on my RH 
 72. First I tried with

 the RPMS but it didn't works.  Then I tryied with the tar.gz and I 
 can't neither.
 
 
 very unlikely that it doesn't work, try following the steps as explained 
 in the guide: perl.apache.org/guide/install.html


there's also recipe 1.4 from the cookbook, which details a unix install from source 
(in 
addition to various binary installations):

http://www.modperlcookbook.org/chapters/ch01.pdf

we geeks tend to forget how frustrating a process it is doing this for the first time 
:)

my first install was on RedHat 5.2 and it was a pain - I was missing so many libraries 
and 
dependencies that I had to reinstall RedHat to satisfy all the RPM crud.  keep in mind 
that you typically need the 'developer' libraries (the ones that contain the header 
and 
other source files, as opposed to just the binaries) for redhat in order to compile 
stuff 
from source - glibc-devel in particular comes to mind.


 
 make sure that you get the latest apache-1.3.24 and mod_perl_1.24


also, start by making sure you can get Apache to compile by itself before moving to a 
mod_perl-enabled Apache.

all this seems a bit daunting, dave harris and I wrote this part of the guide:

http://perl.apache.org/guide/install.html#using_RPM_and_other_packages_to_

which explains how to go about using mod_perl from an RPM.  it's rather dated now, but 
the 
basic steps are still the same.


 
 when reporting bugs/problems, please follow the instructions here:
 
http://perl.apache.org/preview/modperl-docs/dst_html/docs/1.0/guide/help.html#How_to_Report_Problems
 

yes, good advice :)

good luck, and don't give up...

--Geoff




Re: [RFC] Dynamic image generator handler

2002-05-10 Thread Ed

On Fri, May 10, 2002 at 10:46:11AM -0700, Michael A Nachbaur wrote:
 On Fri, 10 May 2002 08:32:55 +0200
 Robert [EMAIL PROTECTED] wrote:
 
  Take a look at Apache::ImageMagick
 
 In my benchmarks I ran, ImageMagick was way slower than GD.  I wrote a
 little test, rendering a little text image of 120x30.  With ImageMagick,
 I was getting 0.3 rps, and under GD with similar circumstances I was
 getting 1.5rps.  I'm sure I could've optimized the ImageMagick one a bit
 further, but that quick test settled it for me.
 
 I looked at Apache::ImageMagick last night however, and although it
 seems pretty usefull, it doesn't really address what I want to do with
 my module.

I'm using Imlib2 w/ the c interface (http://freshmeat.net/projects/imlib2perl/)

I needed antialias lines, alpha's etc.  I modified my app to use a 'dbi' like
interface for potentially any media driver.  The diferent 'media drivers',
gd, imlib2, *pdf/*tex etc all have different ideas how to draw a line, circle,
polygon, text, add colors etc. Now all I have to do to use diffent libraries
such as Media-new(Driver = 'imlib2'), or Media-new(Driver = 'gd'),
Media-new(Driver = 'svg'), Media-new(Driver = 'pdflib') etc.

There are may libraries out there, gd, imlib, imlib2, libart, povray, gdk,
flash, pdfAPI2, pdflib, tex, latex, svg, imager, imagemagic, ...

There are may good reasons to be able to 'just drop in' a driver ... just
look at why the unified interface 'DBI' was developed for RDBM's .

Ed






Re: [RFC] Dynamic image generator handler

2002-05-10 Thread Ed

On Wed, May 08, 2002 at 01:42:42AM -0700, Michael A Nachbaur wrote:
 This is an request for comments.  If you don't care about dynamic image
 generation with mod_perl, or don't care about offering or reading about
 suggestions, you can safely ignore this.  Also, be forewarned, this was
 written in StarOffice, and then copied/pasted into my email program, and
 hand tweaked, so some things may not have made the transition properly.
 
 Dynamic Image Manipulator
 -
 
 *) Overview
 
 This is a mod_perl handler, not directly tied in with my content
 management system, but is/will be used extensively by it. The premise is
 to dynamically generate images, cache them, and present them to browser
 clients. The URI, as well as Apache configuration directives, is used to
 determine what is to be generated.
 
 *) Basic Uses
 
 The most basic uses of this application will to dynamically generate TTF
 text for titles, buttons, sidebars, etc. The current version of this
 code does this, and quite well. Foreground and background colors, font
 name (with bold/italic support), font size, image size (or automatically
 detected based on the size of the text), and rotation.
 
 The basic text support could be extended to allow for images to be
 overlayed on the text (or placed under the text), or stretch images
 similarly to how Enlightenment displays window manager themes.
 
 Other uses planned would be to manipulate existing images. For instance,
 if an image on a website needs a thumbnail, medium size and full-size
 view, normally a person must make all versions by hand. If any
 formatting needs to be done, like borders or drop-shadows, this
 increases complexity. If a person could just drop an image in a
 directory, and link to that image, the image could automatically be
 resized, borders added, drop shadows put in place. The resulting image
 would then be cached, and outputted.
 
 *) URI Arguments
 
 Information about what is to be done is passed through the URI. This
 works for simple tasks like text display, but if anything more
 complicated is to be done, external configuration files must be used.
 We'll get to that in a bit.
 
 Essentially, arguments are passed using the PATH_INFO HTTP header. We
 want the browser to think this is an actual file, instead of a
 dynamically generated image, so that the browser is more inclined to
 cache the content. So, a typical query would be:
 
   http://localhost/genText/font=ArialBold;size=24;fgcolor=#ff;
   bgcolor=#00;rotate=90;text=This+Is+The+Text
 
 Resizing an image could be accomplished by doing:
 
   http://localhost/genImage/source=/images/ducks.jpg;scale-ratio=1:1;
   width=120;height=80;border-size:1px;border-color:#00;
   shadow-color:#00;shadow-angle:270;shadow-distance:5px
 
 This would resize an image to the indicated width/height. The
 scale-ratio argument would limit the width/height ratio, so the
 maximum dimension would be used. The other attributes are obvious.
 
 *) Configuration Files
 Lets assume that we are going to scale an image, add borders to it which
 consist of other images, and add text captions over the image. This
 would result in such a long URI, that browsers would probably truncate
 it. In addition, providing direct access to the browser opens up
 possibilities for DoS attacks. Therefore, a configuration file should be
 used. The config file must be flexible enough to allow a web page to
 provide various input, but have certain defaults set, and restricted.
 
 The proposed solution would be to have a config file that has preset
 default templates that the input arguments augment. For instance:
 
 genimage
   preset name=thumbnail-image
 image
   style 
 border-style: solid;
 border-color: #00;
 border-width: 1px;
 shadow-distance: 5px;
 shadow-angle: 270; !-- or something like 1.2rad --
 shadow-color: #00;
   /style
   content name=src/
 /image
 image
   style href=/css/watermark.css/
   !-- The above-referenced file has the following contents:
 opacity: 80%;
 position: top;
   --
   content/images/watermark.gif/content
 /image
 text
   style
 font-face: Arial;
 font-size: 10px;
 color: #00;
 border-style: solid;
 border-color: #ff;
 opacity: 80%;
 text-align: right;
   /style
   contentCopyright copy; 2002 Foo Bar Industries/content
 /text
 text
   style
 font-face: Arial;
 font-size: 14px;
 color: #ff;
 text-align: left;
 position: top;
   /style
   content name=date/
 /text
   /preset
 /genimage
 
 As you can see, the above configuration file uses CSS. It makes sense to
 leverage that, although I'm not certain how difficult it would be to
 interface with CSS files. As far as I know, there are Perl CSS parsers,
 but I have yet to use them. The 

Re: [RFC] Dynamic image generator handler

2002-05-10 Thread Michael A Nachbaur

On 10 May 2002 06:39:47 -0700
[EMAIL PROTECTED] (Randal L. Schwartz) wrote:

 Like http://www.stonehenge.com/merlyn/LinuxMag/col33.html
 perhaps?  Been there, Done that.  Feel free to steal the code.

Like that, but a bit more so.  And I'd like to avoid ImageMagick like
the plague.

-- 

-man
Michael A Nachbaur

PGP Public Key at http://www.nachbaur.com/pgpkey.asc
PGP Key fingerprint = 83DC 7C3A 3084 6A21 9A3F  801E D974 AFB4 BFD7 2B6F



how to see /server-status when at MaxClients?

2002-05-10 Thread John E. Leon Guerrero

if a job hangs (due to database locking for instance), then a mod_perl child
will hang as well (absent some additional watchdog-type program.)  if enough
jobs hang to the point that we hit MaxClients, then it is too late to use
/server-status to see what jobs hung.

does anyone have a quick way to indentify the jobs that are currently
running?  i thought of getting a core and using gdb but i was hoping to find
a faster way.  it would be nice if we could reserve a couple of children for
administrative emergencies such as this.

thanks,
jlg

John Leon Guerrero -- http://www.live365.com





Re: mod_perl 1.26 build under Cygwin fails

2002-05-10 Thread Per Einar Ellefsen

At 21:43 01.05.2002, Alexander Solovey wrote:
Per Einar Ellefsen wrote:
  Try to apply patch (attached) and then build using these options:
  
  perl Makefile.PL APACHE_SRC=../apache_1.3.24/src USE_APACI=1 EVERYTHING=1
  PERL_EXTRA_CFLAGS=-DUSEIMPORTLIB DO_HTTPD=1
  APACI_ARGS='--enable-rule=SHARED_CORE --enable-module=so'
 
  Thanks a lot for that patch, atleast it fixed the initial problem. 
 However,
  when mod_perl.config.sh is called, it reports Note (probably 
 harmless): No
  library found for -lperl.
 
  Well, it is harmful :) I get tons of linking errors at compilation time
  (undefined references). How do I get it to find the perl library, if any?
  Or, how do I compile one if I have to?

Oh, I forgot to tell you that one more step is required:

 cd /lib/perl5/5.6.1/cygwin-multi/CORE  ln -s libperl5_6_1.a libperl.a

mod_perl requires libperl.a to be present but cygwin doesn't provide it
by default. So, here is a symbolic link and it works.

Thanks a lot for your help. Now, for some more problems :)

=== src/modules
gcc -c  -I./os/cygwin -I./include   -DCYGWIN -DMOD_PERL 
-DUSE_HSREGEX  -DSHARED_CORE -DUSEIMPORTLIB -DPERL_USE_SAFE_PUTENV 
-fno-strict-aliasing -I/usr/local/include `./apaci` modules.c
gcc -c  -I./os/cygwin -I./include   -DCYGWIN -DMOD_PERL 
-DUSE_HSREGEX  -DSHARED_CORE -DUSEIMPORTLIB -DPERL_USE_SAFE_PUTENV 
-fno-strict-aliasing -I/usr/local/include `./apaci` buildmark.c
dllwrap --export-all -o libhttpd.dll buildmark.o modules.o 
modules/standard/libstandard.a modules/perl/libperl.a main/libmain.a 
./os/cygwin/libos.a ap/libap.a regex/libregex.a   -lcrypt -lgdbm  -s  -s 
-L/usr/local/lib 
/usr/lib/perl5/5.6.1/cygwin-multi/auto/DynaLoader/DynaLoader.a 
-L/usr/lib/perl5/5.6.1/cygwin-multi/CORE -lperl -lcrypt
dllwrap: no export definition file provided
dllwrap: creating one, but that may not be what you want
gcc  -I./os/cygwin -I./include   -DCYGWIN -DMOD_PERL 
-DUSE_HSREGEX  -DSHARED_CORE -DUSEIMPORTLIB -DPERL_USE_SAFE_PUTENV 
-fno-strict-aliasing -I/usr/local/include `./apaci`\
   -o libhttpd.ep -DSHARED_CORE_TIESTATIC main/http_main.c \
   -L. -lhttpd  -lcrypt -lgdbm  -s  -s -L/usr/local/lib 
/usr/lib/perl5/5.6.1/cygwin-multi/auto/DynaLoader/DynaLoader.a 
-L/usr/lib/perl5/5.6.1/cygwin-multi/CORE -lperl -lcrypt
gcc  -I./os/cygwin -I./include   -DCYGWIN -DMOD_PERL 
-DUSE_HSREGEX  -DSHARED_CORE -DUSEIMPORTLIB -DPERL_USE_SAFE_PUTENV 
-fno-strict-aliasing -I/usr/local/include `./apaci`\
   -o httpd -DSHARED_CORE_BOOTSTRAP main/http_main.c \
   ap/libap.a  -lcrypt -lgdbm  -s  -s -L/usr/local/lib 
/usr/lib/perl5/5.6.1/cygwin-multi/auto/DynaLoader/DynaLoader.a 
-L/usr/lib/perl5/5.6.1/cygwin-multi/CORE -lperl -lcrypt  libhttpd.dll
make[3]: Leaving directory `/usr/src/apache_1.3.24/src'

I'm not so sure what's happening, but re-running make will re-execute this 
section over and over again, so something must have gone wrong :( I tried 
playing around a little with options to dllwrap, but without much luck.


-- 
Per Einar Ellefsen
[EMAIL PROTECTED]





Re: mod_perl2: nmake test crashes apache

2002-05-10 Thread Bjoern Hoehrmann

* Doug MacEachern wrote:
the issue with all segfaults on win32 is related to the use of the 
internal perl variable PL_sv_no.  not sure what the real problem is, but 
avoiding use of PL_sv_no has cured all segfaults on win32.  the fixes have 
been checked into cvs.

I now get

  apache\cgihandler...ok
  apache\compat...ok
  apache\compat2..ok
  apache\conftree.ok
  apache\constantsok
  apache\post.ok
  apache\read.ok
  apache\scanhdrs.ok
  apache\subprocess...skipped: perl  5.7.3
  apache\writeok
  api\access..ok
  api\aplog...ok
  api\conn_recok
  api\lookup_uri..ok
  api\lookup_uri2.ok
  api\module..FAILED test 2
  Failed 1/13 tests, 92.31% okay
  api\r_subclass..ok
  api\request_rec.ok
  api\responseok
  api\rutil...ok
  api\send_fd.ok
  api\sendfileok
  api\server_rec..ok
  api\server_util.ok
  api\uri.ok
  apr\base64..ok
  apr\constants...ok
  apr\dateok
  apr\netlib..FAILED test 3
  Failed 1/3 tests, 66.67% okay
  apr\perlio..skipped: iolayers is not available with this
version of Perl
  
  apr\poolok
  apr\string..ok
  apr\table...ok
  apr\utilok
  apr\uuidok
  directive\env...FAILED tests 1-3
  Failed 3/4 tests, 25.00% okay
  directive\perlmodule.ok
  directive\perlrequire.ok
  directive\setupenv..ok
  filter\api..ok
  filter\buckets..ok
  filter\input_body...ok
  filter\input_msgok
  filter\lc...ok
  filter\reverse..ok
  hooks\accessok
  hooks\authenok
  hooks\authz.ok
  hooks\fixup.ok
  hooks\headerparser..ok
  hooks\init..ok
  hooks\trans.ok
  modperl\dir_config..FAILED tests 6-12
  Failed 7/12 tests, 41.67% okay
  modperl\endav...ok
  modperl\env.ok
  modperl\exitok
  modperl\getcFAILED test 2
  Failed 1/2 tests, 50.00% okay
  modperl\pnotes..ok
  modperl\print...ok
  modperl\printf..ok
  modperl\readlineok
  modperl\sameinterp..ok
  modules\cgi.ok
  modules\cgiupload...ok
  modules\include.ok
  protocol\echo...ok
  protocol\echo_filter.ok
  protocol\eliza..skipped: cannot find module 'Chatbot::Eliza'
  Failed Test  Status Wstat Total Fail  Failed  List of Failed


  
  api\module.t  131   7.69%  2
  apr\netlib.t   31  33.33%  3
  directive\env.t43  75.00%  1-3
  modperl\dir_config.t  127  58.33%  6-12
  modperl\getc.t 21  50.00%  2
  3 tests skipped.
  !!! : error running tests (please examine C:t\logs\error_log)
  NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : return code '0x1'
  Stop.

Where error_log is

  [Sat May 11 03:14:49 2002] [info] 12 Apache:: modules loaded
  [Sat May 11 03:14:49 2002] [info] 5 APR:: modules loaded
  [Sat May 11 03:14:49 2002] [info] base server + 6 vhosts ready to run tests
  [Sat May 11 03:14:49 2002] [info] 11 Apache:: modules loaded
  [Sat May 11 03:14:49 2002] [info] 5 APR:: modules loaded
  [Sat May 11 03:14:49 2002] [info] base server + 6 vhosts ready to run tests
  [Sat May 11 03:14:50 2002] [notice] Child 2552: Child process is running
  [Sat May 11 03:14:50 2002] [notice] Child 2552: Acquired the start mutex.
  [Sat May 11 03:14:50 2002] [notice] Child 2552: Starting 10 worker threads.
  [Sat May 11 03:15:02 2002] [info] [client 192.168.0.128] TestAPI::aplog test in 
progress
  [Sat May 11 03:15:02 2002] [debug] C:\b\modperl-2.0\t\response/TestAPI/aplog.pm(43): 
log_serror test ok
  [Sat May 11 03:15:02 2002] [debug] C:\b\modperl-2.0\t\response/TestAPI/aplog.pm(46): 
(20007)No time was provided and one was required.: log_serror test 2 ok
  [Sat May 11 03:15:03 2002] [debug] C:\b\modperl-2.0\t\response/TestAPI/aplog.pm(49): 
[client 192.168.0.128] log_rerror test ok
  [Sat May 11 03:15:03 2002] [error] $r-log_error test ok
  [Sat May 11 03:15:03 2002] [error] $s-log_error test ok
  [Sat May 11 03:15:03 2002] [debug] C:\b\modperl-2.0\t\response/TestAPI/aplog.pm(63): 
TestAPI::aplog test done
  [Sat May 11 03:15:33 2002] [error] [client 192.168.0.128] File does not exist: 
C:/b/modperl-2.0/t/htdocs/nope
  [Sat May 11 03:15:34 2002] [error] [client 192.168.0.128] Attempt to free 
unreferenced scalar at C:\b\modperl-2.0\t\response/TestModperl/dir_config.pm line 71.
  [Sat May 11 03:15:37 2002] [error] [client 192.168.0.128] Attempt to free 
unreferenced scalar at C:\b\modperl-2.0\t\response/TestModperl/getc.pm line 23.
  
there are still a few tests that fail, but none that trigger a segfault.

Exactly. Thanks.



Re: PerlVINC and Can't locate Foo.pm in @INC ...

2002-05-10 Thread Stas Bekman

Aaron J Mackey wrote:
 Banging my head against the wall a bit, 'cause this is just so simple, but
 still not working:
 
 Versions: Apache 1.3.22, mod_perl 1.26, perl 5.6.1
 
 relevant lines from httpd.conf:
 
   PerlWarn On
   PerlModule Apache::PerlVINC
 
   Location /dat-ajm6q
 SetHandler  perl-script
 PerlHandler DAT::Client::WWW
 
 PerlINC /home/ajm6q/cvs/dat-head/lib
 PerlFixupHandlerApache::PerlVINC
 PerlVersion DAT/Client/WWW.pm
   /Location
 
 Error log when access is attempted (other standard directories edited out
 for brevity):
 
 [Fri May 10 13:39:39 2002] [error] Can't locate DAT/Client/WWW.pm in @INC
 (@INC contains: /home/ajm6q/cvs/dat-head/lib [... edited out ...]) at
 /usr/lib/perl5/site_perl/5.6.1/i386-linux/Apache/PerlVINC.pm line 55.
 
 The file is, of course, actually there:
 
 % ls -l /home/ajm6q/cvs/dat-head/lib/DAT/Client/WWW.pm
 -rwxrwxr-x1 ajm6qwebwork   394 May 10 12:40 
/home/ajm6q/cvs/dat-head/lib/DAT/Client/WWW.pm
 
 
 What am I missing?

Does it normally work? (without Apache::PerlVINC)

It's possible that you have wrong permissions on one of the segments of 
/home/ajm6q/cvs/dat-head/lib/DAT/Client/WWW.pm so it cannot read the 
final path.

First test simply with:

die $! unless -r /home/ajm6q/cvs/dat-head/lib/DAT/Client/WWW.pm



__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: how to see /server-status when at MaxClients?

2002-05-10 Thread Stas Bekman

John E. Leon Guerrero wrote:
 if a job hangs (due to database locking for instance), then a mod_perl child
 will hang as well (absent some additional watchdog-type program.)  if enough
 jobs hang to the point that we hit MaxClients, then it is too late to use
 /server-status to see what jobs hung.
 
 does anyone have a quick way to indentify the jobs that are currently
 running?  i thought of getting a core and using gdb but i was hoping to find
 a faster way.  it would be nice if we could reserve a couple of children for
 administrative emergencies such as this.

You probably want: Apache::Watchdog::RunAway

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com