On Thu, 21 Jun 2001, Sudhakar Chandra wrote:

 |"A.Ramesh" proclaimed:
 |> Iam trying to condigure a directory for both html and cgi files.
 |> but when i configure it for html it is asking for download for .cgi file
 |> instead of executing it.
 |> when i configure it for cgi it is giveing internal server error when iam
 |> trying to access html files.
 |> How to configure both for same directory?
 |
 |Add the following line to srm.conf:

srm.conf has been deprecated for quite some time now.. though the file
still exists all the config directives are now in httpd.conf

[kingsly@utopia kingsly]$ grep srm.conf /etc/httpd/conf/httpd.conf
# /usr/conf/srm.conf and then /usr/conf/access.conf
# srm.conf, and access.conf in that order.  The latter two files are
#ResourceConfig conf/srm.conf
[kingsly@utopia kingsly]$ 

so srm.conf is not even read!!

 |AddHandler cgi-script .cgi
 |
 |This tells your Apache server that anything ending in a .cgi (EVEN
 |inside a directory containing HTML files) is to be treated as a CGI
 |script and executed.

Nope... all it tells is that anything ending in .cgi is a cgi-script and
the server executes cgi-script type files rather then sending them as-is.

But for the script to execute you need to add ExecCGI to the list of
Options for that Directory

This is the default setup and will allow only html to be served....

<Directory "/var/www/html/mydomain.com">
    Options Indexes Includes FollowSymLinks 
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

This will also allow cgi execution in the same directory.

<Directory "/var/www/html/mydomain.com">
    Options Indexes Includes FollowSymLinks ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

And Ensure that the directory isn't ScriptAliased 

ScriptAliased directories will allow *ONLY* CGI's in them... even html
files will be executed (and obviously fail to execute!!)

Kingsly


_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to