Hi ,
Well I have started with CGI, 2 days back. But some aspects makes me confused.
I am having Apache server over Redhat linux 6.2.
I put my .cgi files in proper directory configured in access.conf,
to, /home/httpd/cgi-bin
Group access set in httpd.conf is none.
Access rights set to 755 to all .cgi files.
If I execute perl -cw something.cgi,
It gives message as Syntax OK.
If I execute perl something.cgi
over command prompt, the scipt gets executed.
Now problem is some of these scripts when called thr'
browser gets executed, but others wont.
Those scripts which cannot be executed successfully over
browser, gives error message as,
"Internal Server Error
The server encountered an internal error or misconfiguration and was unable to
complete your request."
And the funniest part is, those which called thr' browser, gives error, can execute
over command prompt
successfully.
Also there is no Qn of wrong URL. Because some of other CGIs execute properly, which
are in the same
directory, as these are.
I can show you this script for a CGI, which cannot be executed over browser,
#!/usr/bin/perl
print "Content-type:text/html\n\n";
print "<html><head><title>Test Page</title></head>";
print "<body><h2>Hello World</h2></body>";
print "</html>\n";
But the same code with different .cgi filename, in the same directory executes. Both
are having same access rights.
As well setting in access.conf is,
# /home/httpd/cgi-bin should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
# Options ExecCGI -> +ExecCGI *** BY VIKRAM -> This setting I found from one site
# Added AddHandler cgi-script .cgi *** BY VIKRAM -> This setting I found from one
site
<Directory /home/httpd/cgi-bin>
AllowOverride None
Options +ExecCGI
AddHandler cgi-script .cgi
</Directory>
Also there is one more setting in srm.conf, is
# To use CGI scripts:
# Uncommented the following line
AddHandler cgi-script .cgi
Do I need anything other than this ?
waiting for your reply,
from,
vikram.
_____________________________________________________
Chat with your friends as soon as they come online. Get Rediff Bol at
http://bol.rediff.com