LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices

Reply
 
Search this Thread
Old 04-12-2006, 03:21 PM   #1
Mr_Oz
LQ Newbie
 
Registered: Jan 2006
Posts: 15

Rep: Reputation: 0
CGI Scripts not executing


Hi,

I have an Apache web server hosting multpile sites for a class. Everything was working until today when the instructor informed me that some CGI scripts were not executing from a folder that was previously working. I have checked and double checked my HTTPD.conf file, permissions on the folder. There doesnt seem to be any problems that I can see. Can anyone direct me to something that I may have missed?

Thanks in advance.
 
Old 04-14-2006, 07:37 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Can you post the contents of your access_log and error_log files for the times that you try to access the scripts.
 
Old 04-17-2006, 07:52 AM   #3
Mr_Oz
LQ Newbie
 
Registered: Jan 2006
Posts: 15

Original Poster
Rep: Reputation: 0
Here is the log. Even if I create a new user a home folder, no scripts run. The previously created ones still work. It seems anything new will not execute the cgi scripts.


[Mon Apr 17 07:59:12 2006] [error] [client 172.16.15.1] Premature end of script headers: showsurvey.cgi, referer: http://kevin.webdevlccc.com:8080/~cl...ct207/cgi-bin/
[Mon Apr 17 07:59:14 2006] [error] [client 172.16.15.1] Premature end of script headers: managesurvey.cgi, referer: http://kevin.webdevlccc.com:8080/~cl...ct207/cgi-bin/
[Mon Apr 17 07:59:16 2006] [error] [client 172.16.15.1] Premature end of script headers: jackson.cgi, referer: http://kevin.webdevlccc.com:8080/~cl...ct207/cgi-bin/
[Mon Apr 17 07:59:17 2006] [error] [client 172.16.15.1] Premature end of script headers: first.cgi, referer: http://kevin.webdevlccc.com:8080/~cl...ct207/cgi-bin/
[Mon Apr 17 07:59:19 2006] [error] [client 172.16.15.1] Premature end of script headers: c01ex1.cgi, referer: http://kevin.webdevlccc.com:8080/~cl...ct207/cgi-bin/
[Mon Apr 17 08:00:59 2006] [error] [client 172.16.15.1] Premature end of script headers: first.cgi, referer: http://kevin.webdevlccc.com:8080/~cl...ct207/cgi-bin/
[Mon Apr 17 08:01:03 2006] [error] [client 172.16.15.1] Premature end of script headers: c01ex1.cgi, referer: http://kevin.webdevlccc.com:8080/~cl...ct207/cgi-bin/
[Mon Apr 17 08:01:04 2006] [error] [client 172.16.15.1] Premature end of script headers: first.cgi, referer: http://kevin.webdevlccc.com:8080/~cl...ct207/cgi-bin/
[Mon Apr 17 08:26:56 2006] [error] [client 172.16.15.1] Premature end of script headers: first.cgi, referer: http://kevin.webdevlccc.com:8080/~cl...ct207/cgi-bin/
[Mon Apr 17 08:30:46 2006] [error] [client 172.16.15.1] Premature end of script headers: first.cgi, referer: http://kevin.webdevlccc.com:8080/~cis20710/cgi-bin/
[Mon Apr 17 08:30:48 2006] [error] [client 172.16.15.1] Premature end of script headers: managesurvey.cgi, referer: http://kevin.webdevlccc.com:8080/~cis20710/cgi-bin/
[Mon Apr 17 08:30:50 2006] [error] [client 172.16.15.1] Premature end of script headers: showsurvey.cgi, referer: http://kevin.webdevlccc.com:8080/~cis20710/cgi-bin/
[Mon Apr 17 08:30:52 2006] [error] [client 172.16.15.1] Premature end of script headers: jackson.cgi, referer: http://kevin.webdevlccc.com:8080/~cis20710/cgi-bin/
[Mon Apr 17 08:30:53 2006] [error] [client 172.16.15.1] Premature end of script headers: test2.cgi, referer: http://kevin.webdevlccc.com:8080/~cis20710/cgi-bin/
[Mon Apr 17 08:30:56 2006] [error] [client 172.16.15.1] Premature end of script headers: testcarp.cgi, referer: http://kevin.webdevlccc.com:8080/~cis20710/cgi-bin/
[Mon Apr 17 08:31:05 2006] [error] [client 172.16.15.1] Premature end of script headers: c01ex1.cgi, referer: http://kevin.webdevlccc.com:8080/~cis20710/cgi-bin/
[Mon Apr 17 08:31:42 2006] [error] [client 172.16.15.1] Premature end of script headers: jackson.cgi, referer: http://kevin.webdevlccc.com:8080/~cl...ct207/cgi-bin/
[Mon Apr 17 08:31:43 2006] [error] [client 172.16.15.1] Premature end of script headers: first.cgi, referer: http://kevin.webdevlccc.com:8080/~cl...ct207/cgi-bin/
[Mon Apr 17 08:31:45 2006] [error] [client 172.16.15.1] Premature end of script headers: c01ex1.cgi, referer: http://kevin.webdevlccc.com:8080/~cl...ct207/cgi-bin/
[Mon Apr 17 08:31:46 2006] [error] [client 172.16.15.1] Premature end of script headers: test2.cgi, referer: http://kevin.webdevlccc.com:8080/~cl...ct207/cgi-bin/
[Mon Apr 17 08:33:07 2006] [error] [client 172.16.15.1] Premature end of script headers: first.cgi, referer: http://kevin.webdevlccc.com:8080/~cis20710/cgi-bin/
[Mon Apr 17 08:33:09 2006] [error] [client 172.16.15.1] Premature end of script headers: managesurvey.cgi, referer: http://kevin.webdevlccc.com:8080/~cis20710/cgi-bin/
[Mon Apr 17 08:33:12 2006] [error] [client 172.16.15.1] Premature end of script headers: jackson.cgi, referer: http://kevin.webdevlccc.com:8080/~cis20710/cgi-bin/
[Mon Apr 17 08:33:14 2006] [error] [client 172.16.15.1] Premature end of script headers: test2.cgi, referer: http://kevin.webdevlccc.com:8080/~cis20710/cgi-bin/
[Mon Apr 17 08:33:16 2006] [error] [client 172.16.15.1] Premature end of script headers: testcarp.cgi, referer: http://kevin.webdevlccc.com:8080/~cis20710/cgi-bin/
 
