gpt4 book ai didi

nginx - 将项目文件放在 var/www 而不是 nginx/html

转载 作者:行者123 更新时间:2023-12-04 19:34:43 32 4
gpt4 key购买 nike

我看到一些教程,人们将他们的项目文件放在 var/www 下。在 linux 环境中,而不是说 ... nginx 默认目录 usr/share/nginx/html在许多 nginx 相关教程中。

我想知道将您的项目放在那里而不是默认目录是否有一些好处。

最佳答案

我相信为 /usr 列出的用途和 /var FHS 中的层次结构应该可以很好地回答这个问题。

关于 /usr :

/usr is the second major section of the filesystem. /usr is shareable, read-only data. That means that /usr should be shareable between various FHS-compliant hosts and must not be written to. Any information that is host-specific or varies with time is stored elsewhere.



关于 /var :

/var contains variable data files. This includes spool directories and files, administrative and logging data, and transient and temporary files.

Some portions of /var are not shareable between different systems. For instance, /var/log, /var/lock, and /var/run. Other portions may be shared, notably /var/mail, /var/cache/man, /var/cache/fonts, and /var/spool/news.

/var is specified here in order to make it possible to mount /usr read-only. Everything that once went into /usr that is written to during system operation (as opposed to installation and software maintenance) must be in /var.

关于nginx - 将项目文件放在 var/www 而不是 nginx/html,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22767053/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com