mod_perl examples

2003-02-24 Thread Christopher Hahn

Hello,

The examples from the O'Reilly book Writing Apache Modules with Perl and C
do not compile because of a missing Apache::Src module.  

I am using Apache 2.0 + mod_perl-1.99_08 and can only find docs on this
module
under the 1.0 section of the mod_perl 1.0 area of the mod_perl website
(http://perl.apache.org/docs/1.0/api/Apache/src.html).

Is there an updated version of this set of examples, or a work-around for
supplying this module?

Thank you,

Christopher Hahn

-- 
There are only 10 types of people in the world:
Those who understand binary and those who don't.


Re: [MP2] Apache::Reload date bug

2003-02-24 Thread Ron Savage
On Wed, 19 Feb 2003 10:04:02 +1100, Stas Bekman wrote:
Ron Savage wrote:
On Tue, 18 Feb 2003 12:56:38 +1100, Stas Bekman wrote:

Hi Folks

In endeavouring to reproduce this problem, I've encountered another:
main.cgi:
-8-
#!/usr/bin/perl

use strict;
use warnings;

use CGI;
use Dummy;

# --

my($title)  = 'Test';
my($q)  = CGI - new();
my($s)  = Dummy - string();

print   $q - header({type = 'text/html;charset=ISO-8859-1'}),
$q - start_html({title = $title}),
$q - h1({align = 'center'}, $s),
$q - end_html();
-8-

Dummy.pm (in /perl/site/lib/):
-8-
package Dummy;

sub string{'This is a string'}

1;
-8-

Output when run as /perl/main.cgi. Only the first line is expected
(by me.) Ie why does the text from OK down, appear? :
-8-
This is a string
OK
The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator, [EMAIL PROTECTED] and inform
them of the time the error occurred, and anything you might have done
that may have caused the error.

More information about this error may be available in the server
error log.


--
--

Apache/2.0.43 Server at 127.0.0.1 Port 80
-8-

The part of httpd.conf controlling /perl/. Note Dummy is not included
here, but the original module, which revealed the original bug, is:
8
IfModule mod_perl.c

PerlModule Apache::Reload
PerlInitHandler Apache::Reload
PerlSetVar ReloadAll Off
PerlSetVar ReloadModules CGI::Explorer DBIx::AdminEngine Monash::*
Sweep::*

#PerlSwitches -Mblib=C:\Apache2
PerlRequire C:/Apache2/conf/startup.pl
Alias /perl/ C:/Apache2/perl/
Location /perl
  SetHandler perl-script
  PerlResponseHandler ModPerl::Registry
  Options +ExecCGI
  PerlOptions +ParseHeaders
Order deny,allow
Deny from all
Allow from 127.0.0.1
/Location
8

I'll keep working on the original problem.
--
Cheers
Ron Savage, [EMAIL PROTECTED] on 24/02/2003
http://savage.net.au/index.html




[mp2] mod_perl2 + XML::LibXML = OK ?

2003-02-24 Thread Kurt George Gjerde
Hi,

Are there any problems using XML::LibXML and XML::LibXSLT with mod_perl 2
(perl 5.8)?

(everything is the latest versions as grabbed from Randy's site ;) win32).

My primary concern is thread-safety (is XML::LibXML thread-safe?), but
anything I should be aware about would be nice to know.


Thanks,
-Kurt.
__
kurt george gjerde [EMAIL PROTECTED]
intermedia uib, university of bergen

I don't work here.



RE: child-parent memory access / mod_perl / shared mem /inter-proccess communication , etc..

2003-02-24 Thread Jim Morrison [Mailing-Lists]
Perrin,

 I suggest you look at IPC::MM or IPC::Shareable.  IPC::Shareable is
more
 transparent, but IPC::MM has better performance.  IPC::MM simply
creates
 a hash in shared memory and lets you write to it.  Either of these
will
 allow you to share data between processes.

Thanks, I'll have a play around with these!

 What I really want to do is to write a module that can be accessed
from
 any of the child apache processes such that some work can be done at
one
 stage, and if the second request comes through to another child, that
 child can pick up on the work of the first..

 That sounds pretty sketchy to me.  Why are you trying to do that?
There
 may be a much simpler way to achieve what you're after.

Hmm.. Yes, it sounds pretty sketchy to me too!  Immediately what I am
playing with is the idea of keeping parsed XML (XML::LibXML)in memory
between requests.  Is this a completely barmy idea?

ATB, J.



Upgrading to perl 5.8.0 (newbie question)

2003-02-24 Thread Gazi, Nasser (London)
Hi,

I have a server which has the following pre-installed on it:
  Apache/1.3.27
  mod_perl/1.27
  Perl/5.6.1

If I upgrade to Perl/5.8.0 will I have to upgrade mod_perl to a newer
version as well?

Thanks,
NG



Re: Upgrading to perl 5.8.0 (newbie question)

2003-02-24 Thread Sven Geisler
Hi,

mod_perl 1.27 is the latest stable version of mod_perl 1.
You're fine.

Regards,
Sven.

Am Mon, 2003-02-24 um 12.24 schrieb Gazi, Nasser (London):
 Hi,
 
 I have a server which has the following pre-installed on it:
   Apache/1.3.27
   mod_perl/1.27
   Perl/5.6.1
 
 If I upgrade to Perl/5.8.0 will I have to upgrade mod_perl to a newer
 version as well?
 
 Thanks,
 NG
 
 




Re: Upgrading to perl 5.8.0 (newbie question)

2003-02-24 Thread David Wright
 Hi,

 mod_perl 1.27 is the latest stable version of mod_perl 1.
 You're fine.

 Regards,
 Sven.

 Am Mon, 2003-02-24 um 12.24 schrieb Gazi, Nasser (London):
  Hi,
 
  I have a server which has the following pre-installed on it:
Apache/1.3.27
mod_perl/1.27
Perl/5.6.1
 
  If I upgrade to Perl/5.8.0 will I have to upgrade mod_perl to a newer
  version as well?


You'll have to rebuild it after the new perl is installed though.

http://perl.apache.org/docs/1.0/guide/install.html#Should_I_Rebuild_mod_perl_if_I_have_Upgraded_Perl_

dave





RE: Upgrading to perl 5.8.0 (newbie question)

2003-02-24 Thread Gazi, Nasser (London)
 Hi,

 mod_perl 1.27 is the latest stable version of mod_perl 1. You're fine.

 Regards,
 Sven.

 Am Mon, 2003-02-24 um 12.24 schrieb Gazi, Nasser (London):
  Hi,
 
  I have a server which has the following pre-installed on it:
Apache/1.3.27
mod_perl/1.27
Perl/5.6.1
 
  If I upgrade to Perl/5.8.0 will I have to upgrade mod_perl to a 
  newer version as well?


You'll have to rebuild it after the new perl is installed though.

http://perl.apache.org/docs/1.0/guide/install.html#Should_I_Rebuild_mod_per
l_if_I_have_Upgraded_Perl_

dave

Thanks. I should go and read the docs! (typical newbie...)






Apache::Session and Postgres

2003-02-24 Thread Grant McLean
I'm trying to use Apache::Session::Postgres and not having much luck.
When I try to create a new session like this:

  use Apache::Session::Postgres;

  tie %sess, 'Apache::Session::Postgres', undef, {
Handle = $self-dbh, Commit = 1
  };

I get this error:

  Can't locate object method get_lock_manager via package
  Apache::Session::Postgres

And indeed, that method does not seem to be defined in any of the modules
which Apache::Session::Postgres inherits from.  I tried defining the method
like this:

  sub get_lock_manager {
  my $self = shift;
  return $self-{lock_manager};
  }

and the error message changed to:

  Can't call method acquire_read_lock on an undefined value

So then I tried:

  sub get_lock_manager {
  my $self = shift;
  return(new Apache::Session::Lock::Null $self)
  }

but got:

  Can't locate object method get_object_store

I'm wondering if Apache::Session::Postgres is not actively maintained
and has fallen out of sync with the core Apache::Session API.


The reason I selected Apache::Session::Postgres was twofold, I happened
to be using Postgres and whereas Apache::Session::DBI requires a
DataSource + UserName + Password, Apache::Session::Postgres will
accept an open database handle (according to the docs).  Would I be
better off trying to hack that facility into Apache::Session::DBI?
or is there likely to be some good reason why it doesn't support it
already?

Regards
Grant


Redirects: relative vs absolute

2003-02-24 Thread Grant McLean

I've seen a number of code examples for redirects which output a
root-relative URI in the Location header. Eg:

  Location: /images/item1.gif


Although browsers seem to accept this and do 'the right thing', the 
HTTP RFC seems to be pretty clear that the Location header must be 
an absolute URI.  Am I reading it wrong?

Is there an easy way to get the absolute URI of the current request 
to use with Apache::URI-parse to translate a relative URI to 
absolute? 

I have managed to get the hostname, port number and path components
individually from the request object and paste them together but 
it's all a bit messy.

Regards
Grant


Re: sanity check problem: Help installing mod_perl 1.27andapache 1.3.27

2003-02-24 Thread Charlie Smith



Yes. I used gcc to compile perl 5.8, DBI 1.30, DBD::Orace 
1.12.
Then as part of this particular install, I've installed HTML-Parser-3.27, 
URI-1.23, URI-1.22, libwww-perl-5.69.

I did have similar type of problem with perl 5.8 install. I changed 
all file containing 'WI,-E' to not use ',-E'. This allowed me to get 
through the 'make' for perl 5.8.

I've read the install docs. There's an item on Solaris 2.5, on 
STRONHOLD, but I'm 2.8.
 "Ged Haywood" [EMAIL PROTECTED] 02/20/03 
02:00PM Hi there,On Thu, 20 Feb 2003, Charlie Smith 
wrote: Am having problems as seen in the 'sanity check' 
below.[snip] -lsocket -lnsl -lpthread -Wl 
-L/usr/local/lib -L/opt/local/lib  
/usr/local/lib/perl5/5.8.0/sun4-solaris/auto/DynaLoader/DynaLoader.a 
-L/usr/local/lib/perl5/5.8.0/sun4-solaris/CORE -lperl -lsocket -lnsl -ldl 
-lm -lc cc1: Invalid option `-Wl' cc1: Invalid option 
`-Wl'The -Wl argument should be followed by a comma and option(s) which 
gccwill pass to the linker. Your -Wl has no option(s) after it. 
This isnot good. The configuration process does some substitutions on 
the Wlargument depending on the platform etc. Maybe the substitution 
isn'tworking right on your platform.In an earlier post you said that 
you'd had to add to your path to get'make' to run. That's weird, makes 
me think your setup is whacky.Have you used make, gcc etc. to compile 
anything else on your system?Have you tried to build Apache stand-alone 
(without mod_perl)?Have you read the INSTALL documents for anything that 
might be mentionedabout your 
platform?73,Ged.

--
This message may contain confidential information, and is intended only for the use of the individual(s) to whom it is addressed.


==


Re: mod_perl examples

2003-02-24 Thread Perrin Harkins
On Mon, 2003-02-24 at 00:14, Christopher Hahn wrote:
 The examples from the O'Reilly book Writing Apache Modules with Perl and C
 do not compile because of a missing Apache::Src module.  
 
 I am using Apache 2.0 + mod_perl-1.99_08 and can only find docs on this
 module
 under the 1.0 section of the mod_perl 1.0 area of the mod_perl website
 (http://perl.apache.org/docs/1.0/api/Apache/src.html).

That's right, that book only applies to mod_perl 1.x.  If you want
documentation on using mod_perl 2 there is only the documentation on the
website at this time.

- Perrin



Re: Redirects: relative vs absolute

2003-02-24 Thread Randal L. Schwartz
 Grant == Grant McLean [EMAIL PROTECTED] writes:

Grant I've seen a number of code examples for redirects which output a
Grant root-relative URI in the Location header. Eg:

Grant   Location: /images/item1.gif

If that's coming out from a CGI or Apache::Registry script, the
browser never sees it, because it's handled as an internal redirect.
That can be messy if it's an HTML page with relative links, as the
browser will fetch the links relative to the *old* URL, not the new
URL.  It's also messy if you meant to keep that URL private, but
something breaks as a result, and the URL gets publicized in an error
message.

Now, you may be talking about a response header that's not related to
CGI or Apache::Registry, in which case this doesn't apply.

-- 
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: Apache::Session and Postgres

2003-02-24 Thread Perrin Harkins
On Mon, 2003-02-24 at 07:09, Grant McLean wrote:
 I get this error:
 
   Can't locate object method get_lock_manager via package
   Apache::Session::Postgres
 
 And indeed, that method does not seem to be defined in any of the modules
 which Apache::Session::Postgres inherits from.

I don't see anything that calls that method anywhere in the
Apache::Session distribution.  Either you have some code doing it, or
you have an old version.  You should be running the 1.54 distribution.

- Perrin



RE: child-parent memory access / mod_perl / shared mem/inter-proccess communication , etc..

2003-02-24 Thread Perrin Harkins
On Mon, 2003-02-24 at 05:40, Jim Morrison [Mailing-Lists] wrote:
 Hmm.. Yes, it sounds pretty sketchy to me too!  Immediately what I am
 playing with is the idea of keeping parsed XML (XML::LibXML)in memory
 between requests.  Is this a completely barmy idea?

Caching is a good idea, but it's not possible to share objects between
Perl processes without serializing them.  Try using Cache::Mmap,
Cache::FileCache, or MLDBM::Sync.

- Perrin



Re: Redirects: relative vs absolute

2003-02-24 Thread Mithun Bhattacharya

--- Grant McLean [EMAIL PROTECTED] wrote:

 Is there an easy way to get the absolute URI of the current request 
 to use with Apache::URI-parse to translate a relative URI to 
 absolute? 

From perldoc URI

-
$uri = URI#8722;new_abs( $str, $base_uri )
 This constructs a new absolute URI object.  The $str argument can
 denote a relative or absolute URI.  If relative, then it will be
 absolutized using $base_uri as base. The $base_uri must be an
abso#8208;
 lute URI.
-



Regards
Mithun

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/


Re: sanity check problem: Help installing mod_perl 1.27 andapache1.3.27

2003-02-24 Thread Ged Haywood
Hello again Charlie,

On Mon, 24 Feb 2003, Charlie Smith wrote:

 Yes.  I used gcc to compile perl 5.8, DBI 1.30, DBD::Orace 1.12.

And Apache and mod_perl?

 I did have similar type of problem with perl 5.8 install.  I changed
 all file containing 'WI,-E' to not use ',-E'.  This allowed me to
 get through the 'make' for perl 5.8.

I almost suggested doing something similar in my previous post.
But it's better to fix the build process and submit a patch... :)

73,
Ged.



Re: Upgrading to perl 5.8.0 (newbie question)

2003-02-24 Thread wsheldah

No, but you will need to recompile it plus lots of other modules, basically
any module that includes XS code. Consider using CPAN's autobundle feature.
:-)

Wes Sheldahl



Gazi, Nasser (London) [EMAIL PROTECTED] on 02/24/2003 06:24:32
AM

To:[EMAIL PROTECTED]
cc:
Subject:Upgrading to perl 5.8.0 (newbie question)


Hi,

I have a server which has the following pre-installed on it:
  Apache/1.3.27
  mod_perl/1.27
  Perl/5.6.1

If I upgrade to Perl/5.8.0 will I have to upgrade mod_perl to a newer
version as well?

Thanks,
NG








Re: sanity check problem: Help installing mod_perl1.27andapache 1.3.27

2003-02-24 Thread Charlie Smith



Hi Ged,

apache 
and mod_perl at 1.3.19 and 1.25, resp. I came on board afterapache 
and mod_perlhad been installed via binaries off of a cd.
It 
is part of my task to upgrade these and try and get rid of some problems with 
mod_perl.

Current 
configuration:
GCC 2.95, 
PERL 5.8, DBI 1.3 and DBD::Oracle 1.12, Oracle 9.0.1 SunOS 5.8 Generic 108528-12 
sun4u sparc SUNW, Ultra-80, Apache 1.3.19

mod_perl/1.25 
"Ged Haywood" [EMAIL PROTECTED] 02/24/03 10:03AM 
Hello again Charlie,On Mon, 24 Feb 2003, Charlie Smith 
wrote: Yes. I used gcc to compile perl 5.8, DBI 1.30, 
DBD::Orace 1.12.And Apache and mod_perl? I did have similar 
type of problem with perl 5.8 install. I changed all file 
containing 'WI,-E' to not use ',-E'. This allowed me to get 
through the 'make' for perl 5.8.I almost suggested doing something 
similar in my previous post.But it's better to fix the build process and 
submit a patch... :)73,Ged.

--
This message may contain confidential information, and is intended only for the use of the individual(s) to whom it is addressed.


==


RE: child-parent memory access / mod_perl / shared mem /inter-proccesscommunication , etc..

2003-02-24 Thread Matt Sergeant
On Mon, 24 Feb 2003, Jim Morrison [Mailing-Lists] wrote:

 Hmm.. Yes, it sounds pretty sketchy to me too!  Immediately what I am
 playing with is the idea of keeping parsed XML (XML::LibXML)in memory
 between requests.  Is this a completely barmy idea?

Probably, because you'll confuse XML::LibXML's garbage collector.

-- 
!-- Matt --
:-get a SMart net/:-
Spam trap - do not mail: [EMAIL PROTECTED]


Re: Redirects: relative vs absolute

2003-02-24 Thread Geoffrey Young
Grant McLean wrote:
I've seen a number of code examples for redirects which output a
root-relative URI in the Location header. Eg:
  Location: /images/item1.gif

Although browsers seem to accept this and do 'the right thing', the 
HTTP RFC seems to be pretty clear that the Location header must be 
an absolute URI.  Am I reading it wrong?
no.

Is there an easy way to get the absolute URI of the current request 
to use with Apache::URI-parse to translate a relative URI to 
absolute? 

I have managed to get the hostname, port number and path components
individually from the request object and paste them together but 
it's all a bit messy.
to generate a URI that points to the same server as the current request it's 
best to use Apache::URI methods, which are pretty easy.

  my $uri = Apache::URI-parse($r);
  $uri-path('/some/new/document.html');
  my $absolute_uri = $uri-unparse;
note that calling path() (or any other method) is optional - you don't need 
to change anything in order to unparse() the URI and get an absolute URI back.

Apache::URI::parse() can take an optional second argument, which it will 
then parse and use as the base for the URI (in place of the current request).

HTH

--Geoff



Re: sanity check problem: Help installing mod_perl1.27andapache 1.3.27

2003-02-24 Thread Charlie Smith



So Ged,

How long before something like this gets into the build process and out as 
a patch? Or is there something I could do in the interim? 
"Ged Haywood" [EMAIL PROTECTED] 02/24/03 10:03AM 
Hello again Charlie,On Mon, 24 Feb 2003, Charlie Smith 
wrote: Yes. I used gcc to compile perl 5.8, DBI 1.30, 
DBD::Orace 1.12.And Apache and mod_perl? I did have similar 
type of problem with perl 5.8 install. I changed all file 
containing 'WI,-E' to not use ',-E'. This allowed me to get 
through the 'make' for perl 5.8.I almost suggested doing something 
similar in my previous post.But it's better to fix the build process and 
submit a patch... :)73,Ged.

