Welcome to Geeklog, Anonymous Monday, December 30 2024 @ 12:39 pm EST
Geeklog Forums
permissions Dummie. Need help
serious help
Anonymous
The last time I tried to fix this on my site.. I lost the entire site and have not been able to upload it( don\'t know how) Paid someone to upload the last one. ANYHOOO.. This is another site and I don\'t want to lose this one so I need someone to explain very simply what to do here ( if you can) .. Please don\'t say to set permissions at 775.. Please tell me the letters because I just don\'t get it....(if you don\'t mind) Anyone else out there feel this way. Surely I can\'t be the only one!
Here is my error code on www.inan.info
Warning: fopen(/usr/local/share/doc/vhost/inan.info/httpdocs/logs/error.log): failed to open stream: Permission denied in /usr/local/share/doc/vhost/inan.info/httpdocs/lib-common.php on line 809
Thanks for anyone who will help. thank you so much
8
9
Quote
Status: offline
ascott
Forum User
Junior
Registered: 06/05/03
Posts: 27
Hi dude,
this error isn\'t necessarily indicitive of a having a permissions problem, though that is one possible error. If it is a permissions problem it means that you don\'t have the permission to read the file, let alone write.
Two thoughts:
One is that the path specified to the file is incorrect. The file may be somewhere else, or you may not have the correct permissions to traverse the directory tree all the way to the file (you will need execute bit set for whoever is trying to traverse the directory tree, whether they fall into the category of owner, group or other).
Two is the the file itself has incorrect permissions.
Rather than feed a man, perhaps I\'ll be able to teach a man to fish.
The following assumes you have root access on your Unix host. These are not instructions for windows (but would work Mac OS X).
First, make sure that the where the error message is pointing to the file is indeed where the file is.
Second, try suing to the user who your webserver runs as, if it is apache, then do:
su - apache
Now, as the apache user, try to traverse the directory tree one directory at a time all the way to the file, if you run into any errors along the way then you have found the directory where the permissions need to be loosened up.
exit as apache. change the permissions as you need, while root.
the commands chmod, chown, and chgrp are used commonly on all Unixes to deal with filesystem permissions.
If you do an ls -la on a file (or some other equivlent option that prevides a long view and displays the permissions), you will see an entry that looks something like:
drwxr-xr-x 3 nobody nobody 4096 Aug 8 01:17 plugins
drwxr-xr-x 8 nobody nobody 4096 Aug 23 05:52 public_html
-rw-r--r-- 1 nobody nobody 3961 Aug 8 01:17 readme
drwxr-xr-x 3 nobody nobody 4096 Aug 8 01:17 sql
drwxr-xr-x 5 nobody nobody 4096 Aug 8 01:17 system
The first column states where the permissions are currently at for the file. A \"d\" at the beginning of the permissions means that it is a directory. A \"-\" means a file. And if you saw an \"l\", that would mean a symlink. i think there are about 4 other types of files on Unix but these are the ones that you will see the most as a Unix admin.
The third and fourth columns are the user and group that the file belongs to. You change those with chown and chgrp, respectively.
The perms you change with chmod. Chmod works in two ways:
One, you can pass it a numer that specifically sets the permissions to the number
Two, you can add or subtract permissions cumulative to the permissions already set.
Look again at the permissions on teh files above:
drwxr-xr-x 3 nobody nobody 4096 Aug 8 01:17 plugins
Imagine in your mind that the nine spaces after the \"d\", in this case, were broken into three groups:
d|rwx|r-x|r-x
The three groups would be \"user\", \"group\" and \"other\" in that order.
So, in this case the user has read, write and exectue permissions. Group has read and exectue permissions and other has read and exectue permissions. As I said earlier, it is a feature of Unix filesystems that you need execute perms on any dir to be able to traverse the dir.
Now, think of these three groups as octets that can value 0-7, they match up like thus:
421
rwx
So add the numbers together. If you want to set a permissions to read write exectue for that group, then you would issue a 7 for the field to the chmod command. If you want just read an execute then that would equal 5, or just read and write, that would equal 6....
So, if you want your permissions to be -rwx-wx-wx for the file foo.txt you would issuse the command:
chmod 733 foo.txt
if you wan the permissions wide open, you can do:
chmod 777 foo.txt
Which would set your perms to -rwxrwxrwx and would mean that the user has rwx, the group has rwx and other has rwx. Other is anybody who doesn\'t fit into the category of user or group, so they must be \"other\".
The other way to change perms with chmod is with letters:
if you have perms already set for foo.txt to -r-xr-xr-x and you want to give the group write access, then you can issue a command like:
chmod g+w foo.txt
which is the same as:
chmod 575 foo.txt
either way works.
if you wanted to take away execute perms for other, in the above example, you can do:
chmod o-x foo.txt
which is the same as:
chmod 554 foo.txt
and so on.
If you want to alter user perms, you use chmod u {+ or -} perm and so on....
Hope this was helpful. Prolly waaaaaay too much information, really, but I\'m good at that.
Andrew
11
9
Quote
All times are EST. The time is now 12:39 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content