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

RE: executing .cgi and .pl within html space in apache




From the Apache FAQ (www.apache.org/docs/misc/FAQ):

How do I enable CGI execution in directories other than the ScriptAlias? 
Apache recognizes all files in a directory named as a ScriptAlias
<../mod/mod_alias.html> as being eligible for execution rather than
processing as normal documents. This applies regardless of the file name, so
scripts in a ScriptAlias directory don't need to be named "*.cgi" or "*.pl"
or whatever. In other words, all files in a ScriptAlias directory are
scripts, as far as Apache is concerned. 
To persuade Apache to execute scripts in other locations, such as in
directories where normal documents may also live, you must tell it how to
recognize them - and also that it's okay to execute them. For this, you need
to use something like the AddHandler <../mod/mod_mime.html> directive. 
	In an appropriate section of your server configuration files, add a
line such as 
			AddHandler cgi-script .cgi 
		The server will then recognize that all files in that
location (and its logical descendants) that end in ".cgi" are script files,
not documents. 
	Make sure that the directory location is covered by an Options
<../mod/core.html> declaration that includes the ExecCGI option. 
In some situations, you might not want to actually allow all files named
"*.cgi" to be executable. Perhaps all you want is to enable a particular
file in a normal directory to be executable. This can be alternatively
accomplished via mod_rewrite <../mod/mod_rewrite.html> and the following
steps: 
	Locally add to the corresponding .htaccess file a ruleset similar to
this one: 
			RewriteEngine on 
			RewriteBase /~foo/bar/ 
			RewriteRule ^quux\.cgi$ -
[T=application/x-httpd-cgi] 
	Make sure that the directory location is covered by an Options
<../mod/core.html> declaration that includes the ExecCGI and FollowSymLinks
option. 


> -----Original Message-----
> From:	charles@lunar.cc [SMTP:charles@lunar.cc]
> Sent:	Monday, July 19, 1999 1:32 PM
> To:	Linux Users Club of IL
> Subject:	executing .cgi and .pl within html space in apache
> 
> 
> what needs to be placed in the .conf file to allow scripts to be executed
> from html space in a directory that is not the cgi-bin?
> 
> anyone?
> 
> cjm
> 
> 
> --
> To unsubscribe, send email to majordomo@luci.org with
> "unsubscribe luci-discuss" in the body.

--
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.