--
This message may contain confidential information, and is intended only for the use of the individual(s) to whom it is addressed.


==


Re: sanity check problem: Help installing mod_perl 1.27andapache1.3.27

2003-02-24 Thread Ged Haywood
Hi Charlie,

On Mon, 24 Feb 2003, Charlie Smith wrote:

 How long before something like this gets into the build process and
 out as a patch? Or is there something I could do in the interim?

As it seems that you're the only one having the problem, I meant that
*you* might fix it and submit a patch.  That's what this Open Source
stuff is all about.  :)

 On Mon, 24 Feb 2003, Charlie Smith wrote:
 
  Yes.  I used gcc to compile perl 5.8, DBI 1.30, DBD::Orace 1.12.
 
 And Apache and mod_perl?

You need to recompile Apache and mod_perl if you rebuild Perl.

73,
Ged.



ANNOUNCE: Loggerithim 6.3.0

2003-02-24 Thread Cory 'G' Watson
Hello again,

Loggerithim 6.3.0 is now available, ChangeLog follows:

- 6.3.0
	* Use page that returns an image/png, rather than writing one to the   
 	  filesystem
	* Added filesystem code to the OS X agent, bringing it near completion.
	* Use the IP of a host, then fallback to supplied hostname when metrics
	  are received.
	* Implement debugging, via configuration file.  Displays lots of 
