You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Bill Moo <mo...@gmail.com> on 2019/07/30 15:06:47 UTC

No content returned from directive handler sample.

Hello,

I am embarking on my first module and using the Apache provided
example to dump my module's configuration as my starting point I’m
having no real success.

I have configured everything as per the sample and compiled and
configured using:

sudo apxs -i -a -n mod_graphing -c mod_graphing.c

I have to provide the -n mod_graphing parameter as without it I get :
apxs:Error: Sorry, cannot determine bootstrap symbol name.

The name (mod_graphing) being the same as the module tag. In addition
to this when I try to restart the server I get a Syntax error on the
generated mod_graphing.load file as it has appended _module to my
mod_graphing!

Assuming my interpretation is correct I created a mod_graphing.conf
file and added to it:

<Location /info>
        SetHandler configHandler
</Location>

<Directory /info>
        sqlConnection "SQL Connection String"
        sqlUserInfo username password
</Directory>

With configHandler being the name of my module function. When I go to
http://localhost/info I get a 404 Not Found error when I was expecting
to see the two values of my config settings defined with in the
Directory entry (having used ACCESS_CONF rather than RSRC_CONF in my
attempts to get this to work).

I'm at a bit of loss here and don't really know how to move forward with this.
-- 
Bill

Re: [EXTERNAL] Re: No content returned from directive handler sample.

Posted by Bill Moo <mo...@gmail.com>.
For those interested I have now fixed this thanks to a bit of logging
and the culprit was in fact this line:

if(!r->handler || strcmp(r->handler, "configHandler")) return(DECLINED);

the string being offered in the r->handler was in fact confighandler
so the comparison was failing and declining the offer!

