RE: [EXTERNAL] Re: No content returned from directive handler sample.
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 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 #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 intrefresh ; } 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 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 wrote: > > > > On Tue, Jul 30, 2019 at 11:41 AM Bill Moo 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
Re: No content returned from directive handler sample.
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 wrote: > > On Tue, Jul 30, 2019 at 11:41 AM Bill Moo 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.
On Tue, Jul 30, 2019 at 11:41 AM Bill Moo 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.
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 wrote: > > On Tue, Jul 30, 2019 at 11:07 AM Bill Moo 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: > > > > > > SetHandler configHandler > > > > > > > > sqlConnection "SQL Connection String" > > sqlUserInfo username password > > > > 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.
On Tue, Jul 30, 2019 at 11:07 AM Bill Moo 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: > > > SetHandler configHandler > > > > sqlConnection "SQL Connection String" > sqlUserInfo username password > 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.
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: SetHandler configHandler sqlConnection "SQL Connection String" sqlUserInfo username password 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: release?
> Is this release likely to be ready before August 10? I am guessing "no" at > this point, but wanted to get an idea early. Not likely
RE: release?
Hi, Is this release likely to be ready before August 10? I am guessing "no" at this point, but wanted to get an idea early. Cheers, Mark -Original Message- From: Rainer Jung [mailto:rainer.j...@kippdata.de] Sent: 20 July 2019 10:44 To: dev@httpd.apache.org Subject: Re: release? m 20.07.2019 um 10:38 schrieb Marion & Christophe JAILLET: > Hi, > > PR60757 and corresponding r1853560 could be a good candidate for backport. > > I don't have a configuration for testing so I won't propose it myself > for backport, but the patch looks simple. I have added this one (mod_proxy_hcheck in BalancerMember) and two other ones ("Mute frequent debug message in mod_proxy_hcheck" and "bytraffic needs byrequests") to STATUS right now. Regards, Rainer > Le 18/07/2019 à 16:06, Stefan Eissing a écrit : >> It would be great if we could make a release this month. There are >> several fixes and improvements already backported and a few >> outstanding issues that need a vote or two. >> >> Please have a look if you find the time. I think Daniel expressed >> willingness to RM this? That'd be great! >> >> Cheers, Stefan --- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Please refer to https://www.db.com/disclosures for additional EU corporate and regulatory disclosures and to http://www.db.com/unitedkingdom/content/privacy.htm for information about privacy.