LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-05-2005, 02:08 PM   #1
wacki
LQ Newbie
 
Registered: Aug 2005
Posts: 10

Rep: Reputation: 0
Can't get cgi-bin to work?


Not sure where this should go...

But I can't get my CGI-BIN to work.

I tried both a simple html page and a cgi script from sourceforge.


[B}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.
[/B]

from var/log/httpd/error_log
Redhat ES 3


[Mon Sep 05 14:03:03 2005] [error] [client 12.222.119.135] Premature end of script headers: howto.html
[Mon Sep 05 14:03:04 2005] [error] [client 12.222.119.135] (8)Exec format error: exec of '/var/www/cgi-bin/handconverter/howto.html' failed
[Mon Sep 05 14:03:04 2005] [error] [client 12.222.119.135] Premature end of script headers: howto.html
[Mon Sep 05 14:03:14 2005] [error] [client 12.222.119.135] attempt to invoke directory as script: /var/www/cgi-bin/
[Mon Sep 05 14:04:53 2005] [error] [client 12.222.119.135] (8)Exec format error: exec of '/var/www/cgi-bin/index.html' failed
[Mon Sep 05 14:04:53 2005] [error] [client 12.222.119.135] Premature end of script headers: index.html



The same thing happens when I try to access a CGI script downloaded from sourceforge.

[Mon Sep 05 14:15:00 2005] [error] [client 12.222.119.135] Premature end of script headers: hhconverter.cgi
[Mon Sep 05 14:15:01 2005] [error] [client 12.222.119.135] (2)No such file or directory: exec of '/var/www/cgi-bin/handconverter/hhconverter.cgi' failed
[Mon Sep 05 14:15:01 2005] [error] [client 12.222.119.135] Premature end of script headers: hhconverter.cgi
[Mon Sep 05 14:15:02 2005] [error] [client 12.222.119.135] (2)No such file or directory: exec of '/var/www/cgi-bin/handconverter/hhconverter.cgi' failed
[Mon Sep 05 14:15:02 2005] [error] [client 12.222.119.135] Premature end of script headers: hhconverter.cgi
[Mon Sep 05 14:15:04 2005] [error] [client 12.222.119.135] (2)No such file or directory: exec of '/var/www/cgi-bin/handconverter/hhconverter.cgi' failed
[Mon Sep 05 14:15:04 2005] [error] [client 12.222.119.135] Premature end of script headers: hhconverter.cgi

Last edited by wacki; 09-05-2005 at 02:09 PM.
 
Old 09-05-2005, 02:28 PM   #2
anand_kt
Member
 
Registered: Dec 2004
Location: Chennai, India
Distribution: Red Hat, Knoppix
Posts: 86

Rep: Reputation: 15
Post your CGI script here and did you forget to make it "Xecutable" by world?
 
Old 09-05-2005, 02:58 PM   #3
wacki
LQ Newbie
 
Registered: Aug 2005
Posts: 10

Original Poster
Rep: Reputation: 0
The sourcecode is huge but it works.

I found it here:

http://sourceforge.net/projects/handconverter/

I changed the perl line to the proper directory.

I did a chmod 755 to everything
 
Old 09-05-2005, 04:18 PM   #4
anand_kt
Member
 
Registered: Dec 2004
Location: Chennai, India
Distribution: Red Hat, Knoppix
Posts: 86

Rep: Reputation: 15
Now,

this particular script is not working or no scripts are working?
 
Old 09-05-2005, 04:28 PM   #5
wacki
LQ Newbie
 
Registered: Aug 2005
Posts: 10

Original Poster
Rep: Reputation: 0
eh........

well I made an index.html

that wouldn't work.

However I just downloaded a text clock and installed it here:

http://parazen.bio.indiana.edu/cgi-bin/textclock.cgi

That seems to work. So I guess it's the code. Still, I would of thought a simple html page would work in the cgi bin. I guess not.
 
Old 09-05-2005, 04:38 PM   #6
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
Re: Can't get cgi-bin to work?

Quote:
Originally posted by wacki

[Mon Sep 05 14:03:03 2005] [error] [client 12.222.119.135] Premature end of script headers: howto.html
[Mon Sep 05 14:03:04 2005] [error] [client 12.222.119.135] (8)Exec format error: exec of '/var/www/cgi-bin/handconverter/howto.html' failed
[Mon Sep 05 14:03:04 2005] [error] [client 12.222.119.135] Premature end of script headers: howto.html
[Mon Sep 05 14:03:14 2005] [error] [client 12.222.119.135] attempt to invoke directory as script: /var/www/cgi-bin/
[Mon Sep 05 14:04:53 2005] [error] [client 12.222.119.135] (8)Exec format error: exec of '/var/www/cgi-bin/index.html' failed
[Mon Sep 05 14:04:53 2005] [error] [client 12.222.119.135] Premature end of script headers: index.html
Here you were trying to run HTML files within a cgi-bin directory. That obviously doesn't work. In fact, you can probably move all your stuff outside of cgi-bin and put it somewhere else; since the CGI script already has a ".cgi" extension.

Quote:
Originally posted by wacki
[I]
The same thing happens when I try to access a CGI script downloaded from sourceforge.

[Mon Sep 05 14:15:00 2005] [error] [client 12.222.119.135] Premature end of script headers: hhconverter.cgi
[Mon Sep 05 14:15:01 2005] [error] [client 12.222.119.135] (2)No such file or directory: exec of '/var/www/cgi-bin/handconverter/hhconverter.cgi' failed
[Mon Sep 05 14:15:01 2005] [error] [client 12.222.119.135] Premature end of script headers: hhconverter.cgi
[Mon Sep 05 14:15:02 2005] [error] [client 12.222.119.135] (2)No such file or directory: exec of '/var/www/cgi-bin/handconverter/hhconverter.cgi' failed
[Mon Sep 05 14:15:02 2005] [error] [client 12.222.119.135] Premature end of script headers: hhconverter.cgi
[Mon Sep 05 14:15:04 2005] [error] [client 12.222.119.135] (2)No such file or directory: exec of '/var/www/cgi-bin/handconverter/hhconverter.cgi' failed
[Mon Sep 05 14:15:04 2005] [error] [client 12.222.119.135] Premature end of script headers: hhconverter.cgi
Are you sure that you put in the correct path to Perl after the shebang on the first line of the script? Do "which perl" to find the path to Perl.
 
Old 09-06-2005, 07:51 AM   #7
anand_kt
Member
 
Registered: Dec 2004
Location: Chennai, India
Distribution: Red Hat, Knoppix
Posts: 86

Rep: Reputation: 15
We cannot put HTML files in CGI-BIN ?

>> since CGI scripts alread have a .cgi extension ??

what about perl scripts then? perl scripts running from CHI-BIN dir ?
 
Old 09-06-2005, 07:52 AM   #8
anand_kt
Member
 
Registered: Dec 2004
Location: Chennai, India
Distribution: Red Hat, Knoppix
Posts: 86

Rep: Reputation: 15
correction : CGI-BIN and not "CHI-BIN"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cgi-bin Cool_Hand_Luke Linux - Newbie 3 04-02-2005 03:32 PM
#! does not seem to work in cgi-bin?? (script execution) servnov Linux - General 6 12-06-2004 07:23 AM
CGI to work out side of cgi-bin? crashedspine Linux - Newbie 13 09-02-2004 08:49 PM
Cgi-bin Llwyd Linux - Networking 3 03-01-2003 01:46 PM
http://www.burstnet.com/cgi-bin/ads/ad7954a.cgi/3980/RETURN-CODE rverlander LQ Suggestions & Feedback 1 06-07-2002 07:35 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration