httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff White" <jlw...@earthlink.net>
Subject Re: [users@httpd] CGI problem
Date Sat, 14 Feb 2004 15:29:48 GMT

From: "Nick Kew"


> On Sat, 14 Feb 2004, David Weaver wrote:
>
> > To make a long story short, I don't like having to put the
"shebang"
> > line at the top of every script (since it makes my scripts very
un-portable to
> > other servers),
>
> Erm, how does it do that?  The shebang line is a shell thing that
goes
> back to the 1970s, and nothing to do with the webserver.
>

It is a design issue (good or bad?) with Apache web server.

Apache hard codes the comment marker # with ! as the check
for cgi scripts.

One can binary or source code change #! with
other language comment markers:

'*  for VBScript as the Apache cgi standard
or
// for JScript (EmcaScript) as the Apache standard.
or
whatever your new standard will be!

If on Windows check the Apache "auto" run ways,
by using the Windows file assocation run command
in Windows.

type assoc .mth in a command prompt window.

C:\Documents and Settings\User>assoc .mth
File association not found for extension .mth

type assoc /?
type ftype /?

But to test your script engine with the "#!"
standard Apache CGI setup, just type:

a one line file and save as myTest.xxx
in the regular cgi-bin dir:

#!drive:\fullPath\yourScriptEngine.exe c:\fullPath\to\filename.mth

Yes the above is a one line file.

If the path has spaces, use the 8.3 way or quote
the "drive:\path\filename.mth" part of the above 
one line cgi test file.

In Apache, the above works like this:

Apache reads the first line of myTest.xxx
in the cgi-bin folder.

if the first two characters are not #!
   error out with "No #! found"
else
  throw way the #! and load what ever
  comes after #! until a space character.
  Apache loads yourScriptEngine.exe and
  passes everything after the space, after
  the engine's path, as arguments to your
  new script engine.

So Apache loads:

yourScriptEngine.exe and as arguments for
your engine, the pathToYourScript and also
the full drive:\ApacheFullPath\cgi-bin\myTest.xxx

Yes two arguments for your script engine!

All as one long line of arguments to your
script engine.

Jeff






---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message