Oh when I looked at the config you posted I thought it did have
_default_:80.  If it has _default_:* then this problem is entirely
expected.  Stick a Port 80 into the default server, and/or try out this
little patch: 

Dean

Index: http_config.c
===================================================================
RCS file: /export/home/cvs/apache/src/http_config.c,v
retrieving revision 1.48
diff -u -r1.48 http_config.c
--- http_config.c       1997/04/12 04:24:56     1.48
+++ http_config.c       1997/05/13 18:53:08
@@ -957,7 +957,12 @@
     /* terminate the list */
     *addrs = NULL;
     if( s->addrs ) {
-       s->port = s->addrs->host_port;  /* set them the same, by default */
+       if (s->addrs->host_port) {
+           s->port = s->addrs->host_port;  /* set them the same, by default */
+       } else {
+           /* otherwise we get a port of 0 on redirects */
+           s->port = main_server->port;
+       }
     }
     s->next = NULL;

 


On Tue, 13 May 1997, Jack Holt wrote:

> 
> More information:  If I replace the <VirtualHost _default_:*>
> with <VirtualHost 1.2.3.4:80>, /server-info#server shows
> the correct port, instead of 0 (I assume redirects will work
> under that configuration -- I didn't actually try one.)
> 
> Also, this works if I use <VirtualHost _default_:80>, which
> will be fine for what I want to do.  And, I just tested
> redirects with this configuration, and they work.
> 
> The problem seems to be with ":*" in a <VirtualHost> directive.
> I did try <VirtualHost: 1.2.3.4:*> and got the port 0 problem
> again.  Is it that when a virtual host matches, and the port
> is specified as "*", it doesn't remeber what port the request
> came on, and tries to convert "*" to an int, instead?  (I would
> grovel a bit through the source, but I've spent enough time on
> this today.)
> 
>       --Jack
> 
> On Tue, 13 May 1997, Dean Gaudet wrote:
> 
> > Try adding "Port 80" to your main server.  You shouldn't have to add a
> > Port statement to either of those vhosts.  But the Listen statements may
> > be messing up the Port of the main server.  I'm not sure if this is a bug
> > or not though, I'd have to dig.
> > 
> > Dean
> > 
> > 
> 
> 
> 

Reply via email to