verbose 	  output in the page footer if enabled.
	* Remove 'types' column from users table in preparation for a future 	 
 permissions implementation.
	* Cleaned up some debugging stuff.

About Loggerithim:
Loggerithim is a monitoring package that allows you to monitor your 
systems, proactively spot problems, perform post-mortems, throw alerts 
when bad (or good) things happen, and automate routine tasks.

As always, please report any problems to the appropriate mailing list 
(see the website).  Upgrading users can consult Appendix C of the 
documentation.

Cory 'G' Watson
http://gcdb.spleck.net


Re: sanity check problem: Help installing mod_perl1.27andapache1.3.27

2003-02-24 Thread Charlie Smith


Ok. I'll 
give it a whack or hack or whatever you want to call it. Where are the Wl 
flags loaded from for the mod_perl stuff? "Ged Haywood" 
[EMAIL PROTECTED] 02/24/03 12:00PM Hi 
Charlie,On Mon, 24 Feb 2003, Charlie Smith wrote: How long 
before something like this gets into the build process and out as a 
patch? Or is there something I could do in the interim?As it seems that 
you're the only one having the problem, I meant that*you* might fix it and 
submit a patch. That's what this Open Sourcestuff is all about. 
:) On Mon, 24 Feb 2003, Charlie Smith wrote:   
Yes. I used gcc to compile perl 5.8, DBI 1.30, DBD::Orace 1.12. 
 And Apache and mod_perl?You need to recompile Apache and 
