Solved

Directory and File Permissions

Posted on 2006-10-21
6
279 Views
Last Modified: 2010-04-20
Hi!

I've got a directory within a user's home directory called "logs". The permissions for this file are:

drwxrwxr-x (775)
webxxx:www-data

"www-data" is the user running as the web server. Text files (logs) are automatically created in this directory by the server. The files created have the following permissions:

-rw-r--r-- (644)
www-data:www-data

My question is: is there any way to automatically make the created log files have the following permissions ? ( when the files are created ) :

-rw-rw-r-- (664)
webxxx:www-data
0
Comment
Question by:Julian Matz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 43

Assisted Solution

by:ravenpl
ravenpl earned 125 total points
ID: 17783235
Put into apache startup script
umask 0002 # instead default 0022. Also read 'help umask'

But in general case there's no way to force user/application to create files/dirs with predefined permissions.
0
 
LVL 40

Expert Comment

by:noci
ID: 17783244
There is a possibility if you have ACL support in your kernel and on your file system, and it is enabled through mount.
 The default acl on a directory can define the settings needed for new files.
0
 
LVL 40

Assisted Solution

by:noci
noci earned 125 total points
ID: 17783261
BTW 'man setfacl' & 'man getfacl' should give you a starting point.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 5

Assisted Solution

by:Yogalingam
Yogalingam earned 125 total points
ID: 17783608
0
 
LVL 8

Accepted Solution

by:
nitadmin earned 125 total points
ID: 17786321
Go to the home directory and look at your .profile file.
in here you can configure umask command.

1. cd /home/www-data
2. use ls-al  command to see all the files. In your home directory there files that begin . (dot), like .bash, .profile.
3. Use your favorite text edit to edit the .profile file.
4. Inside the .profile change the umask 022 to umask 002.

However, I will be carefull doing this because this change may cause problems later.

Cheers,
Nitadmin
0
 
LVL 21

Author Comment

by:Julian Matz
ID: 17886594
Thanks!
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question