国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > Linux > 正文

關(guān)于linux下/srv、/var和/tmp的職責(zé)區(qū)分

2024-06-28 16:03:59
字體:
供稿:網(wǎng)友

/srv :主要用來存儲本機(jī)或本服務(wù)器提供的服務(wù)或數(shù)據(jù)。(用戶主動生產(chǎn)、對外提供服務(wù))

/srv contains site-specific data which is served by this system.

/var :系統(tǒng)產(chǎn)生的不可自動銷毀的緩存文件、日志記錄。(系統(tǒng)和程序運行后產(chǎn)生、只能用戶手動清理)(包括mail、數(shù)據(jù)庫文件、日志文件)

/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 :保存在使用完畢后可隨時銷毀的緩存文件。(有可能是由系統(tǒng)或程序產(chǎn)生、也有可能是用戶主動放入、系統(tǒng)會自動清理)

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.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

所以,服務(wù)器被用作Web開發(fā)時,html文件更應(yīng)該被放在/srv/www下,而不是/var/www下(因為/srv目錄是新標(biāo)準(zhǔn)中才出現(xiàn)的,而且Apache將其設(shè)為了web默認(rèn)目錄,所以現(xiàn)在絕大多數(shù)人都把web文件放在這里)。

如ftp、流媒體服務(wù)等也應(yīng)該被放在/srv對應(yīng)的目錄下。如果對應(yīng)目錄太大,應(yīng)該另外掛載分區(qū)。


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 井冈山市| 延安市| 原阳县| 新丰县| 云浮市| 宁城县| 海阳市| 九龙坡区| 乐东| 西平县| 伊春市| 博白县| 天门市| 镇江市| 泰安市| 墨脱县| 苗栗市| 梁平县| 乐至县| 西平县| 兴安盟| 阳曲县| 厦门市| 西乌| 庆安县| 宜州市| 南城县| 松桃| 九江县| 织金县| 惠东县| 邵东县| 库车县| 响水县| 长泰县| 双城市| 永清县| 海淀区| 广州市| 绥滨县| 南江县|