mod_perl if you rebuild Perl.73,Ged.

--
This message may contain confidential information, and is intended only for the use of the individual(s) to whom it is addressed.


==


RE: child-parent memory access / mod_perl / shared mem / inter-proccess communication , etc..

2003-02-24 Thread Jim Morrison [Mailing-Lists]

 Hmm.. Yes, it sounds pretty sketchy to me too!  Immediately what I am
 playing with is the idea of keeping parsed XML (XML::LibXML)in memory
 between requests.  Is this a completely barmy idea?

 Probably, because you'll confuse XML::LibXML's garbage collector.

Sniff..  I've kind of got something working... Enough such that one
httpd can request an XYZ, and if a second httpd comes along a little
later and requests the same XYZ then it will get it from shared memory..
There's a max limit, and when that's reached the oldest XYZ is rotated
out in favor of the new one.

The 'XYZ' can be a string, hash, array, object etc (as far as I've
tried) by using Storable.. to serialize it.. 

As expected though.. trying to do this with LibXML objects fails.. a
lot.

What I thought was that if I kept the handle to the parsed XML open
somewhere else then I would be able to use it.. so a separate process
does the parsing and keeps hold of the handles of the currently 'shared'
bits of XML..  What comes out the other end is something along the lines
of:

bless( do{\(my $o = 137110200)}, 'XML::LibXML::Document' )

