running scripts on godaddy acount...
June 1, 2006 12:12 AM   Subscribe

Trying to run python and cgi scripts on a non-dedicated godaddy account. (ie, I dont have shell access). But my ftp program can transmit 'raw' commands to the server. I uploaded a cgi script called "pythontest.cgi" (all this in the context of trying to install moinmoin on my godaddy account). I got the pythontest.cgi script from the moinmoin instructions on installing it. I do have python, supposedly, on my account (its in usr/bin/python). I'm supposed to be able to run CGI scripts from the cgi folder (which is where it is now). I uploaded it in ASCII (as opposed to binary) as they told me to. Godaddy support hasnt been very useful beyond this point. My question is: how in the world do I execute "pythontest.cgi"? I tried putting it in the address bar as a url (with full path) in mozilla. Got an internal server error. Any ideas? Has anyone run scripts off a godaddy account? Has anyone installed a wiki on a non-dedicated godaddy account? Thanks...
posted by jak68 to Computers & Internet (15 answers total)
You have to give the script execute permission. Do you get shell access with GoDaddy? Log into your shell and do:

chmod a+rx pythontest.cgi
posted by evariste at 12:13 AM on June 1, 2006

Oh, you don't have shell access. Can you give it execute permission with your FTP client? And why are you using GoDaddy for hosting? They're the worst host in the world. Go with someone good like Dreamhost or Hosting Matters or TextDrive (all available at quite cheap prices, with shell access and competent tech support).
posted by evariste at 12:14 AM on June 1, 2006

Yeah, you need to give it execute permission with your FTP client, probably. "Internal server error" is usually a permission issue.
posted by kindall at 12:26 AM on June 1, 2006

And yes, the way you execute it is by visiting the URL to it.
posted by evariste at 12:26 AM on June 1, 2006

I used pmwiki on GoDaddy. I untar'ed the tarball locally, then uploaded the whole directory tree to my account (using Transmit on Mac OS X). There are some inconveniences but it does work.

Pmwiki is pure PHP which is all I have on my account since it is the lowest cost deal GoDaddy offers. Their tech support is usually rather clueless although they really do try. The wiki is private or I'd post a URL. It works fine.
posted by gdf at 12:54 AM on June 1, 2006

hi all - yes, i did 'chmod' via the ftp program, so it does have execute permission. Anything else you can think of that might be wrong?

I imagine a php wiki might work better; moinmoin happens to be python...
posted by jak68 at 1:01 AM on June 1, 2006

Open your local copy of the python cgi file and look at the shebang line (#!) does it point to the correct location of python on your server? It should look like #!/usr/bin/python
posted by evariste at 1:30 AM on June 1, 2006

(In a text editor, in case that wasn't obvious.)
posted by evariste at 1:30 AM on June 1, 2006

hi - yes, i played around with the shebang line. Godaddy says the path to python is as you have it, ie, "/usr/bin/python". I tried that, and a few others for good measure...
ANything else you guys can think of that I could check?
I double checked the path, that seems fine too...
Can you think of anything i could ask the tech support folks?
posted by jak68 at 1:36 AM on June 1, 2006

by the way i did successfully run a simple php script. The pythontest.cgi script I'm trying to run, looks like this:

echo Content-Type: text/plain
echo "Your web server is running as:"
echo "CGI scripts work"
echo "Now we try to invoke Python interpreters and get their versions:"
echo "Your default version of python is:"
python -V 2>&1
echo "Available versions of python are:"
python2.2 -V 2>&1 && which python2.2
python2.3 -V 2>&1 && which python2.3
python2.4 -V 2>&1 && which python2.4
python2.5 -V 2>&1 && which python2.5
echo "Finished."
posted by jak68 at 1:47 AM on June 1, 2006

Do you have access to your server error logs? Look in there and try to figure out what error the web server is actually giving. 500 Internal Server Error is kind of a generic catch-all; a more detailed error will be in the error log with the timestamp of when it tried to satisfy the request.
posted by evariste at 2:28 AM on June 1, 2006

server logs report this:
File "/home/content/j/a/k/jak68/html/cgi/pythontest.cgi", line 2
echo content-type: text/html
SyntaxError: invalid syntax
[Thu Jun 1 03:15:34 2006] [error] [client] Premature end of script headers: /var/chroot/home/content/j/a/k/jak68/html/cgi/pythontest.cgi

I suppose I'll ask this at a python bulletin board or forum. Thanks for your help; and if you can think of anything else I'd be happy to hear it! ;)
posted by jak68 at 3:15 AM on June 1, 2006

I don't know shit-all about python, so smack me down if that is appropriate, but shouldn't the content type string have quotes around it?
posted by pompomtom at 3:54 AM on June 1, 2006

Um.. that pythontest.cgi is not python code. It's a shell script. Instead of #!/usr/bin/python up top, make it #!/bin/sh, or whatever godaddy's shells are.
posted by neustile at 5:55 AM on June 1, 2006

Neustile - brilliant!!! Thanks so much, that did it. ;)
Yep, its my first wiki, so I'm stumbling through it... ;)
posted by jak68 at 11:30 AM on June 1, 2006

« Older Can I get unemployment in MN i...   |  Email and spam question - who ... Newer »
This thread is closed to new comments.