Powered by Invision Power Board


  Reply to this topicStart new topicStart Poll

> the website changed and now CGI scriptnot working
modesign
Posted: Jan 23 2004, 04:19 AM
Quote Post





Group: Members
Posts: 16
Member No.: 193
Joined: 27-January 03



Oh Dear

My site has changed again by Advantage. new controw panel and had to call in the helpdesk to find out how to access my files again since the path has changed.
now it seems the cgi script are not working also

Had a running cgi script: book.cgi
call the script from the browser results in an internal server error.

Also i am get an error in the error_log
[Fri Jan 23 03:49:56 2004] [error] [client 213.78.82.254] Premature end of script headers: /home/webadmin/mo-design.com/cgi-bin/book.cgi

could you please have a look. perhaps it's the path but i cannot figure it out.
I would appreciate it very much.

PMUsers Website
Top
andy
Posted: Jan 23 2004, 08:43 AM
Quote Post





Group: Advantagecom Staff
Posts: 4,340
Member No.: 9
Joined: 12-July 02



This is a result of a software upgrade that we did in HSPC well over a month ago. Part of that upgrade changed the location of your files as was necessary for the new web server configuration to work properly.

In the file /home/webadmin/mo-design.com/cgi-bin/book.cgi , the following line needs to be changed from this:

CODE
$basedir="/var/www/html/flash";


to this

CODE
$basedir="/home/webadmin/mo-design.com/html/flash";


--------------------
Sincerely,
Andrew Kinney
CTO, Advantagecom Networks

Please do not private message me. My regular management duties preclude responding to every customer that sends me a support issue. Instead, post on the forum or contact tech support.
PMUsers Website
Top
modesign
  Posted: Jan 24 2004, 01:45 AM
Quote Post





Group: Members
Posts: 16
Member No.: 193
Joined: 27-January 03



Did change the path
No luck i am afraid.
still internal server error. And error in log: "Premature end of script headers: /home/webadmin/mo-design.com/cgi-bin/book.cgi"

what could it be?

Ray
unsure.gif
PMUsers Website
Top
andy
Posted: Jan 26 2004, 10:38 AM
Quote Post





Group: Advantagecom Staff
Posts: 4,340
Member No.: 9
Joined: 12-July 02



What is the URL on your web site that references this script? I need to be able to test it to track down the error.


--------------------
Sincerely,
Andrew Kinney
CTO, Advantagecom Networks

Please do not private message me. My regular management duties preclude responding to every customer that sends me a support issue. Instead, post on the forum or contact tech support.
PMUsers Website
Top
modesign
Posted: Jan 26 2004, 11:15 AM
Quote Post





Group: Members
Posts: 16
Member No.: 193
Joined: 27-January 03



it's called from a flash file:
CODE
loadVariables ("http://www.mo-design.com/cgi-bin/book.cgi", "", "POST");


but i think the system needs a reset or so.. also the HSC control panel gives me the same damn " Internal server error" after login and selecting one of the options.

Help please!

PMUsers Website
Top
andy
Posted: Jan 26 2004, 12:14 PM
Quote Post





Group: Advantagecom Staff
Posts: 4,340
Member No.: 9
Joined: 12-July 02



I'm trying to help you, but you didn't answer my question.

What URL is your CGI script called from? Note that I didn't ask what file or function calls your script. I asked what URL. In other words, what is in the address bar of your web browser when you experience the error?

QUOTE
also the HSC control panel gives me the same damn " Internal server error" after login and selecting one of the options.


As for this, the same criteria apply for me to be able to help you. I need more information. What option did you select that caused the error?


--------------------
Sincerely,
Andrew Kinney
CTO, Advantagecom Networks

Please do not private message me. My regular management duties preclude responding to every customer that sends me a support issue. Instead, post on the forum or contact tech support.
PMUsers Website
Top
modesign
  Posted: Jan 27 2004, 01:07 PM
Quote Post





Group: Members
Posts: 16
Member No.: 193
Joined: 27-January 03



Fair enough

http://mo-design.com/flash/moguestbook.swf is the URL that the book.cgi is call from.
this is not where i get the internal error screen it just hangs or hets stuck.

the error log tells me
CODE
"Premature end of script headers: /home/webadmin/mo-design.com/cgi-bin/book.cgi"



The internal error i get when i try to manually execute the script at: mo-design.com/cgi-bin/book.cgi


About the Control panel internal error.
They seem to be inconsistent. Yesterday it happend all the time selecting 'crontab' from home and 'webstatistics' as as well as the 'webfiles' What happened is that the left frame shows the whitescreen with the internal error message.

