Mailing List Archive

exectype negotiation
Had a brainstorm...

I would like to implement exectype negotiation in much the
same way as language negotiation. I would appreciate some
feedback about this.

Creating an execution type config for the server:

Exectype sunos_4

This would allow you to have:

index.sunos_4.cgi
index.netbsd.cgi

You could then share/mirror document trees between different architectures.

Should I hang this in mod_negotiation.c?
Re: exectype negotiation [ In reply to ]
> Had a brainstorm...
>
> I would like to implement exectype negotiation in much the
> same way as language negotiation. I would appreciate some
> feedback about this.
>
> Creating an execution type config for the server:
>
> Exectype sunos_4
>
> This would allow you to have:
>
> index.sunos_4.cgi
> index.netbsd.cgi
>
> You could then share/mirror document trees between different architectures.

Is this the same thing as having two webservers (one bsd, the other solaris say)
sharing the same docuent root over NFS? I guess that you'd need a different
set of compiled CGI-BIN scripts for each architecture. So they're not sharing
the /cgi-bin/ directory, rather there's a

ScriptAlias /cgi-bin/ /usr/local/httpd/cgi-bin.sunos_4/

on one server's conf files and a

ScriptAlias /cgi-bin/ /usr/local/httpd/cgi-bin.netbsd/

sitting on another. Is this right? Are you looking for a way to build a
server farm from a set of machines with dissimilar architectures?

Mmm, seems like you're looking for a solution that allows *.cgi files
to sit anywhere under the document root and not just in scriptaliased
directories. In which case I guess that each server would have different
DefaultExecType settings in it's conf files. eg for the sunos box your conf
file would have:

<Directory /usr/local/httpd/htdocs>
DefaultExecType sunos_4
...
</Directory>

All yer published URLs could be of the form:

http://www.bleargh.com/somewhere/foo.cgi

and all you'd do is make sure that you've got a:

/usr/local/httpd/htdocs/somewhere/foo.sunos_4.cgi

What sort of URLs do you envisage your server(s) receiving in these
circumstances. And what do you do if the relevent *.<arch>.cgi isn't
there?

Can you see a way to have the same functionality, but using MultiViews?

> Should I hang this in mod_negotiation.c?

Ay.
Re: exectype negotiation [ In reply to ]
> Mmm, seems like you're looking for a solution that allows *.cgi files
> to sit anywhere under the document root and not just in scriptaliased
> directories. In which case I guess that each server would have different
> DefaultExecType settings in it's conf files. eg for the sunos box your conf
> file would have:
>
> <Directory /usr/local/httpd/htdocs>
> DefaultExecType sunos_4
> ...
> </Directory>
>
> All yer published URLs could be of the form:
>
> http://www.bleargh.com/somewhere/foo.cgi
>
> and all you'd do is make sure that you've got a:
>
> /usr/local/httpd/htdocs/somewhere/foo.sunos_4.cgi

Exactly.


> What sort of URLs do you envisage your server(s) receiving in these
> circumstances. And what do you do if the relevent *.<arch>.cgi isn't
> there?

Receiving foo.cgi, Looking for foo."DefaultExecType".cgi, Fallback to foo.cgi

> Can you see a way to have the same functionality, but using MultiViews?

There appears to be some pretty good models in mod_negotiation.c for
handling Languages. Looks pretty easy to implement. I'll give it a go.

I can see a need for a standard naming convention for ExecTypes...
Re: exectype negotiation [ In reply to ]
Hmmmm... direct support for this sort of thing smacks of creeping featurism,
but it may not be necessary. It's possible that if you add

AddType application/x-httpd-cgi suncgi
AddType garbage/dont-use;qs=0 bsdcgi

to the config files for the Sun server (and the opposite for the BSD box),
then a MultiViews negotiation between foo.suncgi and foo.bsdcgi would do
what Randy wants, with no new code required. (Note the "qs=0", which is
what actually would be doing the work).

rst

PS --- I say "it's possible" only because I haven't tried it...