954,234 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Right permissions for folders

Hi guys,

var/www/ is set automatically set as web root when I install ubuntu.

I want to assign permissions to folders of a website if I want host one and the folders inside.

Please help me to assign correct and safe permissions to folders below. Also if you think the structure is wrong please feel free to change it. I see some folders are left outside of main root folder by some users but I don’t know why.

/mytestwebsite/ (root of my website) Permission = ?
/mytestwebsite/script/ (holds css and javascript files – Read only) Permission = ?
/mytestwebsite/include/ (holds some include files, header and footer like – Read only) Permission = ?
/mytestwebsite/class/ (holds important class files – Read only) Permission = ?
/mytestwebsite/images/ (holds all images like site images and user uploads – Read and Write) Permission = ?

Thanks in advance

veledrom
Master Poster
755 posts since Apr 2008
Reputation Points: 42
Solved Threads: 0
 

/mytestwebsite/ (root of my website) Permission = 700
/mytestwebsite/script/ (holds css and javascript files – Read only) Permission =744
/mytestwebsite/class/ (holds important class files – Read only) Permission= 744
/mytestwebsite/images/ (holds all images like site images and user uploads – Read and Write) Permission =777


the permissions in octal

alaa sam
Junior Poster
135 posts since Nov 2010
Reputation Points: 8
Solved Threads: 10
 

Thanks alaasam.

Just one last thing. If I keep class.database.php file (everything related database is in here, connections, SQL bits, etc.) in class/ folder would it be dangerous?

If I assign these permissions then I am safe. Do I understand right?

veledrom
Master Poster
755 posts since Apr 2008
Reputation Points: 42
Solved Threads: 0
 

yes no one else can access them

alaa sam
Junior Poster
135 posts since Nov 2010
Reputation Points: 8
Solved Threads: 10
 

Thanks

veledrom
Master Poster
755 posts since Apr 2008
Reputation Points: 42
Solved Threads: 0
 

you are welcome mark it as solved please

alaa sam
Junior Poster
135 posts since Nov 2010
Reputation Points: 8
Solved Threads: 10
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: