3

I developed an apache module in which I am collecting some data from a request. How to call my module for every request by default in Apache? I wrote my module in C.

My Module declaration code

module AP_MODULE_DECLARE_DATA helloworld_module = {
STANDARD20_MODULE_STUFF,
NULL,
NULL,
NULL,
NULL,
NULL,
helloworld_hooks
};

this is my module hook code

static void helloworld_hooks(apr_pool_t *pool)
{
ap_hook_handler(helloworld_handler, NULL, NULL, APR_HOOK_FIRST);
}

this is my module main function code

static int helloworld_handler(request_rec *r)
{
  // here I am implementing my all functionality.
}

http.conf file settings

 <Location /helloworld> 
 SetHandler helloworld 
 </Location>

I want every time request reach to apache my module should invoke automatically.

  • I suggest to put something from your code here to illustrate the problem. It is important to show, that you really have something which requires a little fix only. – peterh Jul 23 '16 at 23:31
  • @peterh I have added my code. Please have a look and suggest solution. – sumit chansouliya Jul 25 '16 at 10:25
  • I don't know the apr enough well. Is your apache config okay? Can you surely see your module in the list of your apache config by a well-directed apachectl command? – peterh Jul 25 '16 at 10:36
  • In my http.conf file I gave location for my module and when I am hitting that location My module is working but I want it should work for all URL by default ' SetHandler helloworld ' – sumit chansouliya Jul 25 '16 at 10:48

0 Answers0