You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Chris Babstock <ca...@gmail.com> on 2005/10/23 05:00:39 UTC

[users@httpd] How do I make a "CGI Alias"?

I say "CGI Alias" in quotations, because it's not the same type of alias
that one would normally expect in Apache.

What I'm trying to do, and forgive me if it cannot be done, is make some
kind of alias so that when I write CGI scripts with the header
#!/usr/bin/perl for use in a linux environment, that it will also work on my
win32 environment without having to change the header of every script I
write.

Basically, I'm writing scripts on my local machine, which is running Windows
XP with Apache 2.0.55 (with no remote access, only for me to write scripts
and pages on), and I intend to have them posted on a remote linux server. I
would love to have something that will simplify this for me.

I've looked on Google and in the archives best I could, but I didn't find
anything. Maybe I was looking for the wrong terms, but nothing relevant came
up. I found a couple of things which seemed like it was it, but turns out it
was not (or I may be misunderstanding). These were ScriptAlias and
ScriptInterpreterSource.

Could somebody please point me in the right direction?

--
Chris Babstock
email: cababstock@gmail.com

Re: [users@httpd] How do I make a "CGI Alias"?

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Chris Babstock wrote:
> 
> What I'm trying to do, and forgive me if it cannot be done, is make some 
> kind of alias so that when I write CGI scripts with the header 
> #!/usr/bin/perl for use in a linux environment, that it will also work 
> on my win32 environment without having to change the header of every 
> script I write.

Try the directive;

ScriptInterpreterSource registry-strict

and ensure each file type, al la '.pl', '.py', etc has a shell action for
the 'ExecCGI' verb.  You can also use 'registry', but that would invoke the
action of the 'Open' verb - which can be hazardous (consider if you put a
.txt file in your cgi-bin directory, then opening the .txt file would open
Notepad.exe and serve nothing!)  By adding ExecCGI, you can ensure that the
'.pl' scripts are invoked with python.exe instead of pythonw.exe, for example.

You can add any action verb (typical examples are 'Open', 'Edit', 'Print')
for a file type using Windows Explorer menu option Tools -> Options, and click
the File Types tab.  Then modify the actions (verbs) for any type you want to
serve.

Bill

---------------------------------------------------------------------
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