Home  >  Q&A  >  body text

nginx - Can the Web file system umask be customized?

The umask configured for nginx in the system is 002, but why does using php on the web to obtain the umask value change to 022? Where can it be set? Please ask a friend who knows for guidance, thank you!

Remarks: The umask is set to 002 for the corresponding nginx user. When switching to the nginx user in the server, the permissions of the files and folders created by direct touch or mkdir are correct, but through php on the web There is a problem with the script creation. I checked the umask and it turned into 022. The problem should be here (everything about nginx in this analysis is problematic and meaningless)

New: The global umask has been configured to 002, and the corresponding user in the Web (the user corresponding to this web is the user I set in /etc/php-fpm.conf) has also been configured Set and directly touch or mkdir create files and folder permissions in the server are correct

I found such a somewhat relevant information, but there is no php5-fpm.conf file under /etc/init/ in the system. If I add it to /etc/nginx/php5-conf, it will prompt that umask does not recognize it. Directly in /rtc Create this file under /init/, and adding the parameters corresponding to the text modification in this theme has no effect (http://stackoverflow.com/questions/21248904/how-to-trace-where-php5-fpm-umask-settings -are-coming-from-on-ubuntu)

滿天的星座滿天的星座2688 days ago1458

reply all(1)I'll reply

  • 某草草

    某草草2017-05-16 17:27:27

    Finally, php-fpm calls the system as system user. instead of nginx . Modifying nginx configuration has no effect.

    The installation of /etc/php-fpm is different, so the location of the configuration file is also different. You need to find the php-fpm configuration file yourself.

    You can check the configuration file by viewing the php-fpm process status

    ps aux | grep php-fpm

    You can see the configuration file currently used by php-fpm.

    If you create a configuration file at will, it will not be read by the program and take effect.

    Find these out and try again. Good luck.

    To put it bluntly, now that there are very useful storage clouds like 七牛, 又拍, 亚马逊S3, why do you still need to upload files to the server yourself?

    (Small companies or individuals are still using inferior methods in static resource management, which really cannot keep up with the times)

    1. Do you have a CDN for the static files you uploaded?
    2. Do you take the time to sort out your file caching strategy?
    3. Is it worth it if you consume the server’s upload bandwidth?
    4. Is your web server’s static file processing capability excellent?
    5. Does your static file server have various multimedia support functions?
    6. Have you ever considered browser concurrency issues?
      ....

    Dangren third-party cloud storage is not perfect and suitable for all user groups, but it is suitable for individuals or small and medium-sized groups. Well worth trying.

    reply
    0
  • Cancelreply