On 22.02.2014 19:17, Falco Schwarz wrote:
> Kaspar, I switched back to your version and realized, that the directive 
> SSLCertificateChainFile was always used in a VirtualHost.
> 
> If the directive is in server scope, the warning is written correctly.        
>                                   

Yes, that's the underlying issue which changing cmd->server to NULL in
the ap_log_error actually uncovers: it's a somewhat (at least IMO)
unfortunate side effect of how the LogLevel for a new VirtualHost is
inherited/merged from the global LogLevel directive, or more
specifically, the order in which it happens.

If you insert "LogLevel warn" (or higher) in the VirtualHost block
*before* any SSLCertificateChainFile directive, then you'll see the
vhost-scope warnings on stderr (or in the log on reloads) as well.

One potential fix could consist of the attached patch for
server/config.c, though I'm not sure if it doesn't have unwanted side
effects, either (cf. r1024427 as to why it was last changed into the
opposite direction). I guess sf is the expert on this, so I'm hoping for
his views on this. Note that config.c:ap_merge_log_config() is only part
of 2.4.x, i.e. with 2.2.x, the situation is different.

Kaspar
Index: server/config.c
===================================================================
--- server/config.c     (revision 1570984)
+++ server/config.c     (working copy)
@@ -2195,7 +2195,7 @@ AP_CORE_DECLARE(const char *) ap_init_virtual_host
     s->keep_alive = -1;
     s->keep_alive_max = -1;
     s->error_log = main_server->error_log;
-    s->log.level = APLOG_UNSET;
+    s->log.level = main_server->log.level;
     s->log.module_levels = NULL;
     /* useful default, otherwise we get a port of 0 on redirects */
     s->port = main_server->port;
@@ -2237,7 +2237,7 @@ AP_DECLARE(struct ap_logconf *) ap_new_log_config(
 AP_DECLARE(void) ap_merge_log_config(const struct ap_logconf *old_conf,
                                      struct ap_logconf *new_conf)
 {
-    if (new_conf->level != APLOG_UNSET) {
+    if (new_conf->level != APLOG_UNSET && new_conf->level != DEFAULT_LOGLEVEL) 
{
         /* Setting the main loglevel resets all per-module log levels.
          * I.e. if new->level has been set, we must ignore old->module_levels.
          */

Reply via email to