Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cgi scripts on godaddy.com 1

Status
Not open for further replies.

Jones2312

Technical User
Jun 1, 2006
12
US
hi all - i'm having trouble running cgi scripts on godaddy and godaddy support hasnt been helpful at all. I'm hoping someone here knows what the problem is.

1. I'm trying to install moinmoin (wiki) on my godaddy account.
2. my godaddy account is non-dedicated (ie, i dont have shell acess, but i do have an ftp program that can transmit raw commands). Also, my account does supposedly support python, php, ruby, and a few other things.
3. While going thru the moinmoin install, it said to test my python on my server by running a small .cgi script called "pythontest.cgi".
4. It said to upload it in ASCII mode, then put it into my 'cgi folder', and then execute it.
5. I did everything it said: uploaded in ascii, put it in cgi folder, and tried to execute it via a browser, by putting 'pythontest.cgi' as part of a URL path.

I got an 'internal server error'. Any ideas? ANything at all? thanks!
j
 
hi - thanks for responding - I did change the permissions to 755, i forgot to mention.
The path is correct, i double checked...

anything else you can think of that might be wrong?
 
Check your servers error logs ... there should be more information there ...

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
hi - i 'enabled' the error logs in godaddy (they're so silly). It takes an hour before they become "active" (and then the error logs become "disabled" again, automatically, after 24 hours. (how weird). Anyway, so I will try checking the error logs in an hour when they are "active".
Thanks for your help; I'll reply back soon with any other info the error logs may have.

 
FYI, the file I'm trying to run, looks like this: (its called "pythontest.cgi".)

#!/usr/bin/python
print "content-type: text/html\n\n"
echo Content-Type: text/plain
echo
echo "Your web server is running as:"
id
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
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."

The first line, the shebang, I changed so it points to /usr/bin/python, which is what godaddy said I should do. The second line, the "print...", I added because again I found a note about that in godaddy's help website. The rest is as-is from the moinmoin site where I got it from.
 
I'd have a quick look at the pYthon forum (assuming there is one)

"Internal Server Error" happens when the script generally outputs something the webserver wasn't expecting, like an error before the content-type header.

Has godaddy.com got any python support, or what support does moinmoin offer, by way of FAQ's or Forums

--Regards
--Paul

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
moinmoin doesnt have much support for what I was looking for, which was help in installing it to a shared server like my godaddy account (where i dont have shell access); though I believe it should be possible to install it anyway using ftp and ftp 'raw commands'). But in terms of installing it on godaddy specifically, they didnt have anything on that.

Godaddy hasnt been very helpful because their policy is that they dont help with scripts, period.

I'll check to see if there's a python forum; and I'll write back after I see the error log...
 
Ok

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
server error log reports the following:

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 24.199.99.203] Premature end of script headers: /var/chroot/home/content/j/a/k/jak68/html/cgi/pythontest.cgi


My feeling is that its not a 'real' syntax error (i've checked the syntax and i'll also run this by the python forum), but that doesnt leave too many other options for what might be wrong. I suppose its possible that /usr/bin/python isnt the right location, though again thats what godaddy told me and on other sites I've seen the same...
anything else you can think of that might be wrong?
thanks
 
Dunno Python, but would have expected an echo statement to output a variable or a string in Quotes

Code:
echo "Content-Type: text/html\n\n"

Try that and see ...

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
hi paul,
tried it, same error:

-----
File "/home/content/j/a/k/jak68/html/cgi/pythontest.cgi", line 2
echo "Content-Type: text/html\n\n"
^
SyntaxError: invalid syntax
[Thu Jun 1 03:30:04 2006] [error] [client 24.199.99.203] Premature end of script headers: /var/chroot/home/content/j/a/k/jak68/html/cgi/pythontest.cgi
-----
 
sorry can't help, don't have python installed, did you get any luck with the python forum?

--Paul
 
godaddy lists this:

Python CGI

as available with deluxe and premium plans. I'm not sure what Python CGI is, you should contact godaddy and ask them if you can run python scripts with your hosting plan.
 
hi guys - mystery solved!
Turns out its not a python script at all, its a "shell script" (whats the difference? I didnt think "shell" was a language!). Anyway, therefore, the shebang at the top had to read #!/bin/sh. Fixing that fixed it; works fine now!

yep, its my first website and I'm stumbing thru it!

Thanks so much for your help though. I'm very glad I found this forum! ;)

jay
 
Hi

jay said:
Turns out its not a python script at all, its a "shell script" (whats the difference? I didnt think "shell" was a language!).
The shell is the generic name of command interpreters on Unix systems. They are like the command.com on DOS and cmd.exe on Windows. So the shell scripts are the equivalent of the DOS/Windows batch files.

A short and nice description :


Feherke.
 
Jak,
How are thing going with moinmoin on godaddy? Did you get it installed?
 
Follow-up:

I'm having the exact same problem as jak68. Could you please tell me how you fixed it? Whenever I type in the url for the script, it just opens up a text file. In short, it doesn't look like it's running CGI, even though I'm using Configuration Host 2.0, which is supposed to have python on it. (I am not having any problems running a Wordpress blog on the hosting account, but the moinmoin set-up is a bit excruciating thus far.).

Cheers,

Greg
 
linuxun and gsaxton,
wow, that was a while ago (june!). If I remember, I didnt get very far into the moinmoin install after all, because at some point in the install, I needed to have command line access at the server, and I was on a "shared hosting account" at godaddy (the cheap ones). Shared hosting accounts dont have command line access (at godaddy anyway). To get that, one has to purchase the (somewhat more expensive) "dedicated hosting account". If you do that, you get complete access (just like its your own server; you can install whatever you want on it and have total access). I opted not to pay the extra money, so my moinmoin install basically ended there. ;)
What I did do tho, was turn to ODDMUSE WIKI, which is PYTHON based, and which DID NOT NEED COMMAND LINE ACCESS TO INSTALL, since the ENTIRE WIKI is contained in a SINGLE EXECUTABLE FILE. You simply upload that single file to your site, and you're done! (ok, its not THAT simple, but basically, it is!). SO I was able to get that up and running with very little trouble (no trouble, actually) on my 'shared hosting account', and I've been very happy with it. Its wiki performance is fantastic, it does everything I want, it has great support at the oddmuse.org site. And its extremely user-friendly for a beginner like me. I've been using it extensively for all my wiki needs, and I'm glad to have a wiki on my own account at godaddy.

So thats how that ended ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top