PMUsers Website
Top
andy
Posted: Jan 28 2004, 10:38 AM
Quote Post





Group: Advantagecom Staff
Posts: 4,340
Member No.: 9
Joined: 12-July 02



QUOTE
About the Control panel internal error.
They seem to be inconsistent. Yesterday it happend all the time selecting 'crontab' from home and 'webstatistics' as as well as the 'webfiles' What happened is that the left frame shows the whitescreen with the internal error message.


I talked to one of our tech support people about this and he was aware of an issue that caused this, but it was corrected before I mentioned it, so it should not be an issue any more.

Regarding your script problem, I'd not used this script before, so it took me a little bit of digging to find out how the script was supposed to be called. It turns out that the script is working perfectly and it just wasn't being called correctly from your page. However, instead of spitting out an error message readable by the web server, it just sent a short little error message that wasn't understood by the web server and caused the "500 internal server error".

I took the liberty of modifying your script so that when it is called improperly it will actually output an error message to the browser instead of outputting an error message that causes an error in Apache. Here is what I did.

I changed this:

CODE
else {
       print "no parameters!\n";
}


to this:

CODE
else {
       print "Content-type: text/html\n\n";
       print "no parameters!\n";
}


Now, you'll actually see a useful error message when the script is called improperly. All I did was properly format the error message output from the script so that Apache didn't choke on the error message generated by the script.

As for the proper way to call the script, I don't know what you were intending to do, but normally data is POSTed to the script using the "FORM ACTION=" HTML element within an HTML form.

Rather than loading the script directly, you should be sending data to it so that it doesn't cause that error.


--------------------
Sincerely,
Andrew Kinney
CTO, Advantagecom Networks

Please do not private message me. My regular management duties preclude responding to every customer that sends me a support issue. Instead, post on the forum or contact tech support.
PMUsers Website
Top
modesign
Posted: Jan 28 2004, 01:45 PM
Quote Post





Group: Members
Posts: 16
Member No.: 193
Joined: 27-January 03



Hi Andrew

I really appreciate it all your actions.
I guess i am to lazy to fully learn perl/cgi scripting and all the dialects (so it seems) i used to though (basic, c+, forth!)
As you download a script you just think all i have to do is change path right?...wrong
anyways

yes the script gives now a healthy error i can understand.
The weird thing is though that this script has worked for a year!

i will look into the flashscript.

Thanks again.

Ray rolleyes.gif
PMUsers Website
Top
andy
Posted: Jan 28 2004, 09:39 PM
Quote Post





Group: Advantagecom Staff
Posts: 4,340
Member No.: 9
Joined: 12-July 02



QUOTE
The weird thing is though that this script has worked for a year!


It could very well be that the HSPC software upgrade changed the Apache configuration or PERL just enough that the script doesn't behave exactly the same as it did prior to the upgrade. Such changes are often subtle enough that it is very difficult to track down exactly what change caused the problem.


--------------------
Sincerely,
Andrew Kinney
CTO, Advantagecom Networks

Please do not private message me. My regular management duties preclude responding to every customer that sends me a support issue. Instead, post on the forum or contact tech support.
PMUsers Website
Top
modesign
Posted: Jan 30 2004, 05:21 AM
Quote Post





Group: Members
Posts: 16
Member No.: 193
Joined: 27-January 03



Could you explain this?

The flashfile the one that calls the book.cgi script via:
loadVariables ("http://www.mo-design.com/cgi-bin/book.cgi", "", "POST");

seems to work fine from my own harddrive

but from the server it seems it doesn't?

any clues?

ohmy.gif
PMUsers Website
Top
andy
Posted: Jan 30 2004, 07:00 AM
Quote Post





Group: Advantagecom Staff
Posts: 4,340
Member No.: 9
Joined: 12-July 02



QUOTE
seems to work fine from my own harddrive

but from the server it seems it doesn't?


Your hard drive isn't a web server. A web server does server side parsing and script execution that your hard drive wouldn't.

The key element is the book.cgi script execution. For one reason or another, your flash file is *executing* the book.cgi script when the flash file is loaded rather than when your flashified form is submitted. Since it is being executed without any data being submitted to it, it is causing an error. The "no parameters" error from the script is the best clue to what is happening.

I've never programmed in flash and I'd venture a guess that the cgi script author never expected someone to attempt to use it from a flash form, so you're pretty much on your own in that regard.


--------------------
Sincerely,
Andrew Kinney
CTO, Advantagecom Networks

Please do not private message me. My regular management duties preclude responding to every customer that sends me a support issue. Instead, post on the forum or contact tech support.
PMUsers Website
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll