Apache最新官方配置文件中文版
# # Based upon the NCSA server configuration files originally by Rob McCool. #参照NCSA服务器的配置文件,原版由Rob McCool发布 # # This is the main Apache server configuration file. It contains the # configuration directives that give the server its instructions. # See
### Section 1: Global Environment #第一部分全局环境 # # The directives in this section affect the overall operation of Apache, # such as the number of concurrent requests it can handle or where it # can find its configuration files. #本部分的指令将影响整个Apache服务器,例如它所能处理的并发请求数或者它在哪里能够找到其配置文件
# # ServerRoot: The top of the directory tree under which the server's # configuration, error, and log files are kept. # ServerRoot: 服务器的配置,错误和日志文件的根目录 # NOTE! If you intend to place this on an NFS (or otherwise network) # mounted filesystem then please read the LockFile documentation (available # at
# # PidFile: The file in which the server should record its process # identification number when it starts. #PidFile:当服务器起努时,服务器需要将其进程ID号存放在此文件中 PidFile logs/httpd.pid
# # Timeout: The number of seconds before receives and sends time out. #Timeout:接收和发送数据的超时设置,秒数 Timeout 300
# # KeepAlive: Whether or not to allow persistent connections (more than # one request per connection). Set to "Off" to deactivate. #KeepAlive: 是否支持持久联接(而不是每个请求建一个连接),设off关闭此功能 KeepAlive On
# # MaxKeepAliveRequests: The maximum number of requests to allow # during a persistent connection. Set to 0 to allow an unlimited amount. # We recommend you leave this number high, for maximum performance. #MaxKeepAliveRequests:在持久连接期间,所允许的最大请求数量。设为0表示不作限制 建议设为较高的数,以提高性能 MaxKeepAliveRequests 100
# # KeepAliveTimeout: Number of seconds to wait for the next request from the # same client on the same connection. #KeepAliveTimeout:在同一个客户连接中,等待下一个请求的等待时间。 KeepAliveTimeout 15
## ## Server-Pool Size Regulation (MPM specific) ## 常规Server-Pool服务器池的大小(每分钟M数)
# WinNT MPM WinNT 的MPM # ThreadsPerChild: constant number of worker threads in the server process ThreadPerChild:服务器进程中工作的线程数量 # MaxRequestsPerChild: maximum number of requests a server process serves 每个服务进程的最大请求数
# # Listen: Allows you to bind Apache to specific IP addresses and/or # ports, instead of the default. See also the
# # Dynamic Shared Object (DSO) Support #动态共享对象支持DSO # To be able to use the functionality of a module which was built as a DSO you # have to place corresponding `LoadModule' lines at this location so the # directives contained in it are actually available _before_ they are used. # Statically compiled modules (those listed by `httpd -l' do not need # to be loaded here. #为了能够使用模块功能,模块通常以DSO的方式构建,你应该在下面使用LoadModule行,使得能够在使用前获得指令的功能。静态编译模块(在httpd-1中所列举的)不需要在此装载 # Example: # LoadModule foo_module modules/mod_foo.so # LoadModule access_module modules/mod_access.so LoadModule actions_module modules/mod_actions.so LoadModule alias_module modules/mod_alias.so LoadModule asis_module modules/mod_asis.so LoadModule auth_module modules/mod_auth.so #LoadModule auth_anon_module modules/mod_auth_anon.so #LoadModule auth_dbm_module modules/mod_auth_dbm.so #LoadModule auth_digest_module modules/mod_auth_digest.so LoadModule autoindex_module modules/mod_autoindex.so #LoadModule cern_meta_module modules/mod_cern_meta.so LoadModule cgi_module modules/mod_cgi.so #LoadModule dav_module modules/mod_dav.so #LoadModule dav_fs_module modules/mod_dav_fs.so LoadModule dir_module modules/mod_dir.so LoadModule env_module modules/mod_env.so #LoadModule expires_module modules/mod_expires.so #LoadModule file_cache_module modules/mod_file_cache.so #LoadModule headers_module modules/mod_headers.so LoadModule imap_module modules/mod_imap.so LoadModule include_module modules/mod_include.so #LoadModule info_module modules/mod_info.so LoadModule isapi_module modules/mod_isapi.so LoadModule log_config_module modules/mod_log_config.so LoadModule mime_module modules/mod_mime.so #LoadModule mime_magic_module modules/mod_mime_magic.so #LoadModule proxy_module modules/mod_proxy.so #LoadModule proxy_connect_module modules/mod_proxy_connect.so #LoadModule proxy_http_module modules/mod_proxy_http.so #LoadModule proxy_ftp_module modules/mod_proxy_ftp.so LoadModule negotiation_module modules/mod_negotiation.so #LoadModule rewrite_module modules/mod_rewrite.so LoadModule setenvif_module modules/mod_setenvif.so #LoadModule speling_module modules/mod_speling.so #LoadModule status_module modules/mod_status.so #LoadModule unique_id_module modules/mod_unique_id.so LoadModule userdir_module modules/mod_userdir.so #LoadModule usertrack_module modules/mod_usertrack.so #LoadModule vhost_alias_module modules/mod_vhost_alias.so #LoadModule ssl_module modules/mod_ssl.so
# # ExtendedStatus controls whether Apache will generate "full" status # information (ExtendedStatus On) or just basic information (ExtendedStatus # Off) when the "server-status" handler is called. The default is Off. #扩展状态控制Apache是否产生完整的状态信息(设为on产生全部),如果设为Off则产生基本的信息,当与server-status头有关,默认值为Off #ExtendedStatus On
### Section 2: 'Main' server configuration #第二部分:主服务配置 # The directives in this section set up the values used by the 'main' # server, which responds to any requests that aren't handled by a #
# # ServerAdmin: Your address, where problems with the server should be # e-mailed. This address appears on some server-generated pages, such # as error documents. e.g. admin@your-domain.com # ServerAdmin:你的地址,当系统故障时,可以给你发email。此地址出现在那些由服务器生成的页面上,如出错文档。例如:admin@your-domain.com ServerAdmin webmaster@moers.com
# # ServerName gives the name and port that the server uses to identify itself. # This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. #ServerNaem定义了server名称和端口号,用以标明自己的身份。通常可以自动定义,建议显式地定义,避免起动时出错 # If this is not set to valid DNS name for your host, server-generated # redirections will not work. See also the UseCanonicalName directive. #如果没有正确定义主机的DNS,服务器产生的重定向将不会工作,同时参考UseCanonicalName指令。 # If your host doesn't have a registered DNS name, enter its IP address here. # You will have to access it by its address anyway, and this will make # redirections work in a sensible way. #如果你没有注册DNS名字,请在这里输入IP地址。 你可以在任何情况下使用ip地址,这也使用得重定向变得敏感 ServerName www.moers.com:80
# # UseCanonicalName: Determines how Apache constructs self-referencing # URLs and the SERVER_NAME and SERVER_PORT variables. # When set "Off", Apache will use the Hostname and Port supplied # by the client. When set "On", Apache will use the value of the # ServerName directive. #UseCanonicalName:决定Apaceh如何构建自定参考URL,和SERVER_NAME及SERVER_PORT变量 当设为Off时,Apache将使用客户端给出的域名和端口。当设为On时,Apache将使用ServerName指令 UseCanonicalName Off
# # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. #DocumentRoot:服务器文档放置目录。在默认情形下,所有的请求都从这里开始,除了记号和别名将改指它处以外。 DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
# # Each directory to which Apache has access can be configured with respect # to which services and features are allowed and/or disabled in that # directory (and its subdirectories). #每个可供Apache访问的目录,可以配置成允许或禁止哪些服务和特征(包括其子目录) # First, we configure the "default" to be a very restrictive set of # features. #首先,我们定义一个默认的非常严格的配置
# # Note that from this point forward you must specifically allow # particular features to be enabled - so if something's not working as # you might expect, make sure that you have specifically enabled it # below. #注意,从这一点往前,你必须许可某些特殊的功能,所以如果某些功能未能如你所愿,要确保你在在下述中启用了该功能。
# # This should be changed to whatever you set DocumentRoot to. # 这将改变你对DocumentRoot的设置
# # Possible values for the Options directive are "None", "All", # or any combination of: 可能的值为None,All或者任意组合 # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # 索引包括FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. #注意MultiViews被显式地Options All, # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs-2.0/mod/core.html#options # for more information. #选项指令既复杂又重要,请参阅http://httpd.apache.org/docs-2.0/mod/core.html#options了解详情 Options Indexes FollowSymLinks
# # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit #AllowOverride 控制什么指令能够加入到.htaccess中,可以是All,None,或者组合关键字 AllowOverride None
# # Controls who can get stuff from this server. #控制谁可以可以访问此服务 Order allow,deny Allow from all
# # UserDir: The name of the directory that is appended onto a user's home # directory if a ~user request is received. Be especially careful to use # proper, forward slashes here. On Windows NT, "Personal/My Website" # is a more appropriate choice. # UserDir: 用户的home的名称,当接到到~user的请求时。 请小心正确使用”/”. 在WinNT上,”Personal/My Website”是更合适的选择 UserDir "My Documents/My Website"
# # Control access to UserDir directories. The following is an example # for a site where these directories are restricted to read-only. #控制UserDir目录,以下是一个例子,这个目录是只读的 # You must correct the path for the root to match your system's configured # user directory location, e.g. "C:/WinNT/profiles/*/My Documents/My Website" # or whichever, as appropriate. #你必须更正root目录,与系统设置相配,如用户目录是C:/WinNT/profiles/*/My Documents/My Website或者其它合适的 #
# # 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(访问设定和密码)的文件 #
# # 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指令告知模块“内容提示”应到何处找。
# # 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....#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
# # 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
新闻热点
疑难解答