dmncwrk Posted November 29, 2022 Posted November 29, 2022 Hello, I was trying to run python script as it say in tutorial https://wiki.helionet.org/tutorials/python but it did not produce the result. Can I access server over ssh to establish a virtual environment for python? Or is there another way to deploy a python project on Helio hosting?
wolstech Posted November 29, 2022 Posted November 29, 2022 That documentation is for the old cPanel servers and is obsolete. That said, the script itself should work if you make the script using the below shebang line (we updated Python) in Plesk's file manager. #!/usr/bin/python3.10 1
Pansani Posted November 29, 2022 Posted November 29, 2022 Also make sure that your file permissions are like this:
dmncwrk Posted December 10, 2022 Author Posted December 10, 2022 On 11/29/2022 at 9:04 PM, wolstech said: That documentation is for the old cPanel servers and is obsolete. That said, the script itself should work if you make the script using the below shebang line (we updated Python) in Plesk's file manager. #!/usr/bin/python3.10 For some reason Im still struggling with this, could disabled CGI support be the reason? Also when trying to login to Plesk I see cert error, is that how it is supposed to be?
rmurthy Posted December 11, 2022 Posted December 11, 2022 1. Looks like CGI is disabled in your host. I think you need to enable this in order to do scripting. Please goto Websites & Domains. Select Settings for your domain and enable CGI support in Web scriptions and statistics section. 2. The reason for your 'Connection is not private' error is that you are using your sub-domain for logging into Plesk account. Though it is technically possible to do that as 8443 port is enabled on the host, since Plesk is hosted and enabled for tommy2.heliohost.org and the same certificate is used when trying to access the Plesk control panel it ends up with an error as your browser sees a tommy2.heliohost.org certificate when it is trying to access it from your subdomain. I believe this does not affect the security of your SSL connection to the server, however it is best to access Plesk login using regular login through tommy2-based URL as it keeps you from getting too comfortable with ignoring this warning when it might really matter.
Krydos Posted December 11, 2022 Posted December 11, 2022 3 hours ago, dmncwrk said: could disabled CGI support be the reason? There was a mistake in the service plan definitions. For some reason CGI was disabled on the 3000 MB plans, but enabled on the 1000 MB plans, etc. Sorry about that. It's been fixed. Does it work for you now? 3 hours ago, dmncwrk said: Also when trying to login to Plesk I see cert error, is that how it is supposed to be? There are two supported ways to log in to Plesk: 1) https://heliohost.org/login/ and 2) https://tommy2.heliohost.org/ any other method probably will give errors or possibly not count your logins and get you suspended for inactivity. The preferred method for logging in is option 1 so you can see the news and other notifications regarding your account.
Kairion Posted December 11, 2022 Posted December 11, 2022 3 hours ago, dmncwrk said: For some reason Im still struggling with this, could disabled CGI support be the reason? To be honest I've never used Python for web but since you have FastCGI enabled, I don't think it is the problem. Try to run the following script on your website's "cgi-bin" directory: #!/usr/bin/python3.10 print("Content-type: text/html") # Send our page's header to webserver print() # Blank line to end page's header # Now our page's content below: print("<html><head><title>Python \"Hello World!\" testing</title></head><body><pre>") print("Hello World!") print("Heliohost rules!") print("</pre></body></html>") Here's the above script on my website: https://fasouza.eu.org/cgi-bin/test.py Remember that the file should have chmod (permission) 755, so it has to be like that (I used a FTP program but you can do it on Plesk's file manager): If it doesn't work, then probably it is necessary to enable CGI support. But to be sure we need to know what kind of error are you getting when runing your script (and it would be helpful to also have your logs). 3 hours ago, dmncwrk said: Also when trying to login to Plesk I see cert error, is that how it is supposed to be? You're seeing this error because port 8443 has the SSL certificate of "tommy2.heliohost.org". You should access Plesk on https://tommy2.heliohost.org/ or preferably on https://heliohost.org/login/.
dmncwrk Posted December 19, 2022 Author Posted December 19, 2022 On 12/11/2022 at 5:15 AM, Kairion said: To be honest I've never used Python for web but since you have FastCGI enabled, I don't think it is the problem. Try to run the following script on your website's "cgi-bin" directory: #!/usr/bin/python3.10 print("Content-type: text/html") # Send our page's header to webserver print() # Blank line to end page's header # Now our page's content below: print("<html><head><title>Python \"Hello World!\" testing</title></head><body><pre>") print("Hello World!") print("Heliohost rules!") print("</pre></body></html>") Here's the above script on my website: https://fasouza.eu.org/cgi-bin/test.py Remember that the file should have chmod (permission) 755, so it has to be like that (I used a FTP program but you can do it on Plesk's file manager): If it doesn't work, then probably it is necessary to enable CGI support. But to be sure we need to know what kind of error are you getting when runing your script (and it would be helpful to also have your logs). You're seeing this error because port 8443 has the SSL certificate of "tommy2.heliohost.org". You should access Plesk on https://tommy2.heliohost.org/ or preferably on https://heliohost.org/login/. This works now, thank you.
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