But trying to toString() it for instance gives me a :

XML::LibXML::Document::_toString() -- self contains no data at
[snip]/LibXML.pm line 659.

(Incidentally, the XML can be happily toString'ed from the process that
originally parsed it, long after.. so I know it's still lurking about
somewhere..)

To what does the my $o = 137110200 refer?  Is there no way I can get
the parsed object out of LibXML2 into another process?  

CAVEAT : I know it's probably looked at as a silly idea, but if I could
keep my parsed stylesheets/xml's shared somewhere I'd save my self
having to re-parse for every request wouldn't I? . . 

ATB,

Jimbo 






Re: child-parent memory access / mod_perl / shared mem / inter-proccesscommunication , etc..

2003-02-24 Thread Perrin Harkins
Jim Morrison [Mailing-Lists] wrote:
Sniff..  I've kind of got something working... Enough such that one
httpd can request an XYZ, and if a second httpd comes along a little
later and requests the same XYZ then it will get it from shared memory.
I hope you used one of the modules I suggested rather than writing the 
whole thing from scratch.

As expected though.. trying to do this with LibXML objects fails.. a
lot.
LibXML is an XS module, so that may interfere with serialization.

CAVEAT : I know it's probably looked at as a silly idea, but if I could
keep my parsed stylesheets/xml's shared somewhere I'd save my self
having to re-parse for every request wouldn't I? . . 
Why don't you try caching the results instead?

- Perrin



RE: Redirects: relative vs absolute

2003-02-24 Thread Grant McLean
Geoffrey Young wrote:
 Grant McLean wrote:
  Is there an easy way to get the absolute URI of the current request 
  to use with Apache::URI-parse to translate a relative URI to 
  absolute? 
 to generate a URI that points to the same server as the 
 current request it's best to use Apache::URI methods, which are
 pretty easy.
 
my $uri = Apache::URI-parse($r);
$uri-path('/some/new/document.html');
my $absolute_uri = $uri-unparse;
 
 note that calling path() (or any other method) is optional - 
 you don't need  to change anything in order to unparse() the 
 URI and get an absolute URI back.

Excellent, I knew there must be an easier way than what I was doing.

Regards
Grant


RE: child-parent memory access / mod_perl / shared mem / inter-proccess communication , etc..

2003-02-24 Thread Jim Morrison [Mailing-Lists]
 
 Jim Morrison [Mailing-Lists] wrote:
  Sniff..  I've kind of got something working... Enough such that one
  httpd can request an XYZ, and if a second httpd comes along a little
  later and requests the same XYZ then it will get it from shared
memory.
 
 I hope you used one of the modules I suggested rather than writing the
 whole thing from scratch.

Perrin,

No :-) 'course I did. Thanks.. I had a play with the two IPC ones you
sent, Shareable and MM.. I settled on IPC::ShareLite for now.. which
seems the simplest to use.

  As expected though.. trying to do this with LibXML objects fails.. a
  lot.
 
 LibXML is an XS module, so that may interfere with serialization.

Umm. Ok... Does that mean I'm doomed? (not sure what an XS module is) 


  CAVEAT : I know it's probably looked at as a silly idea, but if I
could
  keep my parsed stylesheets/xml's shared somewhere I'd save my self
  having to re-parse for every request wouldn't I? . .
 
 Why don't you try caching the results instead?

The CMS we use builds static content.. (is that what you mean?) so it
caches the whole site in one go I guess.. never been one for dynamic
content ;-)..  But there are places where I'm going to need dynamic
content - I would like to be able to do this in principle.. I mean, I
would like to cache my parsed stylesheets/xml in mem. rather than
re-parsing all the time..  And I'm getting some mileage out of
experimenting with this anyhow - if it doesn't work for LibXML it looks
like it could be very useful for other stuff, and if it ever works
bug-free(-ish) I'd like to give something back to all the CPAN-people
who've written things I use.. 

