Skip to content

Instantly share code, notes, and snippets.

@lifo
Created December 12, 2008 13:28
Show Gist options
  • Save lifo/35124 to your computer and use it in GitHub Desktop.
Save lifo/35124 to your computer and use it in GitHub Desktop.
/*
apxs -c mod_helloworld.c
LoadModule helloworld_module modules/mod_helloworld.so
<Location /helloworld>
SetHandler helloworld
</Location>
*/
#include <httpd.h>
#include <http_protocol.h>
#include <http_config.h>
static const char *response = "doesnt scale";
static int helloworld_handler(request_rec *r)
{
ap_rputs(response, r);
return OK;
}
static void helloworld_hooks(apr_pool_t *pool)
{
ap_hook_handler(helloworld_handler, NULL, NULL, APR_HOOK_MIDDLE);
}
module AP_MODULE_DECLARE_DATA helloworld_module = {
STANDARD20_MODULE_STUFF,
NULL,
NULL,
NULL,
NULL,
NULL,
helloworld_hooks
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment