[Xitami] want virtual host to point to an executable
Ayhan Tuncer
xitami@lists.xitami.org
Mon, 30 Dec 2002 15:10:39 +0200
Marc Doigny wrote:
>
> > >
> > > It works, but i still need a method to get rid of the '?'
> > > adsl (fixed ip): <http://web.verfaillie.com/invasion>
> > > cable: <http://web.verfaillie.be/?invasion>
> > > (same directory, different servers, for some sort of load balancing between
> > > adsl and cable)
> >
> >I'm not sure I understand you correctly. Do you wish to redirect a
> >certain document
> >to a certain other server/document and again other documents to other
> >server/document123
> >or are all the requests regardless of requested document to be
> >redirected to the same url?
> These are two servers, one connected to a adsl connection with fixed ip,
> the other is a server connected to a cable network without fixed ip.
> Both servers are using the same directories for the files to be served (not
> for the config of course).
> The adsl connection is always online but slow, the cable is faster but has
> no fixed ip.
>
> >What does the query string parameter "invasion" represent? does the cgi
> >executable
> >have to use this parameter to put together the new url it will redirect
> >the user to?
> invasion is the name of a directory.
> The redirect executable gets the ip address of the cable server and creates
> a page containing
>
> STDOUT "<html><head><meta http-equiv='refresh' content='0; url=http://";
> STDOUT ipaddress$;
> STDOUT ":20800/";
> STDOUT ENVIRON$("QUERY_STRING");
> STDOUT "'></head></html>";
>
> The query string is what the executable gets from Xitami and is what follow
> the question mark in a normal request. (The example given above is a
> working one)
>
> It is possible to create one executable for each directory to be served,
> but if there is a different way to do that, i would prefer it.
>
> Marc
If you want to avoid cgi-aliases
the user would have to type in the addressbar:
http://server/executable/parameter
and the ENVIRON$("PATH_INFO") would give you /parameter .
You could not avoid an extra directory there because there is no such
thing as a
null "".exe . You definitely need a script name with or without
extension.
User would get a 404 if only http://server/parameter .
The above doesn't look like Perl but I suppose it would be so:
STDOUT "<html><head><meta http-equiv='refresh' content='0;
url=http://";
STDOUT ipaddress$;
STDOUT ":20800"; # No slash at end
STDOUT "/"; # optional
STDOUT executable$"; # optional
STDOUT ENVIRON$("PATH_INFO"); # Has a slash at beg.
STDOUT "'></head></html>";
Another alternative for creating one executable per directory=parameter
could
be this:
DomainDefaults.cfg: ( no cgi-bin alias but script=document alias )
[Cgi-alias]
Parameter1=C:/Xitami/DomainCgi-bin/executable.exe
Parameter2=C:/Xitami/DomainCgi-bin/executable.exe
Parameter3=C:/Xitami/DomainCgi-bin/executable.exe
and script:
STDOUT "<html><head><meta http-equiv='refresh' content='0;
url=http://";
STDOUT ipaddress$;
STDOUT ":20800"; # No slash at end
STDOUT ENVIRON$("SCRIPT_NAME"); # Has a slash at beg and will
give
STDOUT "'></head></html>"; # the alias path - no slash at
end
I do not use this alias example for a parameter via the script name but
you might perhaps find it workable.
Ayhan Tuncer