doushao5047
2015-06-22 10:40
浏览 71
已采纳

什么是Linux Apache2 PHP 5.3日志文件的正确权限?

I discovered the reason why I was not getting entries into my php_errors.log file related to permissions. Right now, I have set it to 666 (rw-rw-rw-) but surely this is a security weakness? Thus, my question.

php.ini file: error_log /var/log/httpd/php_errors.log log_errors On

# ls -ld /var/log /var/log/httpd /var/log/httpd/php_errors.log
drwxr-xr-x 6 root     root     4096 Jun 21 03:32 /var/log
drwxr-xr-x 2 ec2-user ec2-user 4096 Jun 22 10:16 /var/log/httpd
-rw-rw-rw- 1 ec2-user ec2-user   63 Jun 22 10:33 /var/log/httpd/php_errors.log

(Many thanks in advance)

图片转代码服务由CSDN问答提供 功能建议

我发现了为什么我在我的php_errors.log文件中输入相关内容的原因 到权限。 现在,我把它设置为666(rw-rw-rw-),但这肯定是一个安全漏洞? 因此,我的问题。

php.ini文件: error_log /var/log/httpd/php_errors.log log_errors On

  #ls -ld /  var / log / var / log / httpd /var/log/httpd/php_errors.log
drwxr-xr-x 6 root root 4096 Jun 21 03:32 / var / log 
drwxr-xr-x 2 ec2-user ec2- 用户4096 6月22日10:16 / var / log / httpd 
-rw-rw-rw- 1 ec2-user ec2-user 63 Jun 22 10:33 /var/log/httpd/php_errors.log
  
 
 

(非常感谢提前)

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doupi7619 2015-06-22 10:46
    已采纳

    I'd simply set its owner to apache user.

    This will give you the name of apache user :

    ps aux | grep httpd
    

    In my case (CentOS), it's 'apache' but sometimes it's 'www-data'...

    chown apache:apache /var/log/httpd/php_errors.log
    chmod 600 /var/log/httpd/php_errors.log
    
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题