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

Re: Script Alias Directive in Apache



Michael Olds wrote:

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

Some of this stuff can be hard to grok.  Think of the alias as a
nickname for the directory your scripts are living in.  So if you do
this:

	ScriptAlias /fred/ /usr/local/lib/cgi-bin/
#(Fred is just another name for the directory)

	<Directory /usr/local/lib/cgi-bin/>
		...
		...
		Options ExecCGI
	</Directory>

it means that when you call /fred/somescript.pl
(http://domain1.com/fred/somescript.pl) Apache goes to
/usr/local/lib/cgi-bin/ and runs somescript.pl.  Of course domain2 can
call a fred script, too.

You can make a ScriptAlias for each virtual host, like fred to refer to
domain1, ethel for domain2, and lucy for domain3.  Each
domain/CGIDirectory needs a unique nickname (alias).

I have all CGI scripts in a single directory, so I haven't tried putting
the ScriptAlias within the virtual host directive. .htacces directives
can also be used.  Check the Apache documentation:

http://httpd.apache.org/docs/howto/cgi.html#configuringapachetopermitcgi

For a good overview of Apache see ch. 36:

	http://rute.sourceforge.net/

or, you may already have it installed on your machine.

I'm beginning to think that Apache configuration is a lot like PERL;
there's always another way to do it :)
--
gt                  kk5st@sbcglobal.net
 If someone tells you---
 "I have a sense of humor, but that's not funny." 
                                  ---they don't.



Reply to: