Click to See Complete Forum and Search --> : cgi-bin,apache internal server error


redgun
01-09-2003, 08:30 PM
hi ,

i use redhat 7.3.

i have a simple.cgi file in the /var/www/cgi-bin directory. This file works fine when executed in terminal.But when i try to use the browser, i get an internal server error.i understand it has to do with configuring httpd.conf file. i have the flg required lines in my httpd.conf file,

ScriptAlias /cgi-bin/ "/var/ww/cgi-bin"

<Directory "/var/www/cgi-bin" >
Options ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>

AddHandler cgi-script .cgi

i set the correct permissions for the file by chmod a+rx simple.cgi.

I would be gratefule if someone can help solve the problem. ThankYou.
Redgun

redgun
01-11-2003, 05:18 AM
could somebody help me solve the problem?I really need it solved.
Thank You

Linnik
01-11-2003, 06:30 AM
Maybe it's because you're missing a w in the ScriptAlias line??

redgun
01-11-2003, 12:49 PM
iam sorry about the typo here. but in the file it was right www.
That isn't the problem.

monkeyboi
01-12-2003, 02:37 AM
open ur apache log file and check wut is the error....

redgun
01-12-2003, 02:56 AM
The error is "malformed error in the script".

The program is simple,
#!/usr/bin/perl
print "This is my first program";

Sridhar Guntur
01-12-2003, 03:00 AM
Hello redgun,
Your .cgi/.pl program can run standalone. But it is not a CGI perl script since it did not follow the CGI protocol.
In order to make that as a CGI perl script,you need to add the following two lines after #!/usr/bin/perl

use CGI qw(:standard);
print header();

or

print "content-type: text/html\n\n";