最近我安装了Nginx并想改变根目录,但是我不知道/var/www和/srv/www之间有什么区别,什么时候应该使用/var/www或/srv/www ?
所不同的是:不同的文件结构。 不同的服务器实现稍微不同的文件结
下面是描述Linux中常用文件结构的一个很好的链接: Linux目录结构(文件系统结构)用例子说明
由此:
/ var – variables文件
- var stands for variable files. - Content of the files that are expected to grow can be found under this directory. - This includes — system log files (/var/log); packages and database files (/var/lib); emails (/var/mail); print queues (/var/spool); lock files (/var/lock); temp files needed across reboots (/var/tmp);/ srv – 服务数据
- srv stands for service. - Contains server specific services related data. - For example, /srv/cvs contains CVS related data.
基于此, /srv似乎更合适。 但是,Linux的Ubuntu风格例如通常不使用/srv文件结构,而是使用www的var目录。 所以我认为关键是与您使用的操作系统保持一致。