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

什么是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)

  • 写回答

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
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题