apache主配置文件翻译

主配置文件

Do NOT simply read the instructions in here without understanding what they do.  They're here only as
 hints or reminders.  If you are unsure consult the online docs. You have been warned.
不要简单地阅读这里的说明而不理解他们的工作。 他们只是作为提示或提醒。
如果您不确定,请查阅在线文档。 你被警告了。
##################################################################
Configuration and logfile names: If the filenames you specify for many of the server's control files 
begin with "/" , the server will use that explicit path.  If the filenames do *not* begin with "/",
 the value of ServerRoot is prepended -- so 'log/access_log' with ServerRoot set to '/www' will be 
interpreted as '/log/access_log'.
#配置和日志文件名称:如果您为服务器设定配置文件时,若指定的文件名以“/”开头,则服务器将使用该绝对路径。 如果文件名不是以“/”
开头,则以ServerRoot预先设置的值为相对路径, 如ServerRoot设置为'/www',日志配置文件设置为'log / access_log',#
日志服务将被解释为'/ www / log / access_log'。
###################################################################
ServerRoot: The top of the directory tree under which the server's configuration, error, and log files are kept.
#ServerRoot:保存服务器的配置,错误和日志文件的目录树顶部。#
###################################################################
Listen: Allows you to bind Apache to specific IP addresses and/or ports, instead of the default. 
See also the <VirtualHost> directive.
Change this to Listen on specific IP addresses as shown below to prevent Apache from glomming 
onto all bound IP addresses.
Listen:允许您将Apache绑定到特定的IP地址和/或端口,而不是默认值。 另请参阅<VirtualHost>指令。
若改变监听IP地址和端口,如下所示进行IP地址和端口的捆绑
####################################################################
Dynamic Shared Object (DSO) Support
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.
Example:
LoadModule foo_module modules/mod_foo.so
动态模块加载的支持
#为开启DSO动态构建模块支持,在使用模块包含的指令之前,先将模块加载到'LoadModule'的这一行#
举例如下:
LoadModule foo_module modules/mod_foo.so
###################################################################
If you wish httpd to run as a different user or group, you must run httpd as root initially and it will switch.
User/Group: The name (or #number) of the user/group to run httpd as. It is usually good practice to create a 
dedicated user and group for running httpd, as with most system services.
如果你希望不同的用户和用户组运行,你必须以root用户初始化启动,它将自动切换。
用户和用户组:运行httpd的用户和用户组,最好是像大多数系统服务一样,创建一个专门用于运行httpd的用户和组。
####################################################################
'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 <VirtualHost> definition.  These values also provide
defaults for any <VirtualHost> containers you may define later in the file. All of these 
will be overridden for the virtual host being defined.
主配置文件
在这个部分中,所有指令仅对没有在<VirtualHost>配置中设置的做出相应和进行数据处理,
#如果在<VirtualHost>中已配置,主配置文件中的将被<VirtualHost>中的配置指令覆盖#
###################################################################
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:您的地址,其中服务器问题应通过电子邮件发送。 此地址出现在某些服务器生成的页面上,例如错误文档。 例如admin@your-domain.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.
If your host doesn't have a registered DNS name, enter its IP address here.
ServerName 有server的名字和端口给定的,为的是标识服务器自己,通常情况下它会自己确定,但是为了防止在启动过程中
出现问题,最好自己设定,如果你没有注册到DNS服务器上,最好输入服务器的IP地址
###################################################################
Deny access to the entirety of your server's filesystem. You must explicitly permit access
to web content directories in other <Directory> blocks below.
#默认情况下拒绝访问进入服务器的文件系统#,你必须在<Directory>中明确知道可以访问哪些web目录
####################################################################
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.
请注意,从这一点开始,您必须特别允许启用特定功能 - 因此,如果某些功能不像您期望的那样正常工作,请确保您已在下面专门启用了它。
####################################################################
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:您将为其提供文档的目录。 默认情况下,所有请求都来自此目录,但可以使用符号链接和别名来指向其他位置。
####################################################################
Relax access to content within /var/www.
放开对目录/var/www的访问控制
<Directory "/var/www">
AllowOverride None  #忽略.htaccess配置文件
Require all granted #无条件的访问,就是不限制的访问
</Directory>
####################################################################
# Further relax access to the default document root:
<Directory "/var/www/html">
Possible values for the Options directive are "None", "All",or any combination of: 
Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
Note that "MultiViews" must be named *explicitly* --- "Options All"
doesn't give it to you.
The Options directive is both complicated and important.  Please see http://httpd.apache.org
/docs/2.4/mod/core.html#options for more information.
option指令可能是None、All或者如下的任意组合:Indexes、FollowSymLinks、SymLinksifOwnerMatch、ExecCGI、MultiViews.
注意:MultiViews必须要明确的命名,`Option All`并不会给你,Option指令即复杂又重要,因此也不会给你
##################################################################
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文件中放置哪些指令。 它可以是“全部”,“无”或关键字的任意组合:选项FileInfo AuthConfig限制##
AllowOverride None
Controls who can get stuff from this server.
Require all granted
</Directory>
控制谁可以访问此服务器的资源内容
#说明访问控制可以基于文件、目录和url
####################################################################
DirectoryIndex: sets the file that Apache will serve if a directory is requested.
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>
当访问目录时,需配置提供目录的默认资源,默认情况下通常为index.html文件
####################################################################
The following lines prevent .htaccess and .htpasswd files from being viewed by Web clients.
<Files ".ht*">
    Require all denied
</Files>
下面是保护.htaccess和.htpasswd文件被客户访问
####################################################################
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 "logs/error_log"
ErrorLog:错误日志文件的位置。 如果您不指定ErrorLog指令在<VirtualHost>容器中,与该虚拟主机相关的错误消
息将会是记录在这里。 如果您为* VirtualHost容器定义错误日志文件,该主机的错误将记录在那里,而不是在这里。
####################################################################
LogLevel: Control the number of messages logged to the error_log. Possible values include: 
debug, info, notice, warn, error, crit,alert, emerg.
LogLevel warn
错误日志级别:控制错误日志的数量输入到日志文件中的值通常由如下:debug、info、notice、warn、error、crit、
alert和emerg,默认情况下日志级别为warn
####################################################################
<IfModule log_config_module>
The following directives define some format nicknames for use with a CustomLog directive (see below).
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
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
</IfModule>
The location and format of the access logfile (Common Logfile Format).If you 
do not define any access logfiles within a <VirtualHost>container, they will be logged here.
 Contrariwise, if you *do* define per-<VirtualHost> access logfiles, transactions will be 
logfile with access, agent, and referer information (Combined Logfile Format) you can use the following directive.
CustomLog "logs/access_log" combined
</IfModule>
访问日志文件的位置和格式(通用日志文件格式)。如果您没有在<VirtualHost>容器中定义任何访问日志文件,它们将在此
处记录。相反,如果您执行定义每个<VirtualHost>访问日志文件 ,事务将是具有访问,代理和引用者信息(组合日志文
件格式)的日志文件,您可以使用以下指令。
####################################################################
<IfModule alias_module>
Redirect: Allows you to tell clients about documents that used to exist in your server's 
namespace, but do not anymore. The client will make a new request for the document at 
its new location.
重定向:允许您告诉客户有关您的服务器名称空间中存在的文档,但现在不再存在。 客户将在新的位置对文档发出新的请求。
Example:
Redirect permanent /foo http://www.example.com/bar
Alias: Maps web paths into filesystem paths and is used to access content that does not 
live under the DocumentRoot.
别名:将网络路径映射到文件系统路径,并用于访问不在DocumentRoot下的内容
Example:
Alias /webpath /full/filesystem/path
If you include a trailing / on /webpath then the server will require it to be present in the URL.
You will also likely need to provide a <Directory> section to allow access to the filesystem path.
ScriptAlias: This controls which directories contain server scripts.ScriptAliases are 
essentially the same as Aliases, except that documents in the target directory are treated as 
applications and run by the server when requested rather than as documents sent to the client.
The same rules about trailing "/" apply to ScriptAlias directives as to Alias.
如果包含尾随/在/ webpath,那么服务器将要求它存在于URL中。您还可能需要提供<Directory>部分以允许访问文件系统路径.
ScriptAlias:它控制哪些目录包含服务器 脚本。除了目标目录中的文档被视为应用程序并在请求时由服务器运行而不是
作为发送到客户端的文档运行时,ScriptAliases基本上与Aliases相同。关于结尾“/”的相同规则适用于ScriptAlias指令,到别名。
####################################################################
Customizable error responses come in three flavors:1) plain text 2) local redirects 3) external redirects
Some examples:
ErrorDocument 500 "The server made a boo boo."
ErrorDocument 404 /missing.html
ErrorDocument 404 "/cgi-bin/missing_handler.pl"
ErrorDocument 402 http://www.example.com/subscription_info.html
EnableMMAP and EnableSendfile: On systems that support it,memory-mapping or the sendfile syscall 
may be used to deliver files.  This usually improves server performance, but must be turned
 off when serving from networked-mounted filesystems or if support for these functions is otherwise 
可定制的错误响应有三种形式:1)纯文本2)本地重定向3)外部重定向
一些例子:
错误的页面位置:
ErrorDocument 500“服务器发出嘘声。”
ErrorDocument 404 /missing.html
ErrorDocument 404“/cgi-bin/missing_handler.pl”
ErrorDocument 402 http://www.example.com/subscription_info.html
EnableMMAP和EnableSendfile:在支持它的系统上,可以使用内存映射或sendfile系统调用来传递文件。 这通常会提高服
务器的性能,但在从联网的文件系统提供服务时必须关闭,或者系统上的其他功能支持受到破坏。如果发表评论,则默认设置为:
EnableMMAP On,EnableSendfile Off
####################################################################
Load config files in the "/etc/httpd/conf.d" directory, if any.
IncludeOptional conf.d/*.conf
默认加载配置文件的目录,可以加载任意以.conf结尾的配置文件,
####################################################################
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值