Kindest,

Jim.





[DIGEST] mod_perl digest 2003/02/10

2003-02-24 Thread jgsmith
--

  mod_perl digest
 
February 10, 2002 - February 23, 2003

--

Recent happenings in the mod_perl world...


Features

  o mod_perl status
  o module announcements
  o application announcements
  o mod_perlers wanted
  o mp2 porting tips
  o mailing list highlights
  o conferences
  o links
  o problem reporting guidelines


mod_perl status

  o mod_perl
- stable: 1.27 (released June 1, 2002) [1]
- development: 1.27_01-dev [2]
  o Apache
- stable: 1.3.27 (released October 3, 2002) [3]
- development: 1.3.28-dev [4]
  o mod_perl 2.0
- beta: 1.99_08 (released January 10, 2002) [5]
- development: (from cvs) [6]
  o Apache 2.0
- stable: 2.0.44 (released January 18, 2003) [7]
  o Perl
- stable: 5.8.0 (released July 18, 2002) [8]
- development: none [9]


module announcements

  o Apache::ASP 2.51 - Active Server Pages for Apache with Perl
scripting [10]

  o CGI::Application::Generator - dynamic creation of
CGI::Application modules [11]

  o HTML::Embperl 1.3.6 - framework for embedding Perl within
documents [12]

  o OpenInteract 1.56 - extensible web application server [13]


application announcements

  o Loggerithim 6.2.2 - system monitoring package [14]


mod_perlers wanted

  o Web Application Developer in Denver, CO, USA [15]


mp2 porting tips

  o Must return OK from content-handlers [16]


mailing list highlights

  o mod_perl Developer's Cookbook available in Polish [17]

  o Apache Modeling Portal [18]


conferences

  o YAPC::NA Call for Proposals [19]


links

  o The Apache/Perl Integration Project [20]
  o mod_perl documentation [21]
  o Apache modules on CPAN [22]
  o _Writing Apache Modules with Perl and C_ homepage [23]
  o _mod_perl Developer's Cookbook_ homepage [24]
  o Other mod_perl-related books [25]
  o mod_perl news and advocacy [26]
  o mod_perl list archives
  - modperl@ [27]
  - dev@ [28]
  - docs-dev@ [29]
  - advocacy@ [30]


problem reporting guidelines

  Whenever you have a problem that you want to ask about on the
  modperl list, please be sure to read the instructions on how to
  report problems:

For mod_perl 1.0 [31]
For mod_perl 2.0 [32]

  For your convenience, these are located in the shortcuts menu on
  all pages at http://perl.apache.org/.  You will save yourself and
  us a lot of time by following the instructions on these pages.

  Thank you!

happy mod_perling...

--James
[EMAIL PROTECTED]

--
[1] http://perl.apache.org/dist/
[2] http://cvs.apache.org/snapshots/modperl/
[3] http://www.apache.org/dist/httpd/
[4] http://cvs.apache.org/snapshots/apache-1.3/
[5] http://perl.apache.org/dist/mod_perl-1.99_04.tar.gz
[6] http://cvs.apache.org/snapshots/modperl-2.0/
[7] http://www.apache.org/dist/httpd/
[8] http://www.cpan.org/src/stable.tar.gz
[9] http://www.cpan.org/src/README.html

[10] http://mathforum.org/epigone/modperl/thoofemskil
[11] http://mathforum.org/epigone/modperl/flulthimjee
[12] http://mathforum.org/epigone/modperl/shorzayblum
[13] http://mathforum.org/epigone/modperl/drembriltrau

[14] http://mathforum.org/epigone/modperl/preigelzee

[15] http://mathforum.org/epigone/modperl/snangkhimpcan

[16] http://mathforum.org/epigone/modperl/parstrokoa

[17] http://mathforum.org/epigone/modperl/krautedi
[18] http://mathforum.org/epigone/modperl/neurummeh

[19] http://www.yapc.org/America/index.shtml
 http://www.yapc.org/America/cfp.shtml

[20] http://perl.apache.org/
[21] http://perl.apache.org/docs/
[22] http://www.cpan.org/modules/by-module/Apache/
[23] http://www.modperl.com/
[24] http://www.modperlcookbook.org/
[25] http://perl.apache.org/docs/offsite/books.html
[26] http://www.take23.org/
[27] http://perl.apache.org/maillist/modperl.html#Searchable_Archives
[28] http://perl.apache.org/maillist/dev.html#Searchable_Archives
[29] http://perl.apache.org/maillist/docs-dev.html#Searchable_Archives
[30] http://perl.apache.org/maillist/advocacy.html#Searchable_Archives

[31] http://perl.apache.org/docs/1.0/guide/help.html#How_to_Report_Problems
[32] http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems


Re: child-parent memory access / mod_perl / shared mem / inter-proccess communication , etc..

2003-02-24 Thread Matt Sergeant
On Monday, Feb 24, 2003, at 19:47 Europe/London, Jim Morrison 
[Mailing-Lists] wrote:

What I thought was that if I kept the handle to the parsed XML open
somewhere else then I would be able to use it.. so a separate process
does the parsing and keeps hold of the handles of the currently 
'shared'
bits of XML..  What comes out the other end is something along the 
lines
of:

	bless( do{\(my $o = 137110200)}, 'XML::LibXML::Document' )

