search

Home  >  Q&A  >  body text

linux - What user is generally used to run php-fpm and nginx?

  1. What user is generally used to run php-fpm and nginx in a formal environment?

  2. How to set the directory rights of the website to be safer?

伊谢尔伦伊谢尔伦2822 days ago565

reply all(5)I'll reply

  • ringa_lee

    ringa_lee2017-05-16 13:14:30

    1. Usually the www user is used to run the lnmp architecture

    2. In order to prevent hackers from modifying the system program when a vulnerability occurs in the system, so:

      网站上的 php 文件属主要是非 www 用户,给予644权限。
      网站上的所有目录是755权限,属主也是非 www 用户。
      网站如果有应用需要写文件的目录,比如上传目录,那么此目录和目录下的所有文件属主是 www 用户。

    reply
    0
  • 阿神

    阿神2017-05-16 13:14:30

    1.www user
    2.644, upload directory and runtime directory 744

    reply
    0
  • 阿神

    阿神2017-05-16 13:14:30

    nobody

    reply
    0
  • 迷茫

    迷茫2017-05-16 13:14:30

    I just checked and found that php-fpm is run by the http user like nginx...and the master process is all root, which is so unsafe...but it seems very troublesome to repair. I still have a bunch of nobody that I haven’t fixed yet...

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 13:14:30

    Ubuntu is under www-data,lnmp装的是www
    In short, you cannot use root to run. If you use root to run, php can operate the operating system-related files.

    reply
    0
  • Cancelreply