FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Perl permissions





jabapyth
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?
qscomputing
Try putting it in your cgi-bin directory.
jabapyth
you need it in your cgi-bin?? thats annoying Confused Confused
Whys that?
qscomputing
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.
deepak
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.
qscomputing
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.
garionw
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 Laughing
qscomputing
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.
Related topics
cPanel permissions problem.
Perl Tutorial links
Can't change permissions? Could not change perms on images
how can i find the perl location?
Permissions problem with Linux
Moveable Type Install
Programmation
Perl server referencing
Perl Support
Questions about cron jobs and permissions
Two questions
executing a perl script
how to install perl or cgi
Do you still use PERL?
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.