Jump to content

Recommended Posts

Posted

hi all,

 

guys i have johny version with python, i was wondering how to set up an index(.py) file for my website that is placed in my /cgi-bin/ folder so i can access my index page without typing the full path/address such as mywebsite.heliohost.org/cgi-bin/index.cgi?

 

what i could find on the web is that i can use redirection from www/index.html to www/cgi-bin/index.py or permit apache exec cgi in www.

 

so what can i use in this case and how do i do that?.

 

any help appreciated.

tnx.

Posted

The index.html way is really easy. Create public_html/index.html

<meta http-equiv="refresh" content="0; url=cgi-bin/index.py" />
With this option people who go to domain.heliohost.org will end up at domain.heliohost.org/cgi-bin/index.py

 

Making python scripts executable in public_html is a little more complicated. Create public_html/.htaccess

# this line makes the python code execute instead of display the source
AddHandler cgi-script .py

# this line executes index.py if no file is specified
DirectoryIndex index.py
With this option people who do to domain.heliohost.org will see that in their browser url bar.
  • Like 1
Posted

The index.html way is really easy. Create public_html/index.html

<meta http-equiv="refresh" content="0; url=cgi-bin/index.py" />
With this option people who go to domain.heliohost.org will end up at domain.heliohost.org/cgi-bin/index.py

 

Making python scripts executable in public_html is a little more complicated. Create public_html/.htaccess

# this line makes the python code execute instead of display the source
AddHandler cgi-script .py

# this line executes index.py if no file is specified
DirectoryIndex index.py
With this option people who do to domain.heliohost.org will see that in their browser url bar.

 

that is really fast reply, thank you,

 

i tried to upload and create .htaccess in html_public folder and i got 500 internal error but, i succeded to upload it to www folder, also i noticed that www folder has 777 permission and html 750 permission may be that was the reason.

 

anyway when i try to visit mydomain.heliohost.org i get 500 internal error:

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

Please contact the server administrator, webmaster@konroor.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 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

 

so i think server reads the script but still got no permissions to execute it?

 

also the .htaccess it self in www or public_html forlder is invisible, .

 

oh i fogot to mention, as yu suggested my .htaccess has 2 instructions,

 

AddHandler cgi-script .py

DirectoryIndex index.py

 

 

any suggestions on how to solve this

Posted

You've actually got all the permissions correct and files created properly and everything. Very impressive! The 500 error is because the python module webob isn't installed.

 

i noticed that www folder has 777 permission and html 750 permission may be that was the reason.

www is actually a symlink to public_html, and symlinks always have 777 permissions.
Posted

You've actually got all the permissions correct and files created properly and everything. Very impressive! The 500 error is because the python module webob isn't installed.

 

i noticed that www folder has 777 permission and html 750 permission may be that was the reason.

www is actually a symlink to public_html, and symlinks always have 777 permissions.

 

ok, i understand, is there a way to get the module webob running? if there is, than please let me know what i can do from my side? Or otherwise it is a good idea to use redirecting method?))

Posted

Yeah, we can install python modules for you. Just let us know:

  • Module name (webob)
  • Python version you're using
  • Server that you're on
  • Like 1

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