Old 04-17-2006, 08:34 AM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
It looks as if the scripts are not sending the correct headers, could you post a copy of one of the scripts.
 
Old 04-17-2006, 08:38 AM   #5
Mr_Oz
LQ Newbie
 
Registered: Jan 2006
Posts: 15

Original Poster
Rep: Reputation: 0
#! /usr/bin/perl
#first.cgi - my first CGI script
print "Content-type: text/html\n\n";
#generate HTML
print "<html>\n";
print "<head><title>First Script</title></head>\n";
print "<body>Congratulations</body>\n";
print "</html>\n";
 
Old 04-17-2006, 08:42 AM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
You have a space in the shebang line, try changing "#! /usr/bin/perl" to "#!/usr/bin/perl"
 
Old 04-17-2006, 09:00 AM   #7
Mr_Oz
LQ Newbie
 
Registered: Jan 2006
Posts: 15

Original Poster
Rep: Reputation: 0
I changed it and it still gives me the internal server errror. Weird thing is that these scripts worked before and now they dont. I did not change anything butI am wondering if the class could of did anything that might of broke something. I know they are also playing with Mysql. Would it help to see my htttp.conf file?
 
Old 04-18-2006, 03:21 PM   #8
Mr_Oz
LQ Newbie
 
Registered: Jan 2006
Posts: 15

Original Poster
Rep: Reputation: 0
Hi all

It seems that a another party changed the permissions to 777 on the cgi-bin folder. I changed them back to 755 and it worked. An oversight on my part. Thank again to all that helped!!!
 
  


Reply

Tags
apache, cgi


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
executing perl cgi DanTaylor Programming 4 09-21-2006 06:54 PM
CGI Scripts not executing, pls help john_d13 Linux - General 3 12-22-2004 02:05 PM
CGI File Not Executing on Apache Server kaplan71 Linux - Software 2 10-21-2004 07:12 AM
Executing from cgi theonebeyond Programming 4 10-04-2004 11:30 PM
apache displays .cgi file instead of executing it hewsonism Linux - Software 2 01-13-2004 09:12 PM


All times are GMT -5. The time now is 08:14 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration