How to give apache permission to write to home directory?

前端 未结 4 1235
深忆病人
深忆病人 2020-12-14 03:21

My server is in /var/www/html I have a php script in /var/www/html/fileio_test/io_test.php



        
4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-14 03:55

    In order for this file to be readable for both the user "djameson" as well as the webserver, you need to do 4 things:

    1. Add the user apache uses (www-data on most systems) to a user group on your system. You might want to create a new one.
    2. Add the user "djameson" to that group as well.
    3. Change owner permissons (chown)of the file, so that it is owned by the user django and the group you just set up.
    4. Make sure the file permissions (chmod) allow read permission by the group.

提交回复
热议问题