View Full Version : my cgi is not working
rockerboo
02-04-2002, 06:37 PM
i have a message board all in cgi. and it happens to go down all of the time and i can not access this. there is also a error there right now that says this :
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, wwwadmin@rockerboo.com 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.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
--------------------------------------------------------------------------------
Apache/1.3.20 Server at forum.rockerboo.com Port 80
can anyone help ?
I have been getting this error too and thats when running the install. How do you have the install configured to get it to run? Thanks for your time!
El_Nino
02-21-2002, 02:51 AM
Do you have the file permissions (CHMOD) set correctly? What does it say in the error log?
I have the permissions for installer.cgi like so....
Owner: Read, write and execute
Group: Read and execute
All Users: Read and Execute
-------------------
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@host25.hrwebservices.net 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.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
--------------------------------------------------------------------------------
Apache/1.3.20 Server at www.host25.hrwebservices.net Port 80
[Thu Feb 21 18:22:21 2002] [error] [client 216.165.183.10] Premature end of script headers: /home/username/public_html/ikonboard/installer.cgi [Thu Feb 21 18:22:21 2002] [error]
Mr. Popularity
02-21-2002, 08:35 PM
Ahhhh, I know what the problem is, You're using a brand of WebBoard that is a piece of crap :( Perl based boards really suck, and allow me to recommend some good ones :)
OpenBB (ehh... jury's still out on it)
vBulletin (sweet!!! this board is vBulletin)
those are the only two I recommend.
I haveth Spoken :D
ok, enough! I dont want to hear what is your favorite I just ask for some help on installing it! Please someone !!!
El_Nino
02-22-2002, 12:33 AM
Make sure there is no blank space at the end or the beginning of the file. If you just unzipped it from an archive, try unzipping it again and upload it over the old one on the website.
StAlphonzo
03-12-2002, 02:03 PM
Hello -- I've noticed a few people complianing about sudden crashes with their CGI scripts. I experienced this last week as well, and again yesterday. All the cgi scripts on my site had been working just fine for almost a month, and then all of a sudden I started receiving 500 errors (it wasn't a permissions error because they had been working just fine). I e-mailed tech support and eventually they fixed it.
My questions is whether anyone else has experienced this same problem? I'm wondering if it's the nature of a shared hosting beast, or is there something that can be done to ensure this doesn't happen. The first outtage lasted almost 3 days. Any Unix gurus out there know what might cause this? There are 3 different CGI scripts running in 2 different directories. A guestbook, a form mailer, and a polling program. I don't think these are resource hungry programs like vBulletin even though my guestbook is fairly popular.
StAlphonzo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Under The Banyan Trees with Steely Dan
http://www.banyantrees.net
pat@DISCARDbanyantrees.net
Scotth
03-12-2002, 04:10 PM
Originally posted by StAlphonzo
Hello -- I've noticed a few people complianing about sudden crashes with their CGI scripts. I experienced this last week as well, and again yesterday. All the cgi scripts on my site had been working just fine for almost a month, and then all of a sudden I started receiving 500 errors (it wasn't a permissions error because they had been working just fine). I e-mailed tech support and eventually they fixed it.
My questions is whether anyone else has experienced this same problem? I'm wondering if it's the nature of a shared hosting beast, or is there something that can be done to ensure this doesn't happen. The first outtage lasted almost 3 days. Any Unix gurus out there know what might cause this? There are 3 different CGI scripts running in 2 different directories. A guestbook, a form mailer, and a polling program. I don't think these are resource hungry programs like vBulletin even though my guestbook is fairly popular.
I had this same exact problem last Thursday. My perl scripts stopped working. My FP 2002 extensions stopped working at the same time. I sent in multiple TT's to try to get it fixed. They never got it fixed. I finally got fed up and asked to be moved to yet another new server (I'm now on my 4th server since Feb 2001). That opened another can of worms when my new IP didn't propagate to certain DNS servers for almost 72 hours. I am finally back up and running again. Do me a favor, let me know which tech it was that took care of the CGI problem for you. I'll know to request him/her should this happen again in the future.
Scott
Gerry
04-25-2002, 07:24 PM
I just got a second domain at HostRocket, and could not get any CGI scripts to work at all. Everything (even the archetypical "Hello, World!") resulted in 500 Internal Server Errors. The scripts I've been trying to run are all running fine on my other HostRocket domain (old one is on host4, new one is on host32).
I discovered through trial and error that everything will work on the new domain if and only if I run in "warning" mode (adding the "-w" switch on the first line):
#!/usr/local/bin/perl -w <=== this always works
#!/usr/local/bin/perl <=== this never works
HostRocket hasn't resolved this yet (trouble ticket is still open), but I thought I'd post this as a possible work-around for the folks having problems.
mdterp
04-25-2002, 08:20 PM
#!/usr/local/bin/perl <=== this never works
This is what I use for my cgi scripts and have yet to have any problems.
MichaelJ
05-06-2002, 03:07 PM
I had the same problem. I was starting my scripts (simple 'hello world' stuff) with #!/usr/bin/perl -wT or #!/usr/bin/perl and they were bombing out with 500 errors.
As soon as I switched to -w they started working.
I'm on host32, could it be working for some and not others because of differences between server configs?
lifan
07-27-2002, 08:40 AM
Same with my. Though I am at host12. The only difference is that all the old cgi's I have installed earlier do work, but new ones only work with -w switch. TT is already sent but they haven't yet replied...
donato
08-13-2002, 02:34 PM
Hello all,
gotta say that this forum is a god send!
I too first experienced this problem with my site yesterday:
www.asroma-addict.com
both my message board and newsletter (only 2 apps under the cgi-bin) do not work.
at first i thought i got hacked...then found this thread...sent in multiple tickets, looks like there is NO 24 hr support ! and jsut receivced a response this moring that my forum is accessable...it is but it is not writeable...
and i know what u r all thinking...check permissions...the classic comeback line...well, just to inform everyone that the permissons r correct and no changes were made.
checked the error logs and they indicate that this problem occured approx 1130 am yesterday...
it seems that the cgi-bin folder has been completely "locked", no user able to write to it...i tired the -w switch but to no avail, it removes the big error/warning message to my visitors but thats it...
besides the -w switch will create a shit load of messages/logs...
anyone else expereinced this problem and if so how did support fix it? it has been over 24 hrs, and starting to become ridiculous!!
if i hear of any fix will post it here.
d
lifan
08-13-2002, 07:35 PM
Hello!
I got this problem fixed in the following way. It seems that either HR has changed something or whatever. Anyway. here's what I got in response for my ticket:
"The script simple.cgi was in dos text format. I have
installed a dos2unix file converter on the server.
You can convert files from dos to unix by using the
following command;
dos2unix -n original.cgi fixedscript.cgi"
Could well be that you have the same problem. Try to convert your scripts (it can be done via SSH shell, to know what it is check you CP). If you are on host12 chances are this command will work for you immediately. If not and the command doesn't work, ask support to install this utility for you.
Good luck!
donato
08-13-2002, 07:51 PM
HEY THANKS LIFAN!!
will try that...
but how can you tell wheather the cgi file is in dos or unix format?
Again no changes were made at all, I will bet my left ball that this is a screwup on HR side.
on Host 34 was wondering if anyone else from this server is experiencing a problem...requested that HR reboot the server...don't care (in this case for a 3 min outage-cause chances r that other users on this server r in the same boat)...
Lifan,my message board has several dozen cgi files...shall i do them all?
thx man!
d
lifan
08-13-2002, 08:06 PM
No problem. :) Hope it makes some sense to you first.
Have NO IDEA how to check what format is the file on the server. Probably there is some way to check this but I just don't know really... In my case I guess the problem was with the text editor that I used to edit the scripts on my computer. But since you say the problem you have occured with no actions from your side, then maybe I am wrong and what I said has nothing to do with your case. Anyway rebooting the server is a good idea I think. :)
Also, try uploading this script to your cgi-bin (name it smth like simple.cgi):
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html><head><title>Simple CGI Test</title></head><body>\n";
print "<center>\n";
print "The Simple CGI Test script is functioning properly.\n";
print "</center>\n</body></html>";
Set it to 755 and if it works fine right on than at least you have no problem at least at your side.
Than try to put an -w switch in the script that works badly so that the first line of your script looks like
#!/usr/bin/perl -w
Practice shows that sometimes after that scripts that don't work but with correct permissions and all settings correctly set start working. Though this is good only as a temporar workaround since probably after you put this switch you will get lots of errors in the error log in your CP.
Oh.. No idea what this switch does, since I'm not even close to perll programming, I just know that sometimes it helps and it doesn't do any harm neither to your scripts nor to HR. But even if this helps you have to understand and solve your problem, because normally scripts have to work fine without this switch.
Well... That's all I can say on that matter. If you have any further questions you may ask me, but it will be better if you ask HR support or at least someone who has better knowledge of perl and networking in general than I do. I told you just what I have done in (sort of)similar situation.
Good luck! :)
donato
08-13-2002, 08:15 PM
thnaks again Boris...
i sent your suggestion to HR support...this is perhaps the 4th followup today..find the support lacking...response time very bad.
seems like as soon as 5 pm hits no one is there...so much for 24/7 support...what a crock!
don5408
08-13-2002, 11:13 PM
"how can you tell wheather the cgi file is in dos or unix format?"
Hi. The difference between UNIX text ("true" ASCII text) and MS-DOS format text is in the way line breaks/carriage returns (aka "End of Line") are handled. DOS uses a combination of CR+LF (carriage return and line feed) at the end of a line (which causes the cursor to drop down one row and and return to the beginning of the line) while Unix uses LF only.
The difference between the two is pretty obvious looking at the same file in both formats side by side (see the attachment). If you've ever edited a Perl/CGI file in NotePad you may have noticed that the text of the file appears to "run together" with lines separated by "black boxes" rather than having a new line start on the next row. That's true ASCII or UNIX format text.
As far as the problem we're discussing ("the script xxxx.cgi was in dos text format") a common cause of this is uploading scripts in Binary mode rather than ASCII mode. While uploading in ASCII mode insures that the EOL characters are properly formatted for use on a UNIX system editing files in UNIX format via NotePad and other utilities and then uploading them in binary mode can result in the files being uploaded as "DOS text" with the wrong end of line handling.
"Make sure that you're uploading in ASCII mode" is probably the second most common "classic comeback line" in threads involving script errors, and these things become "classic" for a reason. While that may not be the specific cause here (and if the scripts had been uploaded and working properly before suddenly failing without any changes clearly it wasn't) in the end the net result was the same as if files in the cgi-bin folder *had* been uploaded in binary mode.
Best wishes
Don
donato
08-15-2002, 01:56 PM
Hello folks, thanks to all who are responding....
Don thanks for the info regarding the diff in dos text and unix text...
just thought i will give you all an update:
i am on day 4 of this problem
support was able to fix my secondary cgi app (mailing list)
but do not know how...i think what they did was login in to my ftp site as ROOT not FTPUSER and re-CHMOD'd (i know that this is not a real word..but it works ;) )
HOWEVER, my messageboard is still screwed up!
users can read but not write to the board.
again checked permisions, DID NOT upload any binary files(most binary files are for images...cgi uses ASCII) I opened EVERY single cgi file in VI editor to verify it is in UNIX mode and they are.
So where I am standing now is this:
sent in a response to the HR (to the same trouble ticket) and requested for them to login as root and re-chomd the whole messageboard dir for me...b/c i seriously think that there is a permission problem with the ftpuser itself that causes this problem somehow...again still waiting for a response....trouble tickets suck...no ack from hr, no nothing, its like as one member of this forum says, "u just gotta submit a ticket and cross your fingers that a response will be made"!!!
and haven't u guys noticed that support times are like 1130 am to 4 pm!!! what kind of crock is this???
Elizabeth
09-06-2002, 02:09 PM
Just a couple of comments re: RocketSupport - I think I've been with HostRocket for around two years with four different domains - never had a trouble ticket take more than six hours to answer - most are answered within an hour or two and some have been answered in a matter of minutes.
I'm not a programmer and I don't even really understand how cgi works, but the last problem I had with a script was the line-endings problem. When I downloaded a mailing list/newsletter program, I thought I was downloading it for use on my machine, so I chose the Windoze version. Opening the read-me, I realized that it was a cgi-script to be installed on the web server, but it didn't occur to me to convert the line endings. I spent quite a few hours triple-checking permissions, paths, reading the installation guide and it still never occurred to me.
The tech who received my trouble ticket was quick and very helpful in explaining what the problem was and he converted the file endings for me on the script and got back to me in a couple of hours.
That's pretty typical of the support I've always gotten from HostRocket, and I have to say that the problems are nearly always some goofy little flub on my part, like this one.
I hope your problem gets fixed, soon,
Elizabeth
hotey
06-01-2008, 10:37 AM
Very nice site!
<a href="http://hrdcjobbank.150m.com/">hrdc job bank</a>
<a href="http://freecreditreport-com.150m.com/">freecreditreport.com</a>
<a href="http://equifaxcom.100freemb.com/">equifax.com</a>
Kilmorest
10-21-2008, 06:12 PM
lol @ this idiot trying to get backlinks... tsk tsk.
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.