But trying to toString() it for instance gives me a :

XML::LibXML::Document::_toString() -- self contains no data at
[snip]/LibXML.pm line 659.
To what does the my $o = 137110200 refer?  Is there no way I can get
the parsed object out of LibXML2 into another process?
It's a pointer to a region of memory. Since you have protected memory 
in your operating system, only the process that malloced that region of 
memory can access it, hence you can't access it from another process. 
And no, you can't make XML::LibXML allocate in shared memory.

The only conceivable way you could do it is create the DOM before the 
fork and rely on copy-on-write.

CAVEAT : I know it's probably looked at as a silly idea, but if I could
keep my parsed stylesheets/xml's shared somewhere I'd save my self
having to re-parse for every request wouldn't I? . .
Before you try this, *please* investigate parsing every time your 
output needs to change (caching a-la AxKit). A very large site I know 
tried this and discovered that XML::LibXML/LibXSLT parses stylesheets 
*so* fast that it made zero difference to them to cache the stylesheets 
in memory (shared or otherwise).

Try it. You may discover you don't need all this caching.

Matt.



Re: child-parent memory access / mod_perl / shared mem / inter-proccesscommunication , etc..

2003-02-24 Thread Perrin Harkins
Matt already answered most of your questions.

Jim Morrison [Mailing-Lists] wrote:
 And I'm getting some mileage out of
experimenting with this anyhow - if it doesn't work for LibXML it looks
like it could be very useful for other stuff, and if it ever works
bug-free(-ish) I'd like to give something back to all the CPAN-people
who've written things I use.. 
No offense, but you are reinventing the wheel.  There are many modules 
available for sharing cached data.  They all use Storable, so none will 
work on LibXML objects, but they are pretty well-known and mature 
modules: Cache::Mmap, Cache::Cache (which includes an option to use 
IPC::Sharelite), IPC::MM, MLDBM::Sync, etc.

- Perrin



Re: [MP2] Apache::Reload date bug

2003-02-24 Thread Stas Bekman
Ron Savage wrote:
On Wed, 19 Feb 2003 10:04:02 +1100, Stas Bekman wrote:

Ron Savage wrote:

On Tue, 18 Feb 2003 12:56:38 +1100, Stas Bekman wrote:

Hi Folks

In endeavouring to reproduce this problem, I've encountered another:
main.cgi:
-8-
#!/usr/bin/perl
use strict;
use warnings;
use CGI;
use Dummy;
# --

my($title)  = 'Test';
my($q)  = CGI - new();
my($s)  = Dummy - string();
print   $q - header({type = 'text/html;charset=ISO-8859-1'}),
$q - start_html({title = $title}),
$q - h1({align = 'center'}, $s),
$q - end_html();
-8-
Dummy.pm (in /perl/site/lib/):
-8-
package Dummy;
sub string{'This is a string'}

1;
-8-
Output when run as /perl/main.cgi. Only the first line is expected 
(by me.) Ie why does the text from OK down, appear? :
-8-
This is a string
OK
The server encountered an internal error or misconfiguration and was 
unable to complete your request.

Please contact the server administrator, [EMAIL PROTECTED] and inform 
them of the time the error occurred, and anything you might have done 
that may have caused the error.

More information about this error may be available in the server 
error log.
And what your error_log says?

OK is part of the error message. I think I've fixed that in the cvs version. 
See if you get any better with it.

__
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: Redirects: relative vs absolute

2003-02-24 Thread Stas Bekman
Geoffrey Young wrote:

to generate a URI that points to the same server as the current request 
it's best to use Apache::URI methods, which are pretty easy.

  my $uri = Apache::URI-parse($r);
  $uri-path('/some/new/document.html');
  my $absolute_uri = $uri-unparse;
note that calling path() (or any other method) is optional - you don't 
need to change anything in order to unparse() the URI and get an 
absolute URI back.
So basically it's:

my $absolute_uri = Apache::URI-parse($r)-unparse;

So just a heads up for mp2, there is a new method to do that:

use Apache::URI ();
my $absolute_uri = $r-construct_url();
__
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: sanity check problem: Help installing mod_perl1.27andapache1.3.27

2003-02-24 Thread Ged Haywood
Hi Charlie,

On Mon, 24 Feb 2003, Charlie Smith wrote:

 Ok.  I'll give it a whack or hack or whatever you want to call it.  Where are
 the Wl flags loaded from for the mod_perl stuff?

Actually they're from the Apache source, the mod_perl configuration may hack them.
The tool I use most for poking around in sources is 'grep'...

