RE: Script Alias Directive in Apache
Thank you for this response.
> ScriptAlias /cgi-bin/ "/www/usr/public_html/cgi-local/"
> ScriptAlias /cgi-bin/ "/www/usr2/public_html/cgi-local/"
This won't work. ScriptAlias works just like Alias, doing this tries to
assign the same URI to two different directories.
Ok, these are commented out.
<------------------>
> <Directory "/www/usr/public_html/cgi-local">
> AllowOverride None
> Options ExecCGI
> Order allow,deny
> Allow from all
> </Directory>
If the directory is ScriptAlias'd I think you don't actually need to
specify ExecCGI, it's implicit. Not that it does any harm.
I left these as is, one for each...as long as they don't do any harm, I feel
more comfortable with them in there.
<------------------>
This is what I have now:
> <VirtualHost 000.000.000.000>
> UseCanonicalName off
> ServerName www.usr.com
> DocumentRoot "/www/usr2/public_html"
> ScriptAlias /cgi-bin/ "/www/usr/public_html/cgi-local"
> ServerAdmin usr@his
> </VirtualHost>
>
> <VirtualHost 000.000.000.000>
> UseCanonicalName off
> ServerName www.usr2.com
> DocumentRoot "/www/usr2/public_html"
> ScriptAlias /cgi-bin/ "/www/usr2/public_html/cgi-local"
> ServerAdmin usr@his
> </VirtualHost2>
>If you have only these without the ScriptAlias lines and the your
>virtual hosts are set up correctly, it should work.
The two work fine for serving html pages correctly, and # one serves cgi
scripts fine by itself.
> If you have
>/cgi-bin/ set up in the top-level server configuration (it is by
>default) it will get in the way, so make sure all other ScriptAlias
>lines are commented out.
The lines in the <VirtualHost...> are the only ScriptAlias lines in the
file, and all (2, both me) users are set up this way.
>If you want to have a global CGI directory in
>addition to the private ones you'll have to use different paths (like
>cgi-bin for one and cgi-local or cgi-shared for the other).
No need.
>Alternatively, if you just want individual user directories (~user) to
>have CGIs instead of virtual hosts you can add ExecCGI to the options
>for the user directories and use "AddHandler cgi-script cgi" to treat
>any file ending in .cgi as a CGI.
I don't want to go this way.
<------------------>
OK before I send this off saying that this is the way I am set up and it
doesn't work. I will double check everything...hang on...
Nope. I get An Internal Server Error on the Browser side (trying to run a
simple script) and in the log it says "no such file or directory) (the file
doesn't exist in the first users cgi-bin).
I also know that it's using the wrong one because I have the same script in
each cgi-bin with only a different header, and when I call it up via the url
of the second user, I get the first user's script.
>From what I have read also, what I have should be working.
Could I use: Script Alias /www.firstuser.com/cgi-bin/
"/www/usr/public_html/cgi-local"
Script Alias /www.seconduser.com/cgi-bin/
"/www/usr2/public_html/cgi-local"
I guess what I don't understand is what this means. I hear this as Apache
has a thing called /cgi-bin/ that allows scripts to be executed. If user one
wants to execute scripts, he needs to have a directory of his pretend to be
that directory, so I would say that the fake name was
"/www/usr/public_html/cgi-local" and the real name was /cgi-bin/ and if I
were the little appache sitting in there sorting messages, I would be able
to recognize: This call for executing a script coming in as
"/www/usr/public_html/cgi-local" is ok because here it says x = cgi-bin, and
the same for the other.
What it looks like is actually happening is that user 1s fake cgi directory
has become the one real cgi-directory....i.e. the sorter sees cgi-bin and
throws it to #1 without any thought about the rest of the address. I would
write it: ScriptAlias /www/usr/public_html/cgi-local/ "cgi-bin"
etc. I can't seem to get my mind to turn it around.
Best Wishes!
Mike Olds www.buddhadust.org
Reply to: