Maybe im just ignorant, but i created a simple cgi script, set the permissions to 0755 (via chmod), and now i get a permissions error.
| Code: |
| You don't have permission to access /test.pl on this server. |
what did i do wrong?
Try putting it in your cgi-bin directory.
you need it in your cgi-bin?? thats annoying
Whys that?
A CGI is basically a program that runs on the server - it could do anything it's coded to do. So, to help with security, most servers require CGIs to be placed in a special directory (cgi-bin), where CGI execution is permitted: it's easier to ensure good security on one directory than the entire server. Without this, if you accidentally set a directory to be world-writable, someone malicious could put a file in that directory and then execute it via CGI, potentially deleting everything on the server. PHP runs in a sort of sandbox, so it's not such a big issue.
I had pretty bad experience ealier but on frihost it works prefect .. just put your PL files in cgi-bin and if chmod them 777(suggested) or 755.
No, 777 is a bad idea: 7 means rwx ie read, write and execute. You only want yourself to be able to write to your script files, so set 5 for group and world permission (r-x), making a total of 755.
| qscomputing wrote: |
| No, 777 is a bad idea: 7 means rwx ie read, write and execute. You only want yourself to be able to write to your script files, so set 5 for group and world permission (r-x), making a total of 755. |
Wow, I didn't know that, I thought that they were just random numbers 
Yes, the permissions are as follows:
4: read
2: write
1: execute
You add them together to get the permission you want, then you put three added values after each other to give owner, group and world permissions, in that order. So 755 is rwx for owner, and r-x for group and world.
You can also add some other numbers at the beginning for setuid, setgid and sticky (can't be deleted), but I've never used these. HTH.