Hi,

I've tripped over the 'you need to set a ServerName before you
configure mod_webapp' a couple of times in the past so I had a go at
fixing it.  The stored hostname and port number are only used for
informational purposes, and the attached patch makes them optional
(they get replaced by '*' wherever used).

Cheers,
Gary

[ [EMAIL PROTECTED] ][ GnuPG 85A8F78B ][ http://inauspicious.org/ ]
Work without a ServerName being specified.

diff -ru mod_webapp-1.2.0_dev.orig/lib/pr_info.c mod_webapp-1.2.0_dev/lib/pr_info.c
--- mod_webapp-1.2.0_dev.orig/lib/pr_info.c     Tue Sep 24 09:44:14 2002
+++ mod_webapp-1.2.0_dev/lib/pr_info.c  Mon Sep 30 11:54:58 2002
@@ -152,7 +152,10 @@
     wa_rprintf(r,"  <table width=\"80%%\" border=\"1\" cellspacing=\"0\">\n");
     wa_rprintf(r,"   <tr>\n");
     wa_rprintf(r,"    <td bgcolor=\"#ccccff\" colspan=\"2\">\n");
-    wa_rprintf(r,"     <b>Host %s:%d</b>\n",h->name,h->port);
+    if(h->port)
+       wa_rprintf(r,"     <b>Host %s:%d</b>\n",h->name?h->name:"*",h->port);
+    else
+       wa_rprintf(r,"     <b>Host %s:*</b>\n",h->name?h->name:"*");
     wa_rprintf(r,"    </td>\n");
     wa_rprintf(r,"   </tr>\n");
     wa_rflush(r);
diff -ru mod_webapp-1.2.0_dev.orig/lib/wa_config.c mod_webapp-1.2.0_dev/lib/wa_config.c
--- mod_webapp-1.2.0_dev.orig/lib/wa_config.c   Tue Sep 24 09:44:14 2002
+++ mod_webapp-1.2.0_dev/lib/wa_config.c        Mon Sep 30 11:51:21 2002
@@ -109,8 +109,7 @@
 
     /* Check parameters */
     if (h==NULL) return("Invalid virtual host storage location");
-    if (n==NULL) return("Invalid virtual host name");
-    if (p<1) return("Invalid port number (p<1) No \"Port\" statement found");
+    if (p<0) return("Invalid port number (p<1)");
     if (p>65535) return("Invalid port number (p>65535)");
 
     /* Allocate some memory */
@@ -118,7 +117,7 @@
     if (host==NULL) return("Cannot allocate memory");
 
     /* Set up parameters */
-    host->name=apr_pstrdup(wa_pool,n);
+    host->name=n?apr_pstrdup(wa_pool,n):NULL;
     host->port=p;
     host->apps=NULL;
 
diff -ru mod_webapp-1.2.0_dev.orig/lib/wa_main.c mod_webapp-1.2.0_dev/lib/wa_main.c
--- mod_webapp-1.2.0_dev.orig/lib/wa_main.c     Tue Sep 24 09:44:14 2002
+++ mod_webapp-1.2.0_dev/lib/wa_main.c  Mon Sep 30 11:53:32 2002
@@ -189,7 +189,7 @@
 
     /* Done */
     wa_debug(WA_MARK,"Application %s deployed for http://%s:%d%s (Conn: %s)",
-             a->name,h->name,h->port,a->rpth,c->name);
+             a->name,h->name?h->name:"*",h->port,a->rpth,c->name);
     return(NULL);
 }
 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to