Smart questions
Smart answers
Smart people
Join Tek-Tips Forums
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

cgi scripts on godaddy.comHelpful Member! 

Jones2312 (TechnicalUser) (OP)
1 Jun 06 3:25
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
mbrooks (Programmer)
1 Jun 06 4:15
1. Check the permissions of the file, make sure they are set to 0755.
2. Check the paths within your script.

M. Brooks
http://mbrooks.info

Helpful Member!  Jones2312 (TechnicalUser) (OP)
1 Jun 06 4:34
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?
PaulTEG (TechnicalUser)
1 Jun 06 4:47
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 winky smile

Jones2312 (TechnicalUser) (OP)
1 Jun 06 5:05
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.

Jones2312 (TechnicalUser) (OP)
1 Jun 06 5:08
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.
PaulTEG (TechnicalUser)
1 Jun 06 5:18
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 winky smile

Jones2312 (TechnicalUser) (OP)
1 Jun 06 5:31
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...
PaulTEG (TechnicalUser)
1 Jun 06 5:52
Ok

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments winky smile

Jones2312 (TechnicalUser) (OP)
1 Jun 06 6:16
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
PaulTEG (TechnicalUser)
1 Jun 06 6:19
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 winky smile

Jones2312 (TechnicalUser) (OP)
1 Jun 06 6:30
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
-----
PaulTEG (TechnicalUser)
1 Jun 06 11:07
sorry can't help, don't have python installed, did you get any luck with the python forum?

--Paul
KevinADC (TechnicalUser)
1 Jun 06 14:11
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.
Jones2312 (TechnicalUser) (OP)
1 Jun 06 14:34
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
feherke (Programmer)
1 Jun 06 14:42
Hi

Quote (jay):

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 :

http://en.wikipedia.org/wiki/Unix_shell

Feherke.
http://rootshell.be/~feherke/

Jones2312 (TechnicalUser) (OP)
1 Jun 06 15:12
thanks! that makes sense...
j
linuxun (IS/IT--Management)
25 Jul 06 11:19
Jak,
How are thing going with moinmoin on godaddy?  Did you get it installed?
gsaxton (TechnicalUser)
9 Nov 06 13:16
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
Jones2312 (TechnicalUser) (OP)
9 Nov 06 17:10
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 ;)

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close