poeka Posted July 10, 2017 Posted July 10, 2017 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.
Krydos Posted July 10, 2017 Posted July 10, 2017 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. 1
poeka Posted July 11, 2017 Author Posted July 11, 2017 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 .pyDirectoryIndex index.py any suggestions on how to solve this
Krydos Posted July 12, 2017 Posted July 12, 2017 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.
poeka Posted July 12, 2017 Author Posted July 12, 2017 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?))
Krydos Posted July 13, 2017 Posted July 13, 2017 Yeah, we can install python modules for you. Just let us know:Module name (webob)Python version you're usingServer that you're on 1
poeka Posted July 13, 2017 Author Posted July 13, 2017 It would be great if you could install webob module, i'm on johny server using python 3.6. Thank you.
poeka Posted July 13, 2017 Author Posted July 13, 2017 Installed.wow, thats really fast, thanks a lot)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now