--- httpd-2.4.4.orig/include/http_config.h 2012-12-17 11:49:56.000000000 +0000 +++ httpd-2.4.4.orig/include/http_config.h 2013-07-03 12:37:52.918526143 +0100 @@ -326,6 +326,8 @@ /** directive with syntax error */ const ap_directive_t *err_directive; + /** Request associated with this command */ + request_rec *request; }; /** --- httpd-2.4.4.orig/server/config.c 2012-12-04 02:22:24.000000000 +0000 +++ httpd-2.4.4.orig/server/config.c 2013-07-03 12:43:15.296370686 +0100 @@ -853,10 +853,17 @@ if ((parms->override & cmd->req_override) == 0 && !override_list_ok) { if (parms->override & NONFATAL_OVERRIDE) { - ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, parms->temp_pool, - APLOGNO(02295) - "%s in .htaccess forbidden by AllowOverride", - cmd->name); + if (parms->request) { + ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, parms->request, + APLOGNO(02295) + "%s in .htaccess forbidden by AllowOverride", + cmd->name); + } else { + ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, parms->temp_pool, + APLOGNO(02295) + "%s in .htaccess forbidden by AllowOverride", + cmd->name); + } return NULL; } else { @@ -1274,10 +1281,17 @@ if (ml == NULL) { parms->err_directive = current; if (parms->override & NONFATAL_UNKNOWN) { - ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, parms->temp_pool, - APLOGNO(02296) "Unknown directive %s " - "perhaps misspelled or defined by a module " - "not included in the server configuration", dir); + if (parms->request) { + ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, parms->request, + APLOGNO(02296) "Unknown directive %s " + "perhaps misspelled or defined by a module " + "not included in the server configuration", dir); + } else { + ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, parms->temp_pool, + APLOGNO(02296) "Unknown directive %s " + "perhaps misspelled or defined by a module " + "not included in the server configuration", dir); + } return NULL; } else { @@ -1553,7 +1567,7 @@ */ static cmd_parms default_parms = -{NULL, 0, 0, NULL, -1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; +{NULL, 0, 0, NULL, -1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; AP_DECLARE(char *) ap_server_root_relative(apr_pool_t *p, const char *file) { @@ -2103,6 +2117,7 @@ parms.temp_pool = r->pool; parms.server = r->server; parms.path = apr_pstrdup(r->pool, d); + parms.request = r; /* loop through the access names and find the first one */ while (access_name[0]) {