help getting started ..

2002-09-05 Thread Sylbert L

Hi,

I'm just getting started with mod_perl. Was trying out the
Apache::CommandServer sample code provided in the documentation, but I seem
to get this error : Can't locate object method run_access_checker via
package Apache::RequestRec at .

I'm using Apache 2.0.40, with mod_perl 2.0, Perl 5.8.0 on Red Hat Linux 7.2.

Also, I was just reading up on the mod_perl handlers. Is it possible to
modify the working of apache, such that, it doesn't close the connection
with the client ? and the connection with the client remains a constant one
until the client explicitly closes the connection ? Can this be done at a
module level ? Or do I need to modify the Apache source to acomplish the
same ? If its possible with mod_perl, which PerlHandler(s) need to be used ?

Thanks a whole lot. I've just recently purchased Oreilly's Writing Apache
Modules with Perl and C, but  realized that it isn't too much of help, coz
I'm dealing with Apache 2.0  the book is all about Apache 1.3  theres such
a drastic difference between the two mod_perl implementations. Is there any
other source of documentation / help I can find ?

Thanks Again,

Sylbert L

PS : The Code that I'm using can be found at :
http://perl.apache.org/docs/2.0/user/overview/overview.html#Apache__CommandS
erver_Source




Re: help getting started ..

2002-09-05 Thread Stas Bekman

Sylbert L wrote:
 Hi,
 
 I'm just getting started with mod_perl. Was trying out the
 Apache::CommandServer sample code provided in the documentation, but I seem
 to get this error : Can't locate object method run_access_checker via
 package Apache::RequestRec at .

add:

use Apache::HookRun ();

in mod_perl 2.0 methods are spread across many modules for the maximum 
performance and modularity. Once the API docs will be created you will 
just have to search for the method in question and load the module that 
has it. For now the easiest way is to grep the WrapXS dir:

.../modperl-2.0 grep -Ir run_access_checker WrapXS
WrapXS/Apache/HookRun/HookRun.xs:ap_run_access_checker(r)
WrapXS/Apache/HookRun/HookRun.c:XS(XS_Apache__RequestRec_run_access_checker); 
/* prototype to pass -Wmissing-prototypes */
WrapXS/Apache/HookRun/HookRun.c:XS(XS_Apache__RequestRec_run_access_checker)
WrapXS/Apache/HookRun/HookRun.c:Perl_croak(aTHX_ Usage: 
Apache::RequestRec::run_access_checker(r));
WrapXS/Apache/HookRun/HookRun.c:RETVAL = ap_run_access_checker(r);
WrapXS/Apache/HookRun/HookRun.c: 
newXS(Apache::RequestRec::run_access_checker, 
XS_Apache__RequestRec_run_access_checker, file);


 I'm using Apache 2.0.40, with mod_perl 2.0, Perl 5.8.0 on Red Hat Linux 7.2.
 
 Also, I was just reading up on the mod_perl handlers. Is it possible to
 modify the working of apache, such that, it doesn't close the connection
 with the client ? and the connection with the client remains a constant one
 until the client explicitly closes the connection ? Can this be done at a
 module level ? Or do I need to modify the Apache source to acomplish the
 same ? If its possible with mod_perl, which PerlHandler(s) need to be used ?

HTTP is a stateless protocol and while you have the KeepAlive 
functionality to serve several requests over the same connection, you 
cannot rely on that to keep the connection open.

Most likely you need to write a protocol handler for that. See:
http://perl.apache.org/docs/2.0/user/handlers/protocols.html
for examples and explanations.

 Thanks a whole lot. I've just recently purchased Oreilly's Writing Apache
 Modules with Perl and C, but  realized that it isn't too much of help, coz
 I'm dealing with Apache 2.0  the book is all about Apache 1.3  theres such
 a drastic difference between the two mod_perl implementations. Is there any
 other source of documentation / help I can find ?

Yes. There is enough to keep you busy for quite a while: 
http://perl.apache.org/docs/2.0/user/index.html

__
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: help getting started ..

2002-09-05 Thread Sylbert L

Thanks Stas, the code works just fine now.

This is what i'd read :

[Apache 1.3 is hardwired to speak only one protocol, HTTP. Apache 2.0 has
moved to more of a server  framework architecture making it possible to
plugin handlers for protocols other than HTTP. The protocol module design
also abstracts the transport layer so protocols such as SSL can be hooked
into the server without requiring modifications to the Apache source code.
This allows Apache to be extended much further than in the past, making it
possible to add support for protocols such as FTP, SMTP, RPC flavors and the
like. The main advantage being that protocol plugins can take advantage of
Apache's portability, process/thread management, configuration mechanism and
plugin API.]

So if this is true, then shouldn't it be possible for me to implment a
constant connection using Apache 2.0 ?

Thanks again,

Sylbert L

PS : Any idea when the API docs will be available ?

 I'm using Apache 2.0.40, with mod_perl 2.0, Perl 5.8.0 on Red Hat Linux
7.2.

 Also, I was just reading up on the mod_perl handlers. Is it possible to
 modify the working of apache, such that, it doesn't close the connection
 with the client ? and the connection with the client remains a constant
one
 until the client explicitly closes the connection ? Can this be done at a
 module level ? Or do I need to modify the Apache source to acomplish the
 same ? If its possible with mod_perl, which PerlHandler(s) need to be used
?

HTTP is a stateless protocol and while you have the KeepAlive
functionality to serve several requests over the same connection, you
cannot rely on that to keep the connection open.




Re: help getting started ..

2002-09-05 Thread Stas Bekman

Sylbert L wrote:
 Thanks Stas, the code works just fine now.

cool. I've fixed the online doc.

 This is what i'd read :
 
 [Apache 1.3 is hardwired to speak only one protocol, HTTP. Apache 2.0 has
 moved to more of a server  framework architecture making it possible to
 plugin handlers for protocols other than HTTP. The protocol module design
 also abstracts the transport layer so protocols such as SSL can be hooked
 into the server without requiring modifications to the Apache source code.
 This allows Apache to be extended much further than in the past, making it
 possible to add support for protocols such as FTP, SMTP, RPC flavors and the
 like. The main advantage being that protocol plugins can take advantage of
 Apache's portability, process/thread management, configuration mechanism and
 plugin API.]
 
 So if this is true, then shouldn't it be possible for me to implment a
 constant connection using Apache 2.0 ?

See my previous reply. You need to implement a protocol handler. Here is 
the URL again:
  http://perl.apache.org/docs/2.0/user/handlers/protocols.html

 PS : Any idea when the API docs will be available ?

We want to reuse as much of the C headers Apache docs as possible, Lyle 
is working on writing a tool which will extract them. I'm not sure 
what's the status of things. Perhaps Lyle can give us an update.

Meanwhile, if you aren't sure what APIs to use look in the t/ directory, 
where there are a few hundreds of tests that exercise most of the 
existing APIs. Overall 1.3 methods aren't very different in 2.0, there 
are just a bunch of new methods which are new.

Also you can reuse the Apache C documentation as well. See:
http://docx.webperf.org and http://lxr.webperf.org/

__
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