default virtual server

Franco Venturi <[email protected]>
Newsgroups gmane.network.mathopd
Message-ID <[email protected]>
I have been trying to have 'mathopd' have a 'default virtual server', i.e.
a virtual server that is used whenever none of the 'Host' entries is
matched. I have tried putting in the configuration file something like
this:

...
Server {
	Virtual {
		Control {
			Alias /
			Location /usr/local/www/default
		}
	}

	Virtual {
		Host host1.domain1
		Control {
			Alias /
			Location /usr/local/www/host1
		}
	}

	Virtual {
		Host host2.domain2
		Control {
			Alias /
			Location /usr/local/www/host2
		}
	}
    ...
}
...

hoping that the first 'Virtual' section would be the one that is used when
the server is accessed with a name that is neither 'host1.domain1' or
'host2.domain2', but I kept getting 'No such virtual server' errors.

After looking at the code for 'request.c', I think I found how to
change mathopd's behavior to have a 'default virtual server'.
This is the context diff patch to do it:

*** request.c.orig	Thu Apr  4 21:13:48 2002
--- request.c	Thu Apr  4 21:15:34 2002
***************
*** 645,651 ****
  	v = r->cn->s->children;
  	if (r->host) {
  		while (v) {
! 			if (v->host && hostmatch(r->host, v->host))
  				break;
  			v = v->next;
  		}
--- 645,651 ----
  	v = r->cn->s->children;
  	if (r->host) {
  		while (v) {
! 			if (!v->host || hostmatch(r->host, v->host))
  				break;
  			v = v->next;
  		}

Has anyone encountered this problem before? If so, is there a better
way other than patching the source code to fix it? Or is this a 'feature'
of mathopd?

Thanks very much in advance,
Franco Venturi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.