[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] executing a CGI



On Mon, 19 Mar 2001, Damien - support Euro Web Hosting.com wrote:

> Hello,
> 
> I'd like to know what are the http.conf directives to make one directory
> EXECUTE my binaries instead of downloading them as text files.
> I am on a RAQ 2.
> I have found this piece on the internet:

hmm, if you just rename then to something.cgi they will automaticlly
execute :)
> 
> ..
> ScriptAliasMatch .* /usr/local/apache/cgi-bin/myprogram

That's kind of an evil way to do it, you may end up trying to execute
everything , it's also very hard on the server when you use any of the
'Match' directives, you are matching patterns for every single request
to the server...;)

> <Directory /usr/local/apache/cgi-bin>
> which I think is the beginning of a solution, but I couldn't work out where

If you really want a cgi-bin directory, you should use just ScriptAlias,
and it needs to be in the <VirtualHost> block for the site...

assuming it's for site1...

ScriptAlias /cgi-bin/ /home/sites/site1/web/cgi-bin/
<Directory /home/sites/site1/web/cgi-bin>
    AllowOverride None
    Options ExecCGI
    Order allow,deny
    Allow from all
</Directory>

(just before existing </VirtualHost>)

Note1 that the httpd.conf file gets rewritten if you make changed to the
      site config in the GUI ;)
Note2 this puts your executable in web space...(you don't have to )
Note3 this bypasses cgiwrapper....so you have to be carefull about
      ownership of the cgi's

> --
> note I am using a <IMG
> SRC="http://www.mydomain.com/myprogram?someArguments";> and I wish it could
> run the program.

SRC="http://www.mydomain.com/myprogram.cgi?someArgument";
should work as is without changing anything...

if you really want myprogram to execute, and not be in a directory, and
not have an extension, you are going to have to get a bit fancier...;)

you are going to break multviews regardless ;)

gsh