Jump to content

Recommended Posts

Posted

Hello there! I have set up an account today to host 2 python bots, and I tried starting them. But when I go to cgi-bin, I get a 403 error. I can view https://alpriven.heliohost.org , and the cPanel. I have checked the permissions and they are 755 (both for cgi-bin and the files). 

Am I doing something wrong? How can it be that cgi-bin's permissions are 755 and yet I can't access it.

Thanks for any help!

Posted (edited)

Set permission to 644 for files and 755 for folders.  (Sorry about that)

 

Check the shebang line in python file for correct location of binary.

Edited by vanisk
Posted

shebang is #!/usr/bin/python3.7 for all files. And how would downgrading the permissions of files (that I can't even see) help? Especially since they need to be executed, so 644 doesn't even make sense for them.

Posted

Actually, the permissions for the file are important, thus even if you're executing the file or whatever, please set it to 644.

 

To set the permissions, go to cP File Manager > public_html > youdomain.com  > cgi-bin  > Click on the file and on the top-right corner, click on 'Permissions' > Set it to 644 ... and it will work. :)

Posted

Try changing shebang to #!/usr/bin/python

 

idk why, but its working for me with the above line and (it gives 500 internal server error on #!/usr/bin/python3.7). I'm on Tommy btw.

Posted

Tutorial is correct. 755 is the right permission.

 

Try changing shebang line and check if line endings are of linux-style.

Posted

If the problem was with the files (shebang is incorrect or line endings aren't linux-style), then it would probably give a 500 internal server error, rather than a permission denied error.

Posted

The cgi-bin folder showing a forbidden message is normal unless you have an index file or specify a file name.

 

The scripts themselves seem to be broken. I switched startdiscord.py back to 3.7 and added a "script start" debug message to http://alpriven.heliohost.org/cgi-bin/startdiscord.py and it shows, so the server is running the script when triggered.

 

Also, be aware the stuff in the bots folder still has dos line endings...

Posted

thank you very much! it switched error messages, so now I actually know what's wrong! But is there an easy way to tell/fix the dos line endings? Obviously if I'm just looking at a file then I can't tell the difference.

Posted

Notepad++ can do it I believe. There should be an option for line endings or file format. On an iPad at the moment so can't check...

 

If you are using Linux, you can do it in vim, command :set ff=unix will change the file format to Unix line endings.

Posted

Thank you! It no longer gives an error! It still doesn't work though, but I don't think it's because of permissions and so is out of the scope of this thread

Guest
This topic is now closed to further replies.
×
×
  • Create New...