[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


File Permision for PHP errors log

Posted on 2011-04-22
Medium Priority
Last Modified: 2013-12-15
I have a server hosted by rackspace cloud and I'm trying to get it set up for my web site.  I was trying to capture my php error messages in a log file but I've had to give write access to the world in order to get it to work.  I don't want to give write access to the world for my log file.  How do I make it so it is set up only for root and still have apache able to write to it?
Question by:lp0411
  • 2
LVL 14

Accepted Solution

svgmuc earned 2000 total points
ID: 35449336
Change ownership to root and apache group, then give it 660 or 664 permissions
LVL 31

Expert Comment

ID: 35449359
You can use ACLs

Please issue the following command:

chmod 770 /log/file/name
setfacl -m u:apache:rwx /log/file/name

If the Apache user is name is httpd, please issue this

setfacl -m u:httpd:rwx /log/file/name
LVL 31

Expert Comment

ID: 35449400
Second way is to give the file apache group so you would access through group apache.

1. Become root
2. chgrp apache /log/file/name
3. chmod 770 /log/file/name

What is the group of apache?  Is it apache or httpd

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Question has a verified solution.

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

This article discusses how to implement server side field validation and display customized error messages to the client.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month18 days, 19 hours left to enroll

834 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