File Permision for PHP errors log

Posted on 2011-04-22
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
    LVL 14

    Accepted Solution

    Change ownership to root and apache group, then give it 660 or 664 permissions
    LVL 31

    Expert Comment

    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

    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now