Writting own module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

I am writing my own module just to check process flow. I am bale to start the server successfully after add this module but while sending request from browser, I am getting error that requested URL is not found on server. Whereas without the module everything works fine.

My Module is like:
#include "apr.h"
#include "apr_strings.h"
#include "apr_lib.h"
#include "apr_fnmatch.h"
#include "apr_hash.h"
#include "apr_thread_proc.h"    /* for RLIMIT stuff */
#include "apr_random.h"

#define APR_WANT_IOVEC
#define APR_WANT_STRFUNC
#define APR_WANT_MEMFUNC
#include "apr_want.h"
#include "/home/hemant/apache-2.4.25/httpd-2.4.25/srclib/apr/include/apr_general.h"
#include "ap_config.h"
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_protocol.h" /* For index_of_response().  Grump. */
#include "http_request.h"
#include "http_vhost.h"
#include "http_main.h"     /* For the default_handler below... */
#include "http_log.h"
#include "util_md5.h"
#include "http_connection.h"
#include "apr_buckets.h"
#include "util_filter.h"
#include "util_ebcdic.h"
#include "util_mutex.h"
#include "util_time.h"
#include "mpm_common.h"
#include "scoreboard.h"
#include "mod_core.h"
#include "mod_proxy.h"
#include "ap_listen.h"

int hemant_handler(request_rec *r)
{
#ifdef __DEBUG
ap_log_perror(APLOG_MARK, APLOG_NOTICE, 0, NULL, APLOGNO(00067)
                      "Flow Debug Hemant: In function hemant_handler for  PID=%d and PPID=%d of /server/hemant_test.c",getpid(),getppid());
#endif
return DECLINED;



static void register_hooks(apr_pool_t *p)
{
        
        ap_hook_handler(hemant_handler,NULL,NULL,APR_HOOK_MIDDLE);
}

AP_DECLARE_MODULE(hemant_test) =
{
    STANDARD20_MODULE_STUFF,
    NULL,   /* dir config creater */
    NULL,                       /* dir config creater */
    NULL,                       /* dir merger --- default is to override */
    NULL,                       /* server config */
    NULL,                       /* merge server config */
    register_hooks                  /* register hooks */
}; 

Please let me know, what am I missing.
Thanks
Hemant

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux