Forum Moderators: coopster & phranque

Message Too Old, No Replies

Did host screw up cgi-bin setup?

         

bill

6:20 am on Jun 12, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've got a client who wants to use a local company for web hosting. The site is all ready to go except for the addition of a form-to-e-mail script that I've used on dozens of sites. The problem is, the script won't execute.

I've loaded the script in ASCII, CHMOD'd the correct permissions in the cgi-bin directory and the script executes with a 200 in the log. The problem is nothing happens. However, I can run "Hello World" scripts in the cgi-bin. I'm perplexed.

All I've got is FTP access to this server which is apparently Linux running Apache. I'd like to tell the client that this host is clueless, but I'm not sure how to troubleshoot this. My suspicion is that the cgi-bin wasn't set up properly. However, how could I go about proving that?

SlyGuy

7:21 am on Jun 12, 2003 (gmt 0)

10+ Year Member



Hello Bill,

I had a similar problem awhile back using a FormMail script. Had no troubles until we changed web hosting companys. They provided a cgi-bin that just wouldn't execute the script. I FTPed the script myself, and did everything that you had mentioned (ASCII transfer, permissions etc..)

The script only worked when one of the technical support guys downloaded the file and installed it himself into the CGI-Bin.

To this day, I don't know why the script wouldn't execute via my FTP.

Can anyone explain why this happened?

Cheers,

Chad

bill

12:50 am on Jun 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



<nudge>

john316

1:18 am on Jun 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try changing the name of the script, with all the FormMail exploits running around it's possible that name won't execute.

Is it named FormMail.pl?

jdMorgan

1:36 am on Jun 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You may need to ask them to chown the file to "system" - just a guess.

Jim

bill

1:36 am on Jun 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



No, it's actually a hacked version of AlienForm and I had tried different names for the script to avoid exploits for that as well.

cminblues

1:52 am on Jun 13, 2003 (gmt 0)

10+ Year Member



The problem is nothing happens.

But.. the HTML content [-> the page] is given correctly to the user?

If the answer is 'yes', maybe you must only edit the path to the mail program
[i.ex. Sendmail.. hehe, about exploits ;)] in the CGI script.

bill

2:03 am on Jun 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



No, I get a completely blank page. None of the HTML shows up at all.

cminblues

2:18 am on Jun 13, 2003 (gmt 0)

10+ Year Member



Ok, so try to stop, progressively, the execution of the script, inserting, after the 'Content-type' header stuff i.ex. something like:

print "I am at stage 1\n";
..
print "I am at stage 2\n";
exit 0;

Then, you can watch at source code of the page, and try to guess.

Storyteller

2:47 am on Jun 13, 2003 (gmt 0)

10+ Year Member



The script must execute because Apache won't log with 200 code unless the CGI program has output correct headers. You may want to step through the script with Perl debugger or just use some debug printing. The number of bytes output from the script, which should be logged in Apache access log, could also sched some light onto the issue.

bill

2:56 am on Jun 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks for that cminblues. Basically it looks like the script runs through the initialization part OK. This is basically pointing toward my templates and SendMail. Then it sets a couple of loop variables and that's where it dies. Once it gets into the meat of the script where it would actually do things, it dies.

As you may be able to tell I'm in over my head here ;)

I just got a cryptic message from the host saying something to the effect that they will try to exclude my script filename on their configuration. Let's see if they can't fix some of this... <grrr...>

bill

8:07 am on Jun 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



follow up:

I'm not sure what to make of this, but the host got the script to work. Essentially they told me that their Perl Handler settings were not compatible with the script I was using. They said that because my script contained "__END__" that it was not compatible with their Perl Handler. I'm not really sure about the details of this. Somehow they couldn't bypass the Perl Handler to process my script, so their solution was to change my script's filename to any extention but ".cgi" or ".pl".

The script does work now, but does this sound like there may be setup problems on their side? I get the feeling they're kludging about a bit...

cminblues

8:39 am on Jun 18, 2003 (gmt 0)

10+ Year Member



They said that because my script contained "__END__"

I get the feeling they're kludging about a bit...

No, it's not strange IMHO.. :)