CGI program not work in Apache
Hi
I use RedHat 7.2 in a PC workstation not for production, just for homework. This is the first time working with Apache. It is working fine with html pages, but not with cgi programs. I buil the following text cgi program called "mi_cgi.pl" in my home directory /home/manuel/ and then copy it to /var/www/cgi-bin : #! /usr/bin/perl print "Content-Type: text\html\r\n\r\n"; print "Hola, Manuel."; When I enter the direction http://localhost/cgi-bin/mi_cgi.pl in Netscape I don't see the line "Hola, Manuel", instead of that a windows appear asking to save the mi_cgi.pl file in my home directory. This window has the following spaces: Filter: /home/manuel/*.pl Selection: /home/manuel/mi_cgi.pl And three buttoms: "Accept", "Filter" and "Cancel" When I click Accept and then goes to Netscape to try again see the output of the cgi program the same window appear again. I don't know why this is happens. When I ejecute the cgi program in command line I get the output, then the sintax is OK. I gave everyone permission on the file. The path to the script interpreter is OK. What I am doing wrong? I will appreciate any help |
not really sure, but mine have a filename ending in .cgi
this is the default httpd.conf AddHandler cgi-script .cgi Also... for CGI scripts outside of ScriptAliased directories: add "ExecCGI" to the "Options" directive |
You can also try to add the folowing line:
ScriptAlias /cgi-bin/ /usr/local/apache/share/cgi-bin/ replace /usr/local/apache/share/cgi-bin/ with your cgi-bin directory of cource :) |
Thank Daxy and David for your answer.
But my fault was error sintax. In line 1 would no be space betwen "!" and path to the interpreter. In line the slash betwen "text" and "html" must be "/" and not "\". I made the correction and it works |
All times are GMT -5. The time now is 05:29 AM. |