httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Turner <>
Subject Re: [users@httpd] ScriptAlias two Virtual Host Directories
Date Sat, 28 Dec 2002 10:49:48 GMT
Michael Olds wrote:

>OK, Gary, I wasn't ignoring you! I spent most of the day reading (including
>the apache docs on ScriptAlias and VirtualDomains) and trying to work this
>out and did not feel I had enough to get back to you on Debian.

OK, no problema.  Though it is better not to post the same question to
multiple lists.  This is probably the more appropriate list, anyway.

>When you said I was using the same alias for both locations, I thought you
>were refering to the way I had it set up when I posted to debian, which was
>to have both ScriptAliases in the main configuration. As I read the
>examples, it seemed like putting them into the VirtualHost directories was a
>different thing.

A global alias is fine.  It is simpler to maintain.  But, each CGI-root
needs a different (unique) alias (nickname).

>If you don't mind, please think of me as dyslexic. When you say:
>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).

Actually, I was not very accurate/lucid here.  The ScriptAlias is not
inherently linked/associated to any given domain.  The ScriptAlias
compares to the document-root.  It is where the executable scripts live
while only needing to reference the nickname without writing out the
entire path.

>How can this be when virtually every cgi script is called by
> or cgi-local/script; I am and have used hosts
>that have thousands of customers, it just cannot be that I was the one who
>got "cgi-bin" or "cgi-local" instead of "fred". I store my cgi scripts for
>BuddhaDust in directory path: ~/public/cgi-local/ and the url I use to call
>the script is it
>would help me if I understood what they might be doing in terms of
>ScriptAlias here.

Your script is called through the URL passed to the server by a form or
href anchor.  So, if 

	ScriptAlias /cgi/ /usr/local/lib/cgi-bin/

then the script "dothis" might be called with "/cgi/dothis"

If there is another alias, ScriptAlias /fred/ /usr/local/lib/cgi-bin2/

then a script dothat, in /cgi-bin2/ is called with "/fred/dothat"

If you use an absolute address, then or

>And when the call comes in doesn't it go to the Virtual domain ok
>this call to domain one, then it sees /cgi/, so it knows (should know) to go
>to the directory path (within that domain) for the cgi my case

If there is no ScriptAlias in the VH directive, the global alias

Your CGI directory should not be under your doc root.  This can open
security issues.  Is there some reason not to use the defaults provided
by the Debian binaries?  The defaults will place CGIs outside the
browseable tree.  In fact, on your test bed, try the defaults (except
for HVs, of course).  I'd guess that you would have a working setup.

If you use a single location for scripts, you will generally be able to
control and maintain easier.  You can still create sub-directories under
the CGI-root if it makes it easier to organize.

If there are further questions, please try to narrow the scope.
 If someone tells you---
 "I have a sense of humor, but that's not funny." 
                                  ---they don't.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message