Jump to content

Setup Python


cokie

Recommended Posts

I am trying to setup

1. A normal python script and 2. Get CGI python programming to work.

 

<html">
<head>
<title> Bible Word Repeater</title>
</head>
<body>
<form id="myform" action="submit-form.php">Search:<input type="text" name="query" /><input type="submit"></form>
</body>
</html>

 

#!/usr/bin/python

print "hello world"

 

When I submit the form it says:

 

"Internal Server Error

 

The server encountered an internal error or misconfiguration and was unable to complete your request.

 

Please contact the server administrator, webmaster@cokie.heliohost.org 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."

 

How can I setup a normal python program so this doesnt happen

 

Also, on heliohost do I need certain permissions and setting to use CGI?

 

Thank You!

 

Link to comment
Share on other sites

Chmod the files to 755 and put them in your cgi-bin directory. All accounts have CGI automatically enabled.

 

Do you mean use the permissions button at the top on the hello-world.py script so the User Group and World settings are 7,5,5 in that order, or do you mean to use it on the cgi-bin folder itself?

 

Link to comment
Share on other sites

Do you mean use the permissions button at the top on the hello-world.py script so the User Group and World settings are 7,5,5 in that order, or do you mean to use it on the cgi-bin folder itself?

Both. The folder should be 755 by default, and each file you want to be able to execute inside the cgi-bin folder should have permissions of 755 too.

Link to comment
Share on other sites

Do you mean use the permissions button at the top on the hello-world.py script so the User Group and World settings are 7,5,5 in that order, or do you mean to use it on the cgi-bin folder itself?

Both. The folder should be 755 by default, and each file you want to be able to execute inside the cgi-bin folder should have permissions of 755 too.

 

I setup the following in the Change Permissions button on the top of the file-manager User = 7 Group = 5 and World = 5 and i still get the error. I even tried renaming .htaccess in the directory of html page, creating a new one, but that did not do anything. Any ideas?

Link to comment
Share on other sites

Is it in your cgi-bin directory?

 

 

the helloworld.py file is yep. I read online perhaps it is a server error.. I dont want to get on the wrong track though.

 

By the way, I changed the htaccess file to htaccess1 and it created another htaccess file but it is 0 bytes and I cant change the one that is the original back to htaccess becuase it keeps on making a new one that is 0 bytes.

 

Link to comment
Share on other sites

Any text output without headers doesn't work(500). Your must print HTTP Response headers and blank line before printing object body, otherwise you will get 500 internal server error.

 

P. S. now any 'print' or doesn't work at all, but script runs (after Stevie's quered accounts), any cgi apps returns 500 internal server error.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...