httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "RuneImp" <r...@imptech.net>
Subject Re: CGI Scripts
Date Thu, 10 Jan 2002 00:59:03 GMT
What I do on my server is leave cgi-bin alone for "public" CGI
scripts & use ScriptAlias inside the VirtualHost directives to
set /cgi/ as that domains "personal" cgi area.

ScriptAlias /cgi-bin/ "/usr/local/www/cgi-bin/"

<VirtualHost 207.211.60.224>
        ServerAdmin overlord@imptech.net
        DocumentRoot /usr/home/imptech.net/web/www
        ServerName www.imptech.net
        ServerAlias imptech.net
        ScriptAlias /cgi/ "/usr/home/imptech.net/web/cgi/"
        ErrorLog /usr/home/imptech.net/web/logs/error.log
        CustomLog /usr/home/imptech.net/web/logs/access.log combined
        ThrottlePolicy Original 1M 10s
</VirtualHost>
<Directory /usr/home/imptech.net/web/www>
        Options Indexes Includes MultiViews
</Directory>

This way if you can access all public CGI scripts via 
http://www.hosteddomain.com/cgi-bin/myscript

and accounts that have there own CGI scripts in there cgi
directory & can then only be accessed by that domain. In this
case http://www.imptech.net/cgi/myownscript and no other
domain on the server can access those scripts "accidentally" by
using a script of the same name in there cgi directory.


-=- RuneImp
ImpTech - Web Design, Hosting & Computer Tech
http://imptech.net
rune@imptech.net


----- Original Message ----- 
From: "Joshua Slive" <joshua@slive.ca>
To: <users@httpd.apache.org>
Sent: Wednesday, January 09, 2002 3:56 PM
Subject: RE: CGI Scripts



> From: Vernon A Webb [mailto:VernMan@net-nation.com]
>
> What I'm setting up is a web site for a customer who needs
> a CGI-BIN.
>
> I have created an ftp location for him at:
> /home/UserName/
>
> Also a web folder for:
> http://members.eopenex.com/
>
> at:
> /home/UserName/www/
>
> He needs to have a cgi-bin to place his programs at
> /home/UserName/www/cgi-bin/
>
> Where he's trying to test:
> http://members.eopenex.com/cgi-bin/cgitest.cgi

That's better.  My recommendation is to remove the ScriptAlias from the main
server context and place it only in the vhost for test.comp-wiz.com (and any
other hosts that need it).  Then add

<Directory /home/UserName/www/cgi-bin/>
Options ExecCGI
SetHandler cgi-script
</Directory>

to you httpd.conf.  This has the same effect as ScriptAlias without the
Alias part, since the cgi-bin is already accessible under the documentroot.

If you don't want to do that, you can use
ScriptAlias /cgi-bin/ /home/UserName/www/cgi-bin/
inside the <VirtualHost> section for members.eopenex.com.  But that can be a
little confusing because you are essentially aliasing a directory that is
already accessible.

Joshua.


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message