Apache HTTP最新官方配置(中译版[4]) [5~待续]

类别:网站制作 点击:0 评论:0 推荐:

#        Deny from all

#    </LimitExcept>

#</Directory>

 

#

# DirectoryIndex: sets the file that Apache will serve if a directory

# is requested.

#DirectoryIndex: Apache服务器将要以一个目录的形式响应服务

# The index.html.var file (a type-map) is used to deliver content-

# negotiated documents.  The MultiViews Option can be used for the

# same purpose, but it is much slower.

#index.html变量文件(一种映射)将直接传送内容。MultiViews选项可以用于同样的目的,但是要慢得多

DirectoryIndex index.html index.html.var

 

#

# AccessFileName: The name of the file to look for in each directory

# for additional configuration directives.  See also the AllowOverride

# directive.

#AccessFileName: 用来查找各个目录下额外的配置指令的配置文件名,同时参考AllowOverride(允许重载)指令

#Acce

AccessFileName .htaccess

 

#

# The following lines prevent .htaccess and .htpasswd files from being

# viewed by Web clients.

#下面两行,阻址Web客户端访问 .htaccess和htpasswd(访问设定和密码)的文件

#

<Files ~ "^\.ht">

    Order allow,deny

    Deny from all

</Files>

 

#

# TypesConfig describes where the mime.types file (or equivalent) is

# to be found.

# TypesConfig,描述在何处找到mime型别

TypesConfig conf/mime.types

 

#

# DefaultType is the default MIME type the server will use for a document

# if it cannot otherwise determine one, such as from filename extensions.

如果服务器不能确定文档的型别,将使用默认的MIME型别,例如根据扩展名

# If your server contains mostly text or HTML documents, "text/plain" is

# a good value.  If most of your content is binary, such as applications

# or images, you may want to use "application/octet-stream" instead to

# keep browsers from trying to display binary files as though they are

# text.

#如果你的服务器主要包括text/html文档,”text/plain”就是一个好的取值。如果你的大多数内容是binary(二进制)的,如应用程序或图片,你可能希望使用application/octet-stream,使得浏览器试图显示二进制数据,尽管它们是文本

DefaultType text/plain

 

#

# The mod_mime_magic module allows the server to use various hints from the

# contents of the file itself to determine its type.  The MIMEMagicFile

# directive tells the module where the hint definitions are located.

# mod_mime_magic模块,允许服务器根据内容提示来识别文件型别。MIMEMagicFile指令告知模块“内容提示”应到何处找。

<IfModule mod_mime_magic.c>

    MIMEMagicFile conf/magic

</IfModule>

 

#

# HostnameLookups: Log the names of clients or just their IP addresses

# e.g., www.apache.org (on) or 204.62.129.132 (off).

# The default is off because it'd be overall better for the net if people

# had to knowingly turn this feature on, since enabling it means that

# each client request will result in AT LEAST one lookup request to the

# nameserver.

HostNameLookups: 客户日志或者仅其IP地址,如www.apache.org(on) 或者204.62.129.132

(off).默认为值设为off比较好,如果希望将此置为on将意味着第一次客户请求都至少要查询一次nameserver.

#

HostnameLookups Off

 

#

# EnableMMAP: Control whether memory-mapping is used to deliver

# files (assuming that the underlying OS supports it).

# The default is on; turn this off if you serve from NFS-mounted

# filesystems.  On some systems, turning it off (regardless of

# filesystem) can improve performance; for details, please see

# http://httpd.apache.org/docs-2.0/mod/core.html#enablemmap

# EnableMMAP: 控制是否通过内存映射的方式传送文件(须得操作系统支持)

默认值为on; 如果你使用NSF加载的文件系统(通常在linux下),应置为off. 在某些系统上,置off,不管使用什么文件系统,能够提高效率,详细情况,请参阅文档

#EnableMMAP off

 

#

# EnableSendfile: Control whether the sendfile kernel support is

# used  to deliver files (assuming that the OS supports it).

# The default is on; turn this off if you serve from NFS-mounted

# filesystems.  Please see

# http://httpd.apache.org/docs-2.0/mod/core.html#enablesendfile

# EnableSendfile: 控制内核传送文件是否支持(需要OS支持)。默认为on,如果使用NFS,则使用off

#EnableSendfile off

 

#

# ErrorLog: The location of the error log file.

# If you do not specify an ErrorLog directive within a <VirtualHost>

# container, error messages relating to that virtual host will be

# logged here.  If you *do* define an error logfile for a <VirtualHost>

# container, that host's errors will be logged there and not here.

#ErrorLog: 出错日志文件

如果你想为虚拟主机定义Errorlog指令,则该虚拟主机的错误信息将被记录到这里

ErrorLog logs/error.log

 

#

# LogLevel: Control the number of messages logged to the error.log.

# Possible values include: debug, info, notice, warn, error, crit,

# alert, emerg.

# LogLever: 日志等级,(与log4j相似,译者注),决定哪些级别的出错信息将被记录,如debug,info,notice,warn,error, crit,alert,emerg等,在设定级别以上的信息就会被记录(译者注).

LogLevel warn

 

#

# The following directives define some format nicknames for use with

# a CustomLog directive (see below).

# 日志格式(与log4j相似)

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

LogFormat "%h %l %u %t \"%r\" %>s %b" common

LogFormat "%{Referer}i -> %U" referer

LogFormat "%{User-agent}i" agent

 

# You need to enable mod_logio.c to use %I and %O

#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

本文地址:http://com.8s8s.com/it/it30853.htm