13719654321 发表于 2017-1-8 09:19:39

liunx下apache服务器出现Permission denied

  上传文件的时,服务器报错Permission denied:权限不够。
  登陆服务器察看该文件夹权限:
  ls -l
  drwx-w--w- 1 root root 0 Mar 7 19:35 testfile //查看文件拥有者为root,用户组为 root !
  由于用的是apache服务,所以要把文件的用户组权限设置为:rwx(rw-),用户组设置为apache。完成分2步:
  1.先设置权限(设置用户组权限为读写执行-rwx):
  chmod -R 755 testfile
  查看结果->>ls -l:
  drwxrwx-w- 1 root root 0 Mar 7 19:35 testfile //查看文件
  2.修改文件的用户组:
  方法1:chown root:apache testfile
  方法2:chgrp apache testfile
  查看结果->>ls -l:
  drwxrwx-w- 1 root apache 0 Mar 7 19:35 testfile 
  ok,重启服务:/etc/init.d/httpd reload
页: [1]
查看完整版本: liunx下apache服务器出现Permission denied