hurricane:~$  grep -r Wl /home/ged/src/apache_1.3.27/*
[snip,snip]
/home/ged/src/apache_1.3.27/htdocs/manual/programs/apxs.html: 
-strongWc,/strongemcompiler/em-emflags/em ] [ 
-strongWl,/strongemlinker/em-emflags/em ] emfiles/em ...
/home/ged/src/apache_1.3.27/htdocs/manual/programs/apxs.html: 
-strongWl,/strongemlinker/em-emflags/em
/home/ged/src/apache_1.3.27/src/CHANGES:  *) Allow special options -Wc,xxx and -Wl,xxx 
on APXS compile/link command.
/home/ged/src/apache_1.3.27/src/Configure:  LDFLAGS_SHLIB_EXPORT=-Zlink=dynamic 
-Wl,-Bexport
/home/ged/src/apache_1.3.27/src/Configure:  LDFLAGS_SHLIB_EXPORT=-Wl,-E
/home/ged/src/apache_1.3.27/src/Configure:   
LDFLAGS_SHLIB_EXPORT=-Wl,-E
/home/ged/src/apache_1.3.27/src/Configure:  LDFLAGS_SHLIB_EXPORT=-Wl,-E
/home/ged/src/apache_1.3.27/src/Configure:  LDFLAGS_SHLIB_EXPORT=-Wl,-Bexport
/home/ged/src/apache_1.3.27/src/Configure:  LDFLAGS_SHLIB_EXPORT=-Wl,-Bexport
/home/ged/src/apache_1.3.27/src/Configure:   
LDFLAGS_SHLIB_EXPORT=-Wl,-Bexport
/home/ged/src/apache_1.3.27/src/Configure: 
LDFLAGS_SHLIB_EXPORT=-Wl,-Bexport
/home/ged/src/apache_1.3.27/src/Configure:  
LDFLAGS_SHLIB_EXPORT=-Wl,-Blargedynsym
/home/ged/src/apache_1.3.27/src/Configure:  LDFLAGS_SHLIB_EXPORT=-Wl,-E 
-Wl,-B,deferred
/home/ged/src/apache_1.3.27/src/Configure:  LDFLAGS_SHLIB_EXPORT=-Wl,-E 
-Wl,-B,deferred -Wl,+s
/home/ged/src/apache_1.3.27/src/Configure:   
LDFLAGS_SHLIB_EXPORT=-Wl,-Bexport:\$(SRCDIR)/support/httpd.exp
/home/ged/src/apache_1.3.27/src/Configure:  
LDFLAGS_SHLIB_EXPORT=-Wl,-bE:\$(SRCDIR)/support/httpd.exp
/home/ged/src/apache_1.3.27/src/Configure:  
LDFLAGS_SHLIB_EXPORT=-Zlink=dynamic -Wl,-Bexport
/home/ged/src/apache_1.3.27/src/modules/perl/mod_perl.config.sh:#replace -Wl args 
meant for cc with args for ld
/home/ged/src/apache_1.3.27/src/modules/perl/mod_perl.config.sh:while ($ldopts =~ 
s/-Wl,(\S+)/$1/) {
/home/ged/src/apache_1.3.27/src/support/apxs.8:.BI \-Wl, linker-flags
/home/ged/src/apache_1.3.27/src/support/apxs.8:.BI \-Wl, linker-flags
/home/ged/src/apache_1.3.27/src/support/apxs.pl:print STDERR
[-Wl,flags] files ...\n;
/home/ged/src/apache_1.3.27/src/support/apxs.pl:my ($opt_Wl, $opt_L, $opt_l);
/home/ged/src/apache_1.3.27/src/support/apxs.pl:foreach $opt_Wl (@opt_W) {
/home/ged/src/apache_1.3.27/src/support/apxs.pl:$opt .=  $1 if ($opt_Wl 
=~ m|^\s*l,(.*)$|);
/home/ged/src/apache_1.3.27/src/support/apxs.pl:$opt .=  -W$opt_Wl;
/home/ged/src/apache_1.3.27/src/support/apxs:print STDERR
[-Wl,flags] files ...\n;
/home/ged/src/apache_1.3.27/src/support/apxs:my ($opt_Wl, $opt_L, $opt_l);
/home/ged/src/apache_1.3.27/src/support/apxs:foreach $opt_Wl (@opt_W) {
/home/ged/src/apache_1.3.27/src/support/apxs:$opt .=  $1 if ($opt_Wl =~ 
m|^\s*l,(.*)$|);
/home/ged/src/apache_1.3.27/src/support/apxs:$opt .=  -W$opt_Wl;

hurricane:~$  grep -r Wl /home/ged/src/mod_perl-1.27/*
/home/ged/src/mod_perl-1.27/apaci/mod_perl.config.sh:#replace -Wl args meant for cc 
with args for ld
/home/ged/src/mod_perl-1.27/apaci/mod_perl.config.sh:while ($ldopts =~ 
s/-Wl,(\S+)/$1/) {

73,
Ged.



Apache module

2003-02-24 Thread Carl Holm
Does anyone know where to find the Apache module mentioned (use 
Apache;) in the tracking users with cookies code example code found 
in the Apache::Session manpage?  

Thanks,

Carl Holm,
[EMAIL PROTECTED]




Re: Apache module

2003-02-24 Thread Perrin Harkins
On Mon, 2003-02-24 at 19:49, Carl Holm wrote:
 Does anyone know where to find the Apache module mentioned (use 
 Apache;) in the tracking users with cookies code example code found 
 in the Apache::Session manpage?  

It's part of mod_perl.  If you have installed mod_perl 1.x, you have it.



Re: Apache module

2003-02-24 Thread Perrin Harkins
[please keep it on the list]

Carl Holm wrote:
I'm running mod_perl2
The examples in the documentation of Apache::Session are for mod_perl 
1.x.  If you want to run them under mod_perl 2, you have to port them or 
use the backward compatibility functions.  Documentation is on the 
perl.apache.org site.

Note that these examples are pretty trivial and should not be hard for 
you to port.  Apache::Session itself is in no way tied to any version of 
mod_perl.

- Perrin



Re: [MP2] Apache::Reload date bug

2003-02-24 Thread Ron Savage
On Tue, 25 Feb 2003 09:40:05 +1100, Stas Bekman wrote:

And what your error_log says?

Nothing is output to the error_log.
--
Cheers
Ron Savage, [EMAIL PROTECTED] on 25/02/2003
http://savage.net.au/index.html