LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache CGI problems (https://www.linuxquestions.org/questions/linux-software-2/apache-cgi-problems-424224/)

cheycomm 03-12-2006 05:26 PM

Apache CGI problems
 
SuSE 10
Apache2

I just enable cgi on my apache2 server and when I point a browser to the script it tries to download it instead of executing it.

It works if I use the extension .cgi but .pl will only try to download, both files are identical with the exception of the extension.

I have tried adding "AddType cgi-script .pl" to the mod_mime0defaults.conf as well as the mime.types file. I also tried adding AddHandler to the directory directive.

Please help, I have been fighting this for hours and am dumbfounded.

Thanks,

gilead 03-12-2006 05:57 PM

Can you post the section of your httpd.conf file where you used the AddHandler directive? It should have worked - here is an example for a Bugzilla box (I added the .pl to the AddHandler directive only to show the syntax):
Code:

<Directory /usr/local/bugzilla-2.20.1>
  AddHandler cgi-script .cgi .pl
  Options +Indexes +ExecCGI +FollowSymLinks
  DirectoryIndex index.cgi
  AllowOverride Limit
  Order allow,deny
  Allow from all
</Directory>


cheycomm 03-12-2006 06:05 PM

This is what I have listed in the default-server.conf file. It is included

ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"

# "/srv/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/srv/www/cgi-bin">
AddHandler cgi-script .pl
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>

gilead 03-12-2006 07:15 PM

That's odd - the one I posted above works for .cgi or .pl files. The only way I could make it stop was to add a .htaccess file to the directory to deny access to .pl files. Do you use .htaccess files at all?

cheycomm 03-12-2006 09:08 PM

I am using it, in other directories, not in this one.

gilead 03-12-2006 09:23 PM

Apart from confirming that the file is executable by whatever user Apache is running as, have you had a look at http://httpd.apache.org/docs/2.0/how...l#troubleshoot?

cheycomm 03-12-2006 09:58 PM

rights are properly set, -rwxr-xr-x. I will review the docs, thanks for your help.


All times are GMT -5. The time now is 09:22 PM.