2

我认为最好使用子用户来安装 NGiNX。这是真的吗?我正在考虑使用 NGiNX 来安装我的客户可以用于那里的网站的虚拟主机,我不希望他们对 NGiNX 有太多的控制权......

我正在使用 Ubuntu Linux 发行版。

提前感谢任何帮助和/或提示。

4

2 回答 2

3

How are you planning to install these applications? Since you say you're using Ubuntu, then I would assume that you'll be installing apps via either the graphical manager or by apt-get or aptitude.

If you're using the graphical program manager, then it should prompt you for your password; this performs a sudo under the hood.

If you're using either apt-get or aptitude or something similar, those programs need to be run as root to install.

In both instances above, the installation scripts for the packages will (should) handle any user-related issues that are necessary for the program you're installing to function properly. For example, when I did an apt-get install jenkins, the installation scripts automatically created a jenkins user for me, and my Jenkins CI server runs as the jenkins user automatically.

Of course, if you're compiling all of these programs by hand, all bets are off and you'll need to figure out how best to do all of this yourself. Of course, if you're compiling these programs by hand to get them installed, I'd have to question why you're using Ubuntu in the first place; one of the best parts to using a Linux distribution with sane package management capabilities is actually USING said package management! (Note: by this statement, I mean anything Debian-based for sure; and I understand that Red Hat's yum provides very similar capabilities, but I haven't used anything RedHat since around 2003.)

于 2011-11-09T22:15:07.273 回答
2

您不希望进程拥有比它需要的更多的访问权限。所以,是的,您应该使用除 root 之外的用户——具有读取所需文件所需的最低权限的用户。通常这涉及专门为该任务创建一个新的 nginx(或 www 或类似的)用户。

于 2011-11-09T19:12:00.420 回答