关于linux下/srv、/var和/tmp的职责区分
来源:互联网 发布:java 7zip 解压缩 编辑:程序博客网 时间:2024/04/29 15:02
/srv :主要用来存储本机或本服务器提供的服务或数据。(用户主动生产、对外提供服务)
/srv contains site-specific data which is served by this system.
/var :系统产生的不可自动销毁的缓存文件、日志记录。(系统和程序运行后产生、只能用户手动清理)(包括mail、数据库文件、日志文件)
/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.
If /var cannot be made a separate partition, it is often preferable to move /var out of the root partition and into the /usr partition. (This is sometimes done to reduce the size of the root partition or when space runs low in the root partition.) However, /var must not be linked to /usr because this makes separation of /usr and /var more difficult and is likely to create a naming conflict. Instead, link /var to /usr/var.
Applications must generally not add directories to the top level of /var. Such directories should only be added if they have some system-wide implication, and in consultation with the FHS mailing list.
/tmp :保存在使用完毕后可随时销毁的缓存文件。(有可能是由系统或程序产生、也有可能是用户主动放入、系统会自动清理)
The /tmp directory must be made available for programs that require temporary files.
Programs must not assume that any files or directories in /tmp are preserved between invocations of the program.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
所以,服务器被用作Web开发时,html文件更应该被放在/srv/www下,而不是/var/www下(因为/srv目录是新标准中才出现的,而且Apache将其设为了web默认目录,所以现在绝大多数人都把web文件放在这里)。
如ftp、流媒体服务等也应该被放在/srv对应的目录下。如果对应目录太大,应该另外挂载分区。
- 关于linux下/srv、/var和/tmp的职责区分
- 关于linux下tmp文件夹
- Linux下的重要目录/proc, /sys, /SElinux, /bin, /usr/lib, /usr/local, /var, /tmp .....
- Linux下的一些重要目录/proc, /sys, /SElinux, /bin, /usr/lib, /usr/local, /var, /tmp/etc
- /tmp/.oracle 和/var/tmp/.oracle文件的四篇经典文章
- magento的var目录内容跑到/tmp/magento/var下解决
- ROS的msg和srv
- /var/tmp/.oracle 和 oracle listener (监听)的一点理解
- Linux下/usr和/var目录详解
- linux和windows下不区分大小写的字符串比较
- Linux系统下/tmp目录下的临时文件怎么清理?
- Linux系统下/tmp目录下的临时文件清理
- 注册SRV纪录的过程和命令
- 创建ROS的msg和srv
- 关于Linux系统清理/tmp/文件夹,你可能想知道的
- 关于Linux系统中/tmp目录的清除问题
- 关于Linux系统清理/tmp/文件夹,你可能想知道的
- 关于Linux系统清理/tmp/文件夹的原理
- 金融类8583报文解析器
- 设计模式之——单例模式(一)
- iOS OC uibutton添加背景图片后看不到
- Oracle中connect by...start with...的使用【转】
- Your project path contains non-ASCII characters. This will most likely cause the build to fail on
- 关于linux下/srv、/var和/tmp的职责区分
- Reac Native(一)windows环境搭建
- 八皇后
- html页面滚动效果之marquee标签详解
- Eclipse出现异常,强制关闭后,无法打开闪退
- RxJava的使用与深入学习
- HNOI2012 矿场搭建
- angular学习(十一)—— Form
- 00 vim 简明教程