Linux Apache用户可以';t在777目录中创建文件

Linux Apache用户可以';t在777目录中创建文件,linux,apache,permissions,chmod,selinux,Linux,Apache,Permissions,Chmod,Selinux,我没有使用SELinux,仍然无法让apache用户在缓存存储目录中创建文件。如果不使用chown将用户更改为实际的apache用户,这是否可以工作 [root@server live_storage]# getenforce Disabled [root@server live_storage]# su -s /bin/bash -c 'touch /home/admin/live_storage/c50d02d942c0a3d.cache' apache touch: cannot touc

我没有使用SELinux,仍然无法让apache用户在缓存存储目录中创建文件。如果不使用
chown
将用户更改为实际的apache用户,这是否可以工作

[root@server live_storage]# getenforce
Disabled
[root@server live_storage]# su -s /bin/bash -c 'touch /home/admin/live_storage/c50d02d942c0a3d.cache' apache
touch: cannot touch ‘/home/admin/live_storage/c50d02d942c0a3d.cache’: 
Permission denied
[root@server admin]# ls -lsa 
total 84 
  4 drwx------. 10 admin admin  4096 24 mei 10:32 .
  4 drwxr-xr-x.  3 root  root   4096  9 mei 11:12 ..
  4 drwxrwxrwx   3 admin admin  4096 24 mei 10:33 live_storage

[admin@server live_storage]$ touch '/home/admin/live_storage/c50d02d942c0a3d.cache'
[admin@server live_storage]$ ls '/home/admin/live_storage/c50d02d942c0a3d.cache'
/home/admin/live_storage/c50d02d942c0a3d.cache

我明白了。Apache没有对
/home/admin
目录的执行权限
chmod+x/home/admin
修复了问题

Did
/home/admin/live_storage/c50d02d942c0a3d。缓存
文件在您尝试以apache身份触摸之前存在?@DusanBajic Hi,不,它没有。整个目录为空
[root@serverlive_storage]#su-s/bin/bash-c'touch/home/admin/live_storage//c50d02d942c0a3d.cache'
touch:cannot touch'/home/admin/live_storage//c50d02d942c0a3d.cache':权限被拒绝[root@server实时存储]#su-s/bin/bash-c'touch/home/admin/live_storage//c50d02d942c0a3d.cache'admin
[root@server实时存储]#