/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ū)。
新聞熱點
疑難解答
圖片精選