Jump to content

Recommended Posts

Posted

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!

 

Posted

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

Posted
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?

 

Posted
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.

Posted
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?

Posted
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.

 

Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...