PDA

View Full Version : Problems with perl autorun file


dtr1001
03-16-2002, 11:51 AM
Hello folks, i'm new to hostrocket so if i miss a point of etiquette by asking directly then i apologise. My trouble is that my previous hosts server went down so i moved here to improve the service. I have a kids clothes business and use auction script to run an auction. I have the whole thing installed but there is a problem. One file called autorun.pl just wont run, i keep getting a server 500 error, i have chmod 755 and reuploaded the file, even replaced the file from with an original version and still no luck. The autorun.pl file does all the maintenance tasks on the site so without it my site wont run. I tried setting it up as a cron job instead but it didnt seem to be working. Can anyone offer any ideas?

Mr. Popularity
03-16-2002, 11:53 AM
ok, open up and say 'ahh'. which means ... can you copy and paste the file, in its entirety in a reply for us to see :)

Chris

dtr1001
03-16-2002, 12:10 PM
Hi again, its too big to paste but can be found here

http://www.smartypantskids.com/autorun.pl_for_forum

hope this helps

regards

David

Mr. Popularity
03-16-2002, 12:18 PM
ok, I'm looking now. do you know how to debug scripts in the shell using the Perl executable?

Mr. Popularity
03-16-2002, 12:26 PM
ok, first off, your $cgipath is wrong. it should be:
/home/YOUR HR CONTROL PANEL USERNAME/public_html/cgi-bin

instead of:
/www/auction-script/cgi-bin

and the cgi path was 'commented out'. If you're not familiar with scripting, in Perl, a # means that it will ignore anything on the same line after it because the # denotes a programmers remark.

I've modified it to make it simple for you to try again, you can redownload it from the link below. :)



Chris.

dtr1001
03-16-2002, 12:27 PM
Hi again, no I've never done that before, HOWEVER, this script came from my last server and it worked fine, i am definitely uploading using ascii, and the permissions are set.

The error i get is

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@smartypantskids.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.23 Server at www.smartypantskids.com Port 80

any ideas?

Mr. Popularity
03-16-2002, 12:33 PM
yeah, that's known as a 500 error. That always happens when a script is less than righteous :) one little ; in the wrong place and the whole script is bad, until you find the mistake, or debug it in the shell by using the Perl executable. That's how Perl and PHP work. Look on the very top of the file, you see #!/usr/bin/perl that's the path to the Perl executable file. The .pl script is nothing more than a recipe for the executable to carry out... kinda like sheet music to a player piano.

Anything else you need help with, let us know :) Some of us here are actually good at programming :)

Chris

dtr1001
03-16-2002, 12:39 PM
Hi again, i tried that, (edited it with the right path), uploaded ascii, chmod 755, still no joy...........how do i debug with the prl executable?

Mr. Popularity
03-16-2002, 01:00 PM
first, send in a trouble ticket to HR with the following information:

request SSH access.

Include the first 2 and last 2 numbers of your credit card.

Let them know that you need SSH access to debug perl scripts, and I'll walk you through basic shell toys. :)


Chris.

dtr1001
03-16-2002, 02:41 PM
Hi again, i'm fairly confident about the syntax of this script being ok. One of my colleagues has said

Being on HostRocket, you need to set it up to run under scgi-bin instead of
cgi-bin, that way it runs the script with your permissions.

So i moved the files to scgi-bin but now what i see when i call a script is

scgiwrap: Caller must be gid 99--------------------------------------------------------------------------------DOCUMENT_ROOT=/home/smartyp/public_html
HTTP_ACCEPT=*/*
HTTP_ACCEPT_ENCODING=gzip, deflate
HTTP_ACCEPT_LANGUAGE=en-us
HTTP_CONNECTION=keep-alive
HTTP_HOST=www.smartypantskids.com
HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
HTTP_VIA=1.1 cache-udd (NetCache NetApp/5.1R2D14)
HTTP_X_FORWARDED_FOR=62.31.120.21
PATH=/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin
REMOTE_ADDR=194.117.151.68
REMOTE_PORT=26509
SCRIPT_FILENAME=/usr/local/cpanel/cgi-sys/scgiwrap
SERVER_ADDR=66.162.73.11
SERVER_ADMIN=webmaster@smartypantskids.com
SERVER_NAME=www.smartypantskids.com
SERVER_PORT=80
SERVER_SIGNATURE=Apache/1.3.23 Server at www.smartypantskids.com Port 80

SERVER_SOFTWARE=Apache/1.3.23 (Unix) mod_bwlimited/1.0 PHP/4.1.2 DAV/1.0.2 mod_log_bytes/0.3 FrontPage/5.0.2.2510 mod_ssl/2.8.6 OpenSSL/0.9.6b
GATEWAY_INTERFACE=CGI/1.1
SERVER_PROTOCOL=HTTP/1.1
REQUEST_METHOD=GET
QUERY_STRING=
REQUEST_URI=/scgi-bin/admin.pl
SCRIPT_NAME=/scgi-bin
PATH_INFO=/admin.pl
PATH_TRANSLATED=/home/smartyp/public_html/admin.pl

(pulled from link http://www.smartypantskids.com/scgi-bin/autorun.pl)

Help! (please)

Mr. Popularity
03-16-2002, 02:46 PM
#1, are you using front page to publish these?

#2, we really can't do much until HR writes you back saying that shell access is enabled for you :)

I'm not doing much of anything this afternoon until later. (I spin tonight at Avalon) I'll be here to help you if they enable your shell access today.

I'm also waiting on HR to write me back about something. But they're busy doing the moves and all, so don't expect too much today.

dtr1001
03-16-2002, 03:05 PM
I have tried to generate a ticket, (twice over a 2 hour period) but the system keeps generating a 500 error :(

Why do we need this to get the cripts working, and why should the files be in scgi bin, sorry for all the questions, just my site has been down two weeks now and we're losing money. I appreciate how responsive you have been

regards

David

PS i'm using ACEftp to publish these

Mr. Popularity
03-16-2002, 03:23 PM
well, I don't know how your software package works, so the best way to get it debugged is run it via shell.