Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI Failure on Web Server - Redhat Linux 7.2 1

Status
Not open for further replies.

progolf069

Programmer
Jun 13, 2001
37
US
I am receiving the following error on my Redhat Linux 7.2 Web Server:

Code:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.



--------------------------------------------------------------------------------

Apache/1.3.20 Server at localhost.localdomain Port 80

The error number on Internet Explorer Version 6.0 is an error 500 Internal Server Error.

When I check the error log for the web server it reads like this:

Code:
[Wed May  1 23:00:57 2002] [error] (8)Exec format error: exec of /var/[URL unfurl="true"]www/html/c[/URL]
gi-bin/hello.cgi failed
[Wed May  1 23:00:57 2002] [error] [client 172.137.97.247] Premature end of scri
pt headers: /var/[URL unfurl="true"]www/html/cgi-bin/hello.cgi[/URL]

My Perl/CGI-Script that I am trying to execute looks like this:

Code:
#/usr/bin/perl

# hello.pl - my first perl script!

use CGI;

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

print <<&quot;EOF&quot;;

<HTML>

<HEAD>
<TITLE>Hello, world!</TITLE>
</HEAD>

<BODY>
<H1>Hello, world!</H1>
</BODY>

</HTML>
EOF

Does anybody have any idea what might be causing this problem? Does anybody have any suggestions on how I can get this to work correctly? Any help you can provide would be greatly apprecated, have an excellent day!
 
Hi,

Try running from command line

-->perl -c test.cgi
Then -->perl - w test.cgi

If script runs ok then it is more then likely permissions.
Verify script is 755

There may be ^M or carriage returns at the ends of each line which you may not see in editor.

Did you Ftp the script to your cgi-bin folder in ascii mode?

Good Luck
 
i have recently had a similar problem. It was caused by my perl directory location being different to that shown in the header of the cgi-file. Check that your perl location is /usr/bin/perl
 
Sarm,

Thanks for the help. I think it was the 755 problem. I had mine set up for 777. I did the ascii mode, so I knew that was not the problem. I didn't know about the checking either, but that will help out later. Thanks for the assistance.

If anybody else might have anything to add to this thread for advice, feel free to drop a line. I am just now starting my cgi-scripting experiance. Any advice or suggestions would be totally welcome!

Thanks agin Sarm... have yourself a great one!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top