LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   CGI Scripts not executing (https://www.linuxquestions.org/questions/linux-enterprise-47/cgi-scripts-not-executing-434583/)

Mr_Oz 04-12-2006 03:21 PM

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.

david_ross 04-14-2006 07:37 AM

Can you post the contents of your access_log and error_log files for the times that you try to access the scripts.

Mr_Oz 04-17-2006 07:52 AM

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/

david_ross 04-17-2006 08:34 AM

It looks as if the scripts are not sending the correct headers, could you post a copy of one of the scripts.

Mr_Oz 04-17-2006 08:38 AM

#! /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";

david_ross 04-17-2006 08:42 AM

You have a space in the shebang line, try changing "#! /usr/bin/perl" to "#!/usr/bin/perl"

Mr_Oz 04-17-2006 09:00 AM

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?

Mr_Oz 04-18-2006 03:21 PM

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!!!


All times are GMT -5. The time now is 12:36 PM.