Gnuru.org
Productive Linux


Subscribe

 Subscribe via Feedburner in a reader

Enter your email address:

Delivered by FeedBurner


Login
Login:
Password:



Don't have an account?
Sign up to Gnuru.org
Forgot your password?

Flexibility and CGI scripts
26 July 2004 @ 17:41 BST
by Paul

The traditional way to configure Apache to run CGI scripts is to have a ScriptAlias directory which runs all the scripts. So, in httpd.conf you might put

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

Unfortunately, this allows for less flexibility because, for example, it won't give you directory listings. So, I prefer a method which some say is less secure, but I think offers more flexibility. This involves using the Alias directive and adding commands to a Location or Directory section:

Alias  /cgi-bin/ /usr/lib/cgi-bin/

     Options +ExecCGI +Indexes
     AddHandler cgi-script pl cgi

This allows indexes to be listed in the cgi-bin directory and also allows files ending in "pl" or "cgi" to be executed as

Tags: apache



Leave a comment:

Are you human?