Skip to content

Instantly share code, notes, and snippets.

@kjmkznr
Created December 7, 2014 07:12
Show Gist options
  • Save kjmkznr/406471b5404a8ccb4c7f to your computer and use it in GitHub Desktop.
Save kjmkznr/406471b5404a8ccb4c7f to your computer and use it in GitHub Desktop.
/*
* mod_hello - Hello World for Apache 2.2
*
* Copyright(c) 2014, KOJIMA Kazunori
*
* License: Apache License, Version 2.0
*
* Install:
* $ apxs -c mod_hello.c
* $ sudo apxs -i -a -n hello mod_hello.la
*/
#define CORE_PRIVATE
#include "httpd.h"
#include "http_log.h"
static const char *hello(cmd_parms *cmd, void *dummy, const char *arg)
{
ap_log_error(APLOG_MARK,APLOG_NOTICE|APLOG_NOERRNO, 0 ,NULL, "Hello %s", arg);
return NULL;
}
static const command_rec hello_cmds[] = {
AP_INIT_TAKE1("Hello", hello, NULL, RSRC_CONF | EXEC_ON_READ, "Hello need one argment"),
{NULL}
};
module AP_MODULE_DECLARE_DATA hello_module =
{
STANDARD20_MODULE_STUFF,
NULL, /* create per-dir config */
NULL, /* merge per-dir config */
NULL, /* create per-server config */
NULL, /* merge per-server config */
hello_cmds, /* table of config file commands */
NULL /* handlers registration */
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment