You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Chris Knight <Ch...@nasa.gov> on 2003/06/24 22:45:10 UTC

"hello world" example module...?

Would there be any interest in including example modules with the Apache 
source distribution? And/or could a complete example module be included 
in the documentation for developers? (Personally I'd prefer it be 
included in the source distribution...The web documentation has become 
quite out of date in places and it's more likely to be current if it 
could be included in the distribution test suite.)

Yesterday, in trying to convey how to implement a module, I developed a 
"hello world" example module that has a "handler" hook that responds 
with a canned message to all requests. (It demonstrates hooks, and I 
have a slightly more complex example showing how to read per-directory 
configurations.)

I would have found a barebones example immensely useful and would have 
saved me much time and code-grepping.

Anyways, I've attached my "hello world" module. Please 
comment/correct/chastise as you see fit, I am by no means an expert. ;^>

Re: "hello world" example module...?

Posted by Rich Bowen <rb...@rcbowen.com>.
On Tue, 24 Jun 2003, Jeff Trawick wrote:

> > however (I seemed to remember that there was an example module somewhere
> > but couldn't find it yesterday). And it's certainly a lot more to
> > swallow than a "hello world" example.
>
> IMO, the more valuable contribution would not be another .c file in the
> tree somewhere but instead a very minimal "hello world" example
> documented under http://httpd.apache.org/docs-2.0/developer/, with
> proper hints on how to compile it (e.g., use apxs instead of libtool on
> unix-ish platforms), and a reference to mod_example.c for examples of
> other hooks.

+1
Yes, absolutely. That would be wonderful.
And feel free to ask over on the documentation mailing list if you want
more information about the documentation process and getting stuff
committed to the docs.

-- 
Rich Bowen - rbowen@rcbowen.com
... and another brother out of his mind, and another brother out at New
York (not the same, though it might appear so)
	Somebody's Luggage (Charles Dickens)

Re: "hello world" example module...?

Posted by Jeff Trawick <tr...@attglobal.net>.
> however (I seemed to remember that there was an example module somewhere 
> but couldn't find it yesterday). And it's certainly a lot more to 
> swallow than a "hello world" example.

IMO, the more valuable contribution would not be another .c file in the 
tree somewhere but instead a very minimal "hello world" example 
documented under http://httpd.apache.org/docs-2.0/developer/, with 
proper hints on how to compile it (e.g., use apxs instead of libtool on 
unix-ish platforms), and a reference to mod_example.c for examples of 
other hooks.


Re: "hello world" example module...?

Posted by Chris Knight <Ch...@nasa.gov>.
Jeff Trawick wrote:

> Chris Knight wrote:
>
>> Would there be any interest in including example modules with the 
>> Apache source distribution?
>
>
> modules/experimental/mod_example.c

Ah, fair enough. I wouldn't have thought of looking in experimental, 
however (I seemed to remember that there was an example module somewhere 
but couldn't find it yesterday). And it's certainly a lot more to 
swallow than a "hello world" example.


Re: "hello world" example module...?

Posted by Jeff Trawick <tr...@attglobal.net>.
Chris Knight wrote:
> Would there be any interest in including example modules with the Apache 
> source distribution?

modules/experimental/mod_example.c