dtm41506 2014-02-18 12:03
浏览 144

上传文件Apache Web服务器的所有者

I'm having trouble handling the uploaded files on my web server.

First the file is uploaded to the temp server by user "daemon" then I copy the file to www/myapp/files folder by the "www-data" user. Everything works fine, I can read and write to the file, but when I try to delete the file I get an error. Because I'm trying to delete the file as www-data user (php script), but the owner of the file is daemon user.

My question is how can I fix this?

I'm not looking for any chmod or chown solutions, I prefer the solution to be through Apache or some other configuration files.

EDIT: As requested file permissions: -rw-r--r-- 1 daemon daemon 41638 Jan 19 08:59 FILE

The parent folder has 0777 permissions

  • 写回答

2条回答 默认 最新

  • dongtan7351 2014-02-18 12:17
    关注

    You can add both users to one group like this:

    usermod -a -G groupName userName
    

    And then set up r\w permissions for that group

    评论

报告相同问题?

悬赏问题

  • ¥15 arduino控制ps2手柄一直报错
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥85 maple软件,solve求反函数,出现rootof怎么办?
  • ¥15 求chat4.0解答一道线性规划题,用lingo编程运行,第一问要求写出数学模型和lingo语言编程模型,第二问第三问解答就行,我的ddl要到了谁来求了
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题