如何在Apache2中将所有无法识别的文件types设置为二进制文件?

我正在build立一个分布各种二进制文件的Web服务器。 (与Ubuntu)他们有不同的扩展,有时有错误的扩展。 但是目前,我的Apache服务器以文本forms提供未知的文件。 所以我必须使我的Apache2默认情况下将所有文件都作为二进制文件提供,无论扩展名或任何元数据,除了一些明确的情况。 我怎样才能存档这个?

尝试在您的网站configuration这个指令:

DefaultType application/octet-stream 

或者这个:

 DefaultType None 

默认情况下似乎是文本/纯文本:

 DefaultType Directive Description: MIME content-type that will be sent if the server cannot determine a type in any other way Syntax: DefaultType MIME-type|none Default: DefaultType text/plain Context: server config, virtual host, directory, .htaccess 

http://httpd.apache.org/docs/2.2/mod/core.html#defaulttype