Nucleus Support Forum Index

Find on the forum:
any terms  all terms  Advanced Search

RSS 2.0
Browse posts: Unanswered | Mark all read

« »
Loading Nucleus FAQ ticker...
Post new topic Reply to topic
Author Message
matt_t_hat
Nucleus Geek


Joined: 21 Aug 2005
Posts: 1124
Location: UK

Post Posted: Sun Jul 23, 2006 5:10 pm   Post subject: About permissions on a linux server...CHMOD.
Reply with quote

Can some one shed some light on this strange utterance by my host

Quote:
Also about the permission of the file. The directory needs a 755 permission and the files need 644 permission to work. If you have any files with 644 or 744 it should work perfectly. But if it is inside a directory whose permission is less that 755 you may get a forbidden error. Please let me know the exact url or the location in which you are getting a forbiden error. Please check whether the permission of the file is 644 and directory in which the files resides should have a permission 755.

_________________
Host Plugins | Blog | Hundred Quid A Day | My Big Fat Arse

Back to top

View user's profile Send private message Visit poster's website
ftruscot
Nucleus Guru
Nucleus Guru


Joined: 22 Feb 2006
Posts: 7449
Location: Massachusetts

Post Posted: Mon Jul 24, 2006 3:18 pm   Post subject:
Reply with quote

I posted this somewhere else a while ago. I hope it helps. Basically, your apache runs as a user called apache (or something similar) who should not own or be in the group that owns your data files. So when you are setting modes, the last digit is the one that determines what the web server can see/do with files or directories. If the mode of a directory is 744, it means that the directory owner can read, write and traverse the directory, while the group and everybody (including the web server) can only read the directory (which means see it is there, not list its contents). The mode 755 allows the group and everybody (including the web server) to read the directory and traverse it (list its contents). As for files, a 744 or 644 will work because all the server needs to do it read the file and not execute it.


To clarify the file security modes. Each of the three numbers represents permissions for an entity. The first number is the permissions of the file owner, the second number is that of the file's group, and the third number is for everybody. The number itself is really a three-bit binary number indicating whether or not the entity can read, write, or execute. Let's look at a diagram of common modes:
Code:

mode = 777
owner             group          everybody
r   w   x         r   w   x      r   w   x
1   1   1         1   1   1      1   1   1
4 + 2 + 1=7       4 + 2 + 1=7    4 + 2 + 1=7

mode = 666
owner             group          everybody
r   w   x         r   w   x      r   w   x
1   1   0         1   1   0      1   1   0
4 + 2 + 0=6       4 + 2 + 0=6    4 + 2 + 0=6

mode = 644
owner             group          everybody
r   w   x         r   w   x      r   w   x
1   1   0         1   0   0      1   0   0
4 + 2 + 0=6       4 + 0 + 0=4    4 + 0 + 0=4

mode = 755
owner             group          everybody
r   w   x         r   w   x      r   w   x
1   1   1         1   0   1      1   0   1
4 + 2 + 1=7       4 + 0 + 1=5    4 + 0 + 1=5

So, mode 777 allows everyone to read, write, and execute the files.
mode 666 allows everyone to read and write the files.
mode 644 allows the owner to read and write, while everyone else can only read.
mode 755 allows the owner to read, write, and execute, while everyone else can only read and execute.

In general you will want your files to be 644 and your directories 755 (execute for directories means traverse). You should only turn on the write and execute bits for specific and well thought out reasons.

The web server generally runs under a special user, like apache, which shouldn't own your files, nor be in the group that owns the files, but should get its permissions from the everybody entity, which should always have a mode of 4 for files and 5 for directories, except where specified for certain purposes (like the media directory and the skins directories, if you would like to manage the files from the Nucleus admin gui).

Back to top

View user's profile Send private message Visit poster's website
Monkeybrain
Nucleus PhD


Joined: 15 Dec 2005
Posts: 525
Location: Kristiansand, Norway

Post Posted: Tue Jul 25, 2006 8:59 am   Post subject:
Reply with quote

Great explanation there ftruscot Exclamation

Cleared a thing or two for me too Very Happy
Should be sticky'ed somewhere??

_________________
Is your question not solved yet?
Search our FAQ,
read the Documentation, or
browse the list of available plugins.

Back to top

View user's profile Send private message Visit poster's website
roel
Nucleus Guru
Nucleus Guru


Joined: 16 Apr 2002
Posts: 4575
Location: Rotterdam, The Netherlands

Post Posted: Tue Jul 25, 2006 3:41 pm   Post subject:
Reply with quote

Monkeybrain wrote:
Great explanation there ftruscot Exclamation

Cleared a thing or two for me too Very Happy
Should be sticky'ed somewhere??


Sticky. Smile

_________________
Is your question not solved yet?

Back to top

View user's profile Send private message Visit poster's website
danielck
Nucleus PhD


Joined: 15 Dec 2005
Posts: 668

Post Posted: Wed Jul 26, 2006 2:26 am   Post subject:
Reply with quote

or FAQ it?

Back to top

View user's profile Send private message Visit poster's website
Esteban_Panzera
Nucleus Newbie


Joined: 31 Jul 2006
Posts: 6

Post Posted: Mon Jul 31, 2006 6:46 pm   Post subject:
Reply with quote

better faq it, I was looking for this some days ago didn't find it at the faqs and didn't mind looking at the forum
_________________
LAO Directory
Ambatchdotcom Seocontest

Back to top

View user's profile Send private message
Post new topic Reply to topic
Display posts from previous:   

Page 1 of 1

All times are GMT + 1 Hour

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group