Python

Status
Not open for further replies.

zmtpcrio

New Member
Messages
9
Reaction score
0
Points
1
I understand there is support for Python on the free tier, but I can't seem to get it to work.

In Cpanel I stored the file, mkform.py in public_html/cgi-bin. I understand a Python file should run there. The following (very simple) code is contained in the file (I plan to do something much more computationally complex later, which is why I wish to run Python), but for now, just want to get something working:

#!/usr/bin/env python
print("Content-type: text/html")
print("")
print("<html>")
print("<body>")
print( "Hi there")
print("</body>")
print("</html>")

Currently, if I go to my site, http://zmt.pcriot.com/cgi-bin/mkform.py, I get a 403 Forbidden error.

Further, for good measure, I added a file called .htaccess to the top level folder /home/zmtpcrio I had read this wasn't needed if the Python file was in cgi-bin, but after not working, I added it anyway. Currently there in this file is the following code:

AddHandler cgi-script .py

Anyone who can help me to get my Python script kicked off would be hugely appreciated!
 

zmtpcrio

New Member
Messages
9
Reaction score
0
Points
1
Thanks, I greatly appreciate the thoughts.

I actually saw those two while searching and submitted a form to x10 support yesterday to confirm it is indeed available with paid and that the free was the issue, and got this response from them,

"We do currently offer python compatibility to our free web hosting service. You are encouraged to open a topic in our community forum ( https://x10hosting.com/community/ )where we have staff or other members of the community that are available to assist you."

Which is what brought me here. I'm new to x10 (just signed up yesterday), so again, appreciate your thoughts here. I'm thinking you are right, but any additional thoughts are welcome, especially if anyone has experiences successfully utilizing Python scripting in the paid version (or free if that is possible).
 

zmtpcrio

New Member
Messages
9
Reaction score
0
Points
1
Awesome, thanks! I'll give the paid service a shot when I return to the project Tuesday and will confirm if it worked for documentation. I definitely appreciate your help!
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
Just to add, I did find the support ticket in question and updated the staff member who had originally done the reply; python used to be enabled but had since been disabled primarily to counter abuse, as python isn't often used in websites (and unfortunately was very heavily used for abusive scripts including brute-force password crackers and DDoS scripts). We apologize for the confusion and will make sure all the other staff are brought up-to-speed on future changes so we can avoid misinformation.
 

zmtpcrio

New Member
Messages
9
Reaction score
0
Points
1
Excellent, thank you. That is unfortunate... but I'm glad it is there in the paid version! I can assure you my need is much more to do with math than anything nefarious : )
 

zmtpcrio

New Member
Messages
9
Reaction score
0
Points
1
Ok, so this all said, I just signed up for a premium account, migrated my free account, paid my invoice, cleared my browsing history, went to zmt.pcriot.com/cgi-bin/mkform.py and got the same 403 Forbidden Error...

Forbidden
You don't have permission to access /cgi-bin/mkform.py on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.


Is this just a matter of it taking time to propagate through the system that I have upgraded?

Thanks for the ongoing help!
George
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
It could be DNS propagation if it's under the same URL; DNS requests are generally cached by your computer, and sometimes by your ISP. If you ping the domain and get an IP starting with 198, it's still "looking" at the free account. As long as it's not cached by your ISP, you can manually force it to clear by opening a command prompt and running "ipconfig /flushdns" - then close all browsers/ftp clients and start over. If it still points to an IP starting with 198, then sadly the ISP is caching it, and it may take 72hr for it to clear; DNS caches usually expire faster than this, but 72hr is the longest we've seen.

If you ping it, does it come back with 198.*?
 

lylex10h

Active Member
Messages
982
Reaction score
71
Points
28
zmt.pcriot.com resolves to 162.253.224.14 for me. If it's an ISP DNS cache issue, you should be able to over ride it by editing your hosts file. You will still need to flushdns after doing this. See guide here for info on editing hosts file.
 

zmtpcrio

New Member
Messages
9
Reaction score
0
Points
1
Thank you both! This is the issue, I'm getting an IP starting with 198! I'm actually heading out of town for a long weekend and won't be able to do much more witht he site until Tuesday anyway, so the 72 hours is fine to wait. Again, I appreciate everything greatly and will provide an update next week!
 
Status
Not open for further replies.
Top