On Wed, 31 Jul 2019 at 07:11, Bill Moo <mo...@gmail.com> wrote:
>
> No I hadn't so thank you Christopher.
>
> On Tue, 30 Jul 2019 at 17:37, Nebergall, Christopher
> <cn...@sandia.gov.invalid> wrote:
> >
> > Have you seen this example?
> >
> > https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x/modules/examples/mod_example_hooks.c
> >
> > It will show you how to log at the very least.
> >
> > -Topher
> > -----Original Message-----
> > From: Bill Moo <mo...@gmail.com>
> > Sent: Tuesday, July 30, 2019 11:06 AM
> > To: modules-dev@httpd.apache.org
> > Subject: [EXTERNAL] Re: No content returned from directive handler sample.
> >
> > If it help anyone then here if the code I am using:
> >
> > /* module mod_graphing.c: */
> > #include <stdio.h>
> > #include "apr_hash.h"
> > #include "ap_config.h"
> > #include "ap_provider.h"
> > #include "httpd.h"
> > #include "http_core.h"
> > #include "http_config.h"
> > #include "http_log.h"
> > #include "http_protocol.h"
> > #include "http_request.h"
> >
> > extern module mod_graphing ;
> >
> > /* Struct used to store template settings for a graph */ typedef struct {
> >     const char *    m_Name ;
> >     const char *    m_Template ;
> >     unsigned int    refresh ;
> > } PROCEDURE ;
> >
> > /* Our configuration prototype and declaration: */ typedef struct {
> >     const char *    m_SQL ;     /* SQL Connection String */
> >     const char *    m_Usr ;     /* SQL User name */
> >     const char *    m_Pwd ;     /* SQL Password */
> >     unsigned long   m_Port ;     /* Port No */
> >     PROCEDURE * m_Procs ;/* Array of Procedure Structures */ } CONFIG ;
> >
> > static int configHandler(request_rec *) ; const char * configSetSQL(cmd_parms *, void *, const char *) ; const char * configSetPort(cmd_parms *, void *, const char *) ; //const char * configSetPort(cmd_parms *, void *, const unsigned long *) ; const char * configSetSQLUser(cmd_parms *, void *, const char *, const char *) ; static void register_hooks(apr_pool_t *) ;
> >
> > static CONFIG Config;
> >
> > /* Handler for the "examplePath" directive */ const char * configSetSQL(cmd_parms * cmd, void * cfg, const char * arg) {
> >     Config.m_SQL = arg ;
> >     return NULL ;
> > }
> >
> > const char * configSetPort(cmd_parms * cmd, void * cfg, const char * arg) {
> >     Config.m_Port = atol(arg) ;
> >     return NULL ;
> > }
> >
> > const char * configSetSQLUser(cmd_parms * cmd, void * cfg, const char
> > * usr, const char * pwd) {
> >     Config.m_Usr = usr ;
> >     Config.m_Pwd = pwd ;
> >     return NULL ;
> > }
> >
> > /* The directive structure for our name tag: */ extern const command_rec configDirectives[] = {
> >     AP_INIT_TAKE1("sqlConnection", configSetSQL, NULL, ACCESS_CONF, "Set the PostgreSQL Connection"),
> >     AP_INIT_TAKE1("sqlPortNo”, configSetPort, NULL, ACCESS_CONF, "Set SQL Port No”),
> >     AP_INIT_TAKE2("sqlUserInfo", configSetSQLUser, NULL, ACCESS_CONF, "Set PostgreSQL Username / Password"),
> >     { NULL }
> > };
> >
> > /* Our module handler: */
> > static int configHandler(request_rec *r) {
> >     if(!r->handler || strcmp(r->handler, "configHandler")) return(DECLINED);
> >     ap_set_content_type(r, "text/plain");
> >     ap_rprintf(r, "User IP : %s", r->useragent_ip) ;
> >     ap_rprintf(r, "SQL Conn : %s", Config->m_SQL) ;
> >     ap_rprintf(r, "SQL User : %s, %s", Config->m_Usr, Config->m_Pwd) ;
> >     ap_rprintf(r, “Port No : %ul", Config->m_Port) ;
> >     return OK;
> > };
> >
> > /* The hook registration function (also initializes the default config
> > values): */
> > static void register_hooks(apr_pool_t *pool) {
> >     Config.m_SQL = NULL ;
> >     Config.m_Usr = NULL ;
> >     Config.m_Pwd = NULL ;
> >     Config.m_Port = 0 ;
> >     Config.m_Procs = NULL ;
> >     ap_hook_handler(configHandler, NULL, NULL, APR_HOOK_LAST); };
> >
> > /* Our module name tag: */
> > module AP_MODULE_DECLARE_DATA mod_graphing = {
> >     STANDARD20_MODULE_STUFF,
> >     NULL,               /* Per-directory configuration handler */
> >     NULL,               /* Merge handler for per-directory configurations */
> >     NULL,               /* Per-server configuration handler */
> >     NULL,               /* Merge handler for per-server configurations */
> >     configDirectives, /* Any directives we may have for httpd */
> >     register_hooks      /* Our hook registering function */
> > };
> >
> > Apologies for polluting the thread with this.
> >
> > On Tue, 30 Jul 2019 at 16:55, Bill Moo <mo...@gmail.com> wrote:
> > >
> > > Well I have tired what you suggested Eric but to no avail so
> > > regrettably no further forward. I have even tried several variations
> > > in both the Location and Directory entries.
> > >
> > > The Apache2 install I have is stock on Ubuntu 18.04 so I don't think
> > > there are any proxying modules in place.
> > >
> > > Can you, or indeed anyone, tell me how I can write 'debug' output to
> > > either the console or one of the Apache logs please. If I can do this
> > > I'll at least be able to see if my code is being called prior to the
> > > DECLINE.
> > >
> > > On Tue, 30 Jul 2019 at 16:44, Eric Covener <co...@gmail.com> wrote:
> > > >
> > > > On Tue, Jul 30, 2019 at 11:41 AM Bill Moo <mo...@gmail.com> wrote:
> > > > >
> > > > > Hey, thanks for the quick reply. But I'll be honest and confess to
> > > > > not knowing exactly what you are meaning. If I do understand
> > > > > correctly then the Location is correct but the Directory entry
> > > > > needs to be /var/www/html/info is this correct?
> > > >
> > > > Yes, it should be a full filesystem path  -- if you need that kind
> > > > of section at all.
> > > > 2nd caveat -- proxy-like modules can short-circuit the mapping
> > > > altogether and no directory section may match.

Re: [EXTERNAL] Re: No content returned from directive handler sample.

Posted by Bill Moo <mo...@gmail.com>.
No I hadn't so thank you Christopher.

On Tue, 30 Jul 2019 at 17:37, Nebergall, Christopher
<cn...@sandia.gov.invalid> wrote:
>
> Have you seen this example?
>
> https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x/modules/examples/mod_example_hooks.c
>
> It will show you how to log at the very least.
>
> -Topher
> -----Original Message-----
> From: Bill Moo <mo...@gmail.com>
> Sent: Tuesday, July 30, 2019 11:06 AM
> To: modules-dev@httpd.apache.org
> Subject: [EXTERNAL] Re: No content returned from directive handler sample.
>
> If it help anyone then here if the code I am using:
>
> /* module mod_graphing.c: */
> #include <stdio.h>
> #include "apr_hash.h"
> #include "ap_config.h"
> #include "ap_provider.h"
> #include "httpd.h"
> #include "http_core.h"
> #include "http_config.h"
> #include "http_log.h"
> #include "http_protocol.h"
> #include "http_request.h"
>
> extern module mod_graphing ;
>
> /* Struct used to store template settings for a graph */ typedef struct {
>     const char *    m_Name ;
>     const char *    m_Template ;
>     unsigned int    refresh ;
> } PROCEDURE ;
>
> /* Our configuration prototype and declaration: */ typedef struct {
>     const char *    m_SQL ;     /* SQL Connection String */
>     const char *    m_Usr ;     /* SQL User name */
>     const char *    m_Pwd ;     /* SQL Password */
>     unsigned long   m_Port ;     /* Port No */
>     PROCEDURE * m_Procs ;/* Array of Procedure Structures */ } CONFIG ;
>
> static int configHandler(request_rec *) ; const char * configSetSQL(cmd_parms *, void *, const char *) ; const char * configSetPort(cmd_parms *, void *, const char *) ; //const char * configSetPort(cmd_parms *, void *, const unsigned long *) ; const char * configSetSQLUser(cmd_parms *, void *, const char *, const char *) ; static void register_hooks(apr_pool_t *) ;
>
> static CONFIG Config;
>
> /* Handler for the "examplePath" directive */ const char * configSetSQL(cmd_parms * cmd, void * cfg, const char * arg) {
>     Config.m_SQL = arg ;
>     return NULL ;
> }
>
> const char * configSetPort(cmd_parms * cmd, void * cfg, const char * arg) {
>     Config.m_Port = atol(arg) ;
>     return NULL ;
> }
>
> const char * configSetSQLUser(cmd_parms * cmd, void * cfg, const char
> * usr, const char * pwd) {
>     Config.m_Usr = usr ;
>     Config.m_Pwd = pwd ;
>     return NULL ;
> }
>
> /* The directive structure for our name tag: */ extern const command_rec configDirectives[] = {
>     AP_INIT_TAKE1("sqlConnection", configSetSQL, NULL, ACCESS_CONF, "Set the PostgreSQL Connection"),
>     AP_INIT_TAKE1("sqlPortNo”, configSetPort, NULL, ACCESS_CONF, "Set SQL Port No”),
>     AP_INIT_TAKE2("sqlUserInfo", configSetSQLUser, NULL, ACCESS_CONF, "Set PostgreSQL Username / Password"),
>     { NULL }
> };
>
> /* Our module handler: */
> static int configHandler(request_rec *r) {
>     if(!r->handler || strcmp(r->handler, "configHandler")) return(DECLINED);
>     ap_set_content_type(r, "text/plain");
>     ap_rprintf(r, "User IP : %s", r->useragent_ip) ;
>     ap_rprintf(r, "SQL Conn : %s", Config->m_SQL) ;
>     ap_rprintf(r, "SQL User : %s, %s", Config->m_Usr, Config->m_Pwd) ;
>     ap_rprintf(r, “Port No : %ul", Config->m_Port) ;
>     return OK;
> };
>
> /* The hook registration function (also initializes the default config
> values): */
> static void register_hooks(apr_pool_t *pool) {
>     Config.m_SQL = NULL ;
>     Config.m_Usr = NULL ;
>     Config.m_Pwd = NULL ;
>     Config.m_Port = 0 ;
>     Config.m_Procs = NULL ;
>     ap_hook_handler(configHandler, NULL, NULL, APR_HOOK_LAST); };
>
> /* Our module name tag: */
> module AP_MODULE_DECLARE_DATA mod_graphing = {
>     STANDARD20_MODULE_STUFF,
>     NULL,               /* Per-directory configuration handler */
>     NULL,               /* Merge handler for per-directory configurations */
>     NULL,               /* Per-server configuration handler */
>     NULL,               /* Merge handler for per-server configurations */
>     configDirectives, /* Any directives we may have for httpd */
>     register_hooks      /* Our hook registering function */
> };
>
> Apologies for polluting the thread with this.
>
> On Tue, 30 Jul 2019 at 16:55, Bill Moo <mo...@gmail.com> wrote:
> >
> > Well I have tired what you suggested Eric but to no avail so
> > regrettably no further forward. I have even tried several variations
> > in both the Location and Directory entries.
> >
> > The Apache2 install I have is stock on Ubuntu 18.04 so I don't think
> > there are any proxying modules in place.
> >
> > Can you, or indeed anyone, tell me how I can write 'debug' output to
> > either the console or one of the Apache logs please. If I can do this
> > I'll at least be able to see if my code is being called prior to the
> > DECLINE.
> >
> > On Tue, 30 Jul 2019 at 16:44, Eric Covener <co...@gmail.com> wrote:
> > >
> > > On Tue, Jul 30, 2019 at 11:41 AM Bill Moo <mo...@gmail.com> wrote:
> > > >
> > > > Hey, thanks for the quick reply. But I'll be honest and confess to
> > > > not knowing exactly what you are meaning. If I do understand
> > > > correctly then the Location is correct but the Directory entry
> > > > needs to be /var/www/html/info is this correct?
> > >
> > > Yes, it should be a full filesystem path  -- if you need that kind
> > > of section at all.
> > > 2nd caveat -- proxy-like modules can short-circuit the mapping
> > > altogether and no directory section may match.

RE: [EXTERNAL] Re: No content returned from directive handler sample.

Posted by "Nebergall, Christopher" <cn...@sandia.gov.INVALID>.
Have you seen this example?

https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x/modules/examples/mod_example_hooks.c

It will show you how to log at the very least.

-Topher
-----Original Message-----
From: Bill Moo <mo...@gmail.com> 
Sent: Tuesday, July 30, 2019 11:06 AM
To: modules-dev@httpd.apache.org
Subject: [EXTERNAL] Re: No content returned from directive handler sample.

If it help anyone then here if the code I am using:

/* module mod_graphing.c: */
#include <stdio.h>
#include "apr_hash.h"
#include "ap_config.h"
#include "ap_provider.h"
#include "httpd.h"
#include "http_core.h"
#include "http_config.h"
#include "http_log.h"
#include "http_protocol.h"
#include "http_request.h"

extern module mod_graphing ;

/* Struct used to store template settings for a graph */ typedef struct {
    const char *    m_Name ;
    const char *    m_Template ;
    unsigned int    refresh ;
} PROCEDURE ;

/* Our configuration prototype and declaration: */ typedef struct {
    const char *    m_SQL ;     /* SQL Connection String */
    const char *    m_Usr ;     /* SQL User name */
    const char *    m_Pwd ;     /* SQL Password */
    unsigned long   m_Port ;     /* Port No */
    PROCEDURE * m_Procs ;/* Array of Procedure Structures */ } CONFIG ;

static int configHandler(request_rec *) ; const char * configSetSQL(cmd_parms *, void *, const char *) ; const char * configSetPort(cmd_parms *, void *, const char *) ; //const char * configSetPort(cmd_parms *, void *, const unsigned long *) ; const char * configSetSQLUser(cmd_parms *, void *, const char *, const char *) ; static void register_hooks(apr_pool_t *) ;

static CONFIG Config;

/* Handler for the "examplePath" directive */ const char * configSetSQL(cmd_parms * cmd, void * cfg, const char * arg) {
    Config.m_SQL = arg ;
    return NULL ;
}

const char * configSetPort(cmd_parms * cmd, void * cfg, const char * arg) {
    Config.m_Port = atol(arg) ;
    return NULL ;
}

const char * configSetSQLUser(cmd_parms * cmd, void * cfg, const char
* usr, const char * pwd) {
    Config.m_Usr = usr ;
    Config.m_Pwd = pwd ;
    return NULL ;
}

/* The directive structure for our name tag: */ extern const command_rec configDirectives[] = {
    AP_INIT_TAKE1("sqlConnection", configSetSQL, NULL, ACCESS_CONF, "Set the PostgreSQL Connection"),
    AP_INIT_TAKE1("sqlPortNo”, configSetPort, NULL, ACCESS_CONF, "Set SQL Port No”),
    AP_INIT_TAKE2("sqlUserInfo", configSetSQLUser, NULL, ACCESS_CONF, "Set PostgreSQL Username / Password"),
    { NULL }
};

/* Our module handler: */
static int configHandler(request_rec *r) {
    if(!r->handler || strcmp(r->handler, "configHandler")) return(DECLINED);
    ap_set_content_type(r, "text/plain");
    ap_rprintf(r, "User IP : %s", r->useragent_ip) ;
    ap_rprintf(r, "SQL Conn : %s", Config->m_SQL) ;
    ap_rprintf(r, "SQL User : %s, %s", Config->m_Usr, Config->m_Pwd) ;
    ap_rprintf(r, “Port No : %ul", Config->m_Port) ;
    return OK;
};

/* The hook registration function (also initializes the default config
values): */
static void register_hooks(apr_pool_t *pool) {
    Config.m_SQL = NULL ;
    Config.m_Usr = NULL ;
    Config.m_Pwd = NULL ;
    Config.m_Port = 0 ;
    Config.m_Procs = NULL ;
    ap_hook_handler(configHandler, NULL, NULL, APR_HOOK_LAST); };

/* Our module name tag: */
module AP_MODULE_DECLARE_DATA mod_graphing = {
    STANDARD20_MODULE_STUFF,
    NULL,               /* Per-directory configuration handler */
    NULL,               /* Merge handler for per-directory configurations */
    NULL,               /* Per-server configuration handler */
    NULL,               /* Merge handler for per-server configurations */
    configDirectives, /* Any directives we may have for httpd */
    register_hooks      /* Our hook registering function */
};

Apologies for polluting the thread with this.

On Tue, 30 Jul 2019 at 16:55, Bill Moo <mo...@gmail.com> wrote:
>
> Well I have tired what you suggested Eric but to no avail so 
> regrettably no further forward. I have even tried several variations 
> in both the Location and Directory entries.
>
> The Apache2 install I have is stock on Ubuntu 18.04 so I don't think 
> there are any proxying modules in place.
>
> Can you, or indeed anyone, tell me how I can write 'debug' output to 
> either the console or one of the Apache logs please. If I can do this 
> I'll at least be able to see if my code is being called prior to the 
> DECLINE.
>
> On Tue, 30 Jul 2019 at 16:44, Eric Covener <co...@gmail.com> wrote:
> >
> > On Tue, Jul 30, 2019 at 11:41 AM Bill Moo <mo...@gmail.com> wrote:
> > >
> > > Hey, thanks for the quick reply. But I'll be honest and confess to 
> > > not knowing exactly what you are meaning. If I do understand 
> > > correctly then the Location is correct but the Directory entry 
> > > needs to be /var/www/html/info is this correct?
> >
> > Yes, it should be a full filesystem path  -- if you need that kind 
> > of section at all.
> > 2nd caveat -- proxy-like modules can short-circuit the mapping 
> > altogether and no directory section may match.

Re: No content returned from directive handler sample.

Posted by Bill Moo <mo...@gmail.com>.
If it help anyone then here if the code I am using:

/* module mod_graphing.c: */
#include <stdio.h>
#include "apr_hash.h"
#include "ap_config.h"
#include "ap_provider.h"
#include "httpd.h"
#include "http_core.h"
#include "http_config.h"
#include "http_log.h"
#include "http_protocol.h"
#include "http_request.h"

extern module mod_graphing ;

/* Struct used to store template settings for a graph */
typedef struct {
    const char *    m_Name ;
    const char *    m_Template ;
    unsigned int    refresh ;
} PROCEDURE ;

/* Our configuration prototype and declaration: */
typedef struct {
    const char *    m_SQL ;     /* SQL Connection String */
    const char *    m_Usr ;     /* SQL User name */
    const char *    m_Pwd ;     /* SQL Password */
    unsigned long   m_Port ;     /* Port No */
    PROCEDURE * m_Procs ;/* Array of Procedure Structures */
} CONFIG ;

static int configHandler(request_rec *) ;
const char * configSetSQL(cmd_parms *, void *, const char *) ;
const char * configSetPort(cmd_parms *, void *, const char *) ;
//const char * configSetPort(cmd_parms *, void *, const unsigned long *) ;
const char * configSetSQLUser(cmd_parms *, void *, const char *, const char *) ;
static void register_hooks(apr_pool_t *) ;

static CONFIG Config;

/* Handler for the "examplePath" directive */
const char * configSetSQL(cmd_parms * cmd, void * cfg, const char * arg) {
    Config.m_SQL = arg ;
    return NULL ;
}

const char * configSetPort(cmd_parms * cmd, void * cfg, const char * arg) {
    Config.m_Port = atol(arg) ;
    return NULL ;
}

const char * configSetSQLUser(cmd_parms * cmd, void * cfg, const char
* usr, const char * pwd) {
    Config.m_Usr = usr ;
    Config.m_Pwd = pwd ;
    return NULL ;
}

/* The directive structure for our name tag: */
extern const command_rec configDirectives[] = {
    AP_INIT_TAKE1("sqlConnection", configSetSQL, NULL, ACCESS_CONF,
"Set the PostgreSQL Connection"),
    AP_INIT_TAKE1("sqlPortNo”, configSetPort, NULL, ACCESS_CONF, "Set
SQL Port No”),
    AP_INIT_TAKE2("sqlUserInfo", configSetSQLUser, NULL, ACCESS_CONF,
"Set PostgreSQL Username / Password"),
    { NULL }
};

/* Our module handler: */
static int configHandler(request_rec *r) {
    if(!r->handler || strcmp(r->handler, "configHandler")) return(DECLINED);
    ap_set_content_type(r, "text/plain");
    ap_rprintf(r, "User IP : %s", r->useragent_ip) ;
    ap_rprintf(r, "SQL Conn : %s", Config->m_SQL) ;
    ap_rprintf(r, "SQL User : %s, %s", Config->m_Usr, Config->m_Pwd) ;
    ap_rprintf(r, “Port No : %ul", Config->m_Port) ;
    return OK;
};

/* The hook registration function (also initializes the default config
values): */
static void register_hooks(apr_pool_t *pool) {
    Config.m_SQL = NULL ;
    Config.m_Usr = NULL ;
    Config.m_Pwd = NULL ;
    Config.m_Port = 0 ;
    Config.m_Procs = NULL ;
    ap_hook_handler(configHandler, NULL, NULL, APR_HOOK_LAST);
};

/* Our module name tag: */
module AP_MODULE_DECLARE_DATA mod_graphing = {
    STANDARD20_MODULE_STUFF,
    NULL,               /* Per-directory configuration handler */
    NULL,               /* Merge handler for per-directory configurations */
    NULL,               /* Per-server configuration handler */
    NULL,               /* Merge handler for per-server configurations */
    configDirectives, /* Any directives we may have for httpd */
    register_hooks      /* Our hook registering function */
};

Apologies for polluting the thread with this.

On Tue, 30 Jul 2019 at 16:55, Bill Moo <mo...@gmail.com> wrote:
>
> Well I have tired what you suggested Eric but to no avail so
> regrettably no further forward. I have even tried several variations
> in both the Location and Directory entries.
>
> The Apache2 install I have is stock on Ubuntu 18.04 so I don't think
> there are any proxying modules in place.
>
> Can you, or indeed anyone, tell me how I can write 'debug' output to
> either the console or one of the Apache logs please. If I can do this
> I'll at least be able to see if my code is being called prior to the
> DECLINE.
>
> On Tue, 30 Jul 2019 at 16:44, Eric Covener <co...@gmail.com> wrote:
> >
> > On Tue, Jul 30, 2019 at 11:41 AM Bill Moo <mo...@gmail.com> wrote:
> > >
> > > Hey, thanks for the quick reply. But I'll be honest and confess to not
> > > knowing exactly what you are meaning. If I do understand correctly
> > > then the Location is correct but the Directory entry needs to be
> > > /var/www/html/info is this correct?
> >
> > Yes, it should be a full filesystem path  -- if you need that kind of
> > section at all.
> > 2nd caveat -- proxy-like modules can short-circuit the mapping
> > altogether and no directory section may match.

Re: No content returned from directive handler sample.

Posted by Bill Moo <mo...@gmail.com>.
Well I have tired what you suggested Eric but to no avail so
regrettably no further forward. I have even tried several variations
in both the Location and Directory entries.

The Apache2 install I have is stock on Ubuntu 18.04 so I don't think
there are any proxying modules in place.

Can you, or indeed anyone, tell me how I can write 'debug' output to
either the console or one of the Apache logs please. If I can do this
I'll at least be able to see if my code is being called prior to the
DECLINE.

On Tue, 30 Jul 2019 at 16:44, Eric Covener <co...@gmail.com> wrote:
>
> On Tue, Jul 30, 2019 at 11:41 AM Bill Moo <mo...@gmail.com> wrote:
> >
> > Hey, thanks for the quick reply. But I'll be honest and confess to not
> > knowing exactly what you are meaning. If I do understand correctly
> > then the Location is correct but the Directory entry needs to be
> > /var/www/html/info is this correct?
>
> Yes, it should be a full filesystem path  -- if you need that kind of
> section at all.
> 2nd caveat -- proxy-like modules can short-circuit the mapping
> altogether and no directory section may match.

Re: No content returned from directive handler sample.

Posted by Eric Covener <co...@gmail.com>.
On Tue, Jul 30, 2019 at 11:41 AM Bill Moo <mo...@gmail.com> wrote:
>
> Hey, thanks for the quick reply. But I'll be honest and confess to not
> knowing exactly what you are meaning. If I do understand correctly
> then the Location is correct but the Directory entry needs to be
> /var/www/html/info is this correct?

Yes, it should be a full filesystem path  -- if you need that kind of
section at all.
2nd caveat -- proxy-like modules can short-circuit the mapping
altogether and no directory section may match.

Re: No content returned from directive handler sample.

Posted by Bill Moo <mo...@gmail.com>.
Hey, thanks for the quick reply. But I'll be honest and confess to not
knowing exactly what you are meaning. If I do understand correctly
then the Location is correct but the Directory entry needs to be
/var/www/html/info is this correct?

On Tue, 30 Jul 2019 at 16:17, Eric Covener <co...@gmail.com> wrote:
>
> On Tue, Jul 30, 2019 at 11:07 AM Bill Moo <mo...@gmail.com> wrote:
> >
> > Hello,
> >
> > I am embarking on my first module and using the Apache provided
> > example to dump my module's configuration as my starting point I’m
> > having no real success.
> >
> > I have configured everything as per the sample and compiled and
> > configured using:
> >
> > sudo apxs -i -a -n mod_graphing -c mod_graphing.c
> >
> > I have to provide the -n mod_graphing parameter as without it I get :
> > apxs:Error: Sorry, cannot determine bootstrap symbol name.
> >
> > The name (mod_graphing) being the same as the module tag. In addition
> > to this when I try to restart the server I get a Syntax error on the
> > generated mod_graphing.load file as it has appended _module to my
> > mod_graphing!
> >
> > Assuming my interpretation is correct I created a mod_graphing.conf
> > file and added to it:
> >
> > <Location /info>
> >         SetHandler configHandler
> > </Location>
> >
> > <Directory /info>
> >         sqlConnection "SQL Connection String"
> >         sqlUserInfo username password
> > </Directory>
>
> Does something cause the /info URL to be mapped to the actual
> directory /info?  It looks like it should be a filesystem path in the
> latter.

Re: No content returned from directive handler sample.

Posted by Eric Covener <co...@gmail.com>.
On Tue, Jul 30, 2019 at 11:07 AM Bill Moo <mo...@gmail.com> wrote:
>
> Hello,
>
> I am embarking on my first module and using the Apache provided
> example to dump my module's configuration as my starting point I’m
> having no real success.
>
> I have configured everything as per the sample and compiled and
> configured using:
>
> sudo apxs -i -a -n mod_graphing -c mod_graphing.c
>
> I have to provide the -n mod_graphing parameter as without it I get :
> apxs:Error: Sorry, cannot determine bootstrap symbol name.
>
> The name (mod_graphing) being the same as the module tag. In addition
> to this when I try to restart the server I get a Syntax error on the
> generated mod_graphing.load file as it has appended _module to my
> mod_graphing!
>
> Assuming my interpretation is correct I created a mod_graphing.conf
> file and added to it:
>
> <Location /info>
>         SetHandler configHandler
> </Location>
>
> <Directory /info>
>         sqlConnection "SQL Connection String"
>         sqlUserInfo username password
> </Directory>

Does something cause the /info URL to be mapped to the actual
directory /info?  It looks like it should be a filesystem path in the
latter.