# This is the main Apache HTTP server configuration file. It contains the
這是Apache HTTP Server的主配置檔案。它包括了
# configuration directives that give the server its instructions.
配置指令【directives】,這些指令給伺服器伺服器指令【instructions】【】
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
檢視<URL:http://httpd.apache.org/docs/2.4/>以取得更多資訊
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
特別指出,檢視<URL:http://httpd.apache.org/docs/2.4/mod/directives.html>以得到關於每條配置命令的討論
#
# 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 "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/access_log"
# with ServerRoot set to "/usr/local/apache2" will be interpreted by the
# server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log"
# will be interpreted as '/logs/access_log'.
#
關於配置檔案和日誌檔案的名字:如果你使用了以斜槓“/“開始的指定了多個伺服器控制檔名,那麼伺服器將使用那些絕對路徑。
如 果你沒有以斜槓“/“開始檔名,那麼伺服器根路徑(ServerRoot)就是相對的---所以,像"logs/access_log"這樣的伺服器根 路徑就將被伺服器解釋成加上"/usr/local/apache2"的"/usr/local/apache2/logs/access_log",反 之"/logs/access_log"將被伺服器解釋成"/logs/access_log"
# NOTE: Where filenames are specified, you must use forward slashes
# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").
# If a drive letter is omitted, the drive on which httpd.exe is located
# will be used by default. It is recommended that you always supply
# an explicit drive letter in absolute paths to avoid confusion.
注意:在檔名被指定的地方,你必須用“前斜槓”【就是我們平時說的斜槓"/",與問號在同一個鍵,右手小指下的那個】代替後斜槓【即“反斜槓/】”(如:用"c:/apache"來代替"c:\apache")。
如果你省略了驅動器符號,那麼httpd.exe將使用預設的驅動器。建議你總是在絕對路徑中使用一個明確的驅動器符號,以避免混淆。
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
ServerRoot:目錄樹的頂級根目錄,用來儲存伺服器配置、錯誤、日誌檔案
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to specify a local disk on the
# Mutex directive, if file-based mutexes are used. If you wish to share the
# same ServerRoot for multiple httpd daemons, you will need to change at
# least PidFile.
不要在路徑的最後加斜槓“/“。如果你指定的ServerRoot不是本地磁碟,要確定用互斥指令【Mutex directive】指定一個本地磁碟,如果基於檔案的互斥指令被使用【?】。
如果你希望共享在多個httpd守護程式【daemons】中共享相同的ServerRoot,你至少需要修改PidFile【?】
#【下面這個命令是指定伺服器根目錄】
ServerRoot "c:/Apache24"
#
# Mutex: Allows you to set the mutex mechanism and mutex file directory
# for individual mutexes, or change the global defaults
互斥:允許你為多個不同的互斥物件設定互斥機制【mutex mechanism】和互斥檔案目錄,或者修改全域性預設值
#
# Uncomment and change the directory if mutexes are file-based and the default
# mutex file directory is not on a local disk or is not appropriate for some
# other reason.
如果互斥物件是基於檔案的以及預設的互斥檔案目錄不在本地磁碟或因為其它原因而不適用,那麼取消註釋並改變目錄。
#【下面這個命令是改變互斥物件的目錄】
# Mutex default:logs
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
偵聽:允許你繫結Apache伺服器到指定ip地址和/或埠,用來代替預設值。參見<VirtualHost>指令。
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
修改這個指令以偵聽下面指定的ip地址,避免Apache伺服器抓取全部繫結的IP地址
#【下面這個指令是80埠的IP地址,主網站IP就在這裡配置】
#Listen 12.34.56.78:80
Listen 80
#
# 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.
為了能夠使用一個作為DSO建立的模組【modules】的功能,你需要放置相應的【corresponding】`LoadModule'行在這個位置,這樣在你使用之前,這些指令就包含在模組中了。
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule auth_form_module modules/mod_auth_form.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_core_module modules/mod_authn_core.so
#LoadModule authn_dbd_module modules/mod_authn_dbd.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authn_socache_module modules/mod_authn_socache.so
#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
LoadModule authz_core_module modules/mod_authz_core.so
#LoadModule authz_dbd_module modules/mod_authz_dbd.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
#LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule buffer_module modules/mod_buffer.so
#LoadModule cache_module modules/mod_cache.so
#LoadModule cache_disk_module modules/mod_cache_disk.so
#LoadModule cache_socache_module modules/mod_cache_socache.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule charset_lite_module modules/mod_charset_lite.so
#LoadModule data_module modules/mod_data.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule dav_lock_module modules/mod_dav_lock.so
#LoadModule dbd_module modules/mod_dbd.so
#LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
#LoadModule dumpio_module modules/mod_dumpio.so
LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule ext_filter_module modules/mod_ext_filter.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule filter_module modules/mod_filter.so
#LoadModule headers_module modules/mod_headers.so
#LoadModule heartbeat_module modules/mod_heartbeat.so
#LoadModule heartmonitor_module modules/mod_heartmonitor.so
#LoadModule ident_module modules/mod_ident.so
#LoadModule imagemap_module modules/mod_imagemap.so
LoadModule include_module modules/mod_include.so
#LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
#LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
#LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
#LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
#LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
#LoadModule ldap_module modules/mod_ldap.so
#LoadModule logio_module modules/mod_logio.so
LoadModule log_config_module modules/mod_log_config.so
#LoadModule log_debug_module modules/mod_log_debug.so
#LoadModule log_forensic_module modules/mod_log_forensic.so
#LoadModule lua_module modules/mod_lua.so
#LoadModule macro_module modules/mod_macro.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule negotiation_module modules/mod_negotiation.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_express_module modules/mod_proxy_express.so
#LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule proxy_html_module modules/mod_proxy_html.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
#LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
#LoadModule ratelimit_module modules/mod_ratelimit.so
#LoadModule reflector_module modules/mod_reflector.so
#LoadModule remoteip_module modules/mod_remoteip.so
#LoadModule request_module modules/mod_request.so
#LoadModule reqtimeout_module modules/mod_reqtimeout.so
#LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule sed_module modules/mod_sed.so
#LoadModule session_module modules/mod_session.so
#LoadModule session_cookie_module modules/mod_session_cookie.so
#LoadModule session_crypto_module modules/mod_session_crypto.so
#LoadModule session_dbd_module modules/mod_session_dbd.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
#LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
#LoadModule socache_dbm_module modules/mod_socache_dbm.so
#LoadModule socache_memcache_module modules/mod_socache_memcache.so
#LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
#LoadModule speling_module modules/mod_speling.so
#LoadModule ssl_module modules/mod_ssl.so
#LoadModule status_module modules/mod_status.so
#LoadModule substitute_module modules/mod_substitute.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 version_module modules/mod_version.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
#LoadModule watchdog_module modules/mod_watchdog.so
#LoadModule xml2enc_module modules/mod_xml2enc.so
<IfModule unixd_module>【這裡指的是unix系統嗎?】
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#如果你希望httpd以不同的使用者或組來執行,你必須最初以root執行httpd,它將切換過去【?】
#
# 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.
#User/Group:執行httpd的使用者名稱/組 的名字。對於大多數系統服務來講,為執行httpd建立一個專用使用者和組是一個好的實踐方法。
#
User daemon
Group daemon
</IfModule>
# '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.
#本節的指令集用來設定“main"伺服器所使用的值,伺服器響應任何沒有被<VirtualHost>定義所處理的請求。
#這些值也為任何稍後你可能在下面定義的<VirtualHost>容器【containers】提供預設值。
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#
#所有這些指令可能顯示在<VirtualHost>容器裡面,在這種情況下【case】這些預設設定將被覆蓋【?】
#
# 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
ServerAdmin admin@example.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.
#ServerName提供用於識別它自己的名字和埠。名字和埠通常由伺服器自動定義,但是我們建議你明確地指定它以避免啟動過程中產生問題。
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#如果你的主機沒有註冊DNS名稱,在這裡輸入DNS的IP地址。
#
#ServerName www.example.com:80
#
# 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內容目錄
#
<Directory />
AllowOverride none
Require all denied
</Directory>
###################################################################
#
# 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:你要使用【serve】的文件的目錄。預設為所有請求都從這個目錄獲取,但是可以使用符號連線【symbolic link】和別名指定其它位置。
#【下面這個指令指定文件目錄,也就是網站的根目錄】
DocumentRoot "c:/Apache24/htdocs"
<Directory "c:/Apache24/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#可能的設定指令值是“None”,“All”,或者以下任意組合:
#Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#注意那個"MultiViews"必須準確命名-----“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.
#選項指令複雜且重要。請參閱http://httpd.apache.org/docs/2.4/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:
# AllowOverride FileInfo AuthConfig Limit
# AllowOverride控制的指令可能包含在.htaccess檔案中。它可以是“all”、“None”、或以下關鍵字的任意組合:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#下面的指令控制誰能從這臺伺服器上獲取東西
#
Require all granted
</Directory>
###################################################################
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
# DirectoryIndex:設定當Apache服務得到一個目錄請求的時候訪問的檔案【即預設首頁】
#
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#下面的行禁止.htaccess和.htpasswd檔案被web客戶端檢視【禁止從瀏覽器訪問.htaccess和.htpasswd檔案】
#
<Files ".ht*">
Require all denied
</Files>
#
# 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:錯誤日誌檔案的位置。如果你沒有在<VirtualHost>容器中指定一個ErrorLog指令,與那個虛擬主機相關的錯誤消失將記錄在這裡。如果你確實為一個<VirtualHost>容器定義了錯誤訊息檔案,那麼主機的錯誤日誌將被記錄在那裡而不是這裡。
#
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.
#LogLEvel:日誌級別,控制記錄到錯誤日誌檔案中的訊息的數量。可能包括的值有:debug、info、notice、warn、error、crit
#
LogLevel 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 你需要使mod_logio.c可用以使用 %I和%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
# logged therein and *not* in this file.
#
#訪問日誌檔案的位置和格式。如果你沒有定義任何<VirtualHost>容器訪問日誌檔案,它們將記錄在這裡。反之,如果你確定定義了全部<VirtualHost>訪問日誌檔案,事務【transactions】將把日誌記錄在那裡而非這裡的檔案。
CustomLog "logs/access.log" common
#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#如果你指定一個日誌檔案的訪問、代理和參考資訊(包含日誌格式)你可以使用下面的指令。
#
#CustomLog "logs/access.log" combined
</IfModule>
<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.
#Redirect:允許你通知客戶端以前存在於伺服器名字空間的文件,現在已經不存在了。客戶端將傳送一個新請求以獲得新的文件位置。
# 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.
# Alias:別名,對映網路路徑到檔案系統路徑並被且用於訪問不存在於網站根目錄的內容。
# 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.
#如果你包含了 trainng/on/webpath 那麼伺服器將獲取它並呈現在URL中。【?】
#
# 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.
#ScriptAlias:指令碼別名,它控制著那些包含伺服器指令碼的目錄。“指令碼別名”本質上與“別名”是相同的,除非目標目錄中的文件被當作應用程式對待並且當被請求時由伺服器執行而不是當作文件被髮送到客戶端。【當目標目錄中的文件是應用程式,客戶端有請求時被伺服器執行,而不是以文件形式被髮送到客戶端,只有這個時候指令碼別名與別名是不同的】【?】。以斜槓“/”結尾這個規則對於ScriptAlias和Alias指令是相同的。
#
ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/"
</IfModule>
<IfModule cgid_module>
#
# ScriptSock: On threaded servers, designate the path to the UNIX socket used to communicate with the CGI daemon of mod_cgid.
# ScriptSock:線上程伺服器上,指定指向UNIX socket的路徑被用於【經常?】與mod_cgid這個CGI守護程式通訊。
#
#Scriptsock cgisock
</IfModule>
#
# "c:/Apache24/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#如果你配置了指令碼別名指定的CGI目錄並且它是存在的,那麼"c:/Apache24/cgi-bin"這個目錄應該改為那個目錄。
#
<Directory "c:/Apache24/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
<IfModule mime_module>
#
# TypesConfig points to the file containing the list of mappings from filename extension to MIME-type.
# TypesConfig指向一個檔案,這個檔案包含一個從副檔名到mime-type的對映列表【TypesConfig指向一個檔案,這個檔案包含一個副檔名與mime-type的對映列表】
#
TypesConfig conf/mime.types
#
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
# AddType允許你為特殊的檔案型別新增或覆蓋在TypesConfig中規定的mime配置檔案
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers uncompress information on the fly. Note: Not all browsers support this.
# AddEncoding允許你有特定的瀏覽器解壓縮資訊的自適應能力。注意:並非所有瀏覽器都支援。
#
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#如果上面的AddEncoding指令被註釋,那麼你可能應該定義那些副檔名以指出媒體型別。
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
# AddHandler允許你對映特定副檔名到"handlers":動作與檔案型別無關。這也可以內建於伺服器或者與動作指令【Action directive】一起新增(看下面)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#為了在指令碼別名指定的目錄外使用CGI指令碼:(你也需要新增"ExecCGI"到"Options"指令)
#AddHandler cgi-script .cgi
# For type maps (negotiated resources):為了型別對映(協議資源)【?】
#AddHandler type-map var
#
# Filters allow you to process content before it is sent to the client.
# Filters允許你在內容被髮送到客戶端之前處理它。
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#為“伺服器端包含”分析.shtml檔案:(你也需要新增“includes”到"Options"指令)
#AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml
</IfModule>
#
# 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 conf/magic
#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#可定製的錯誤響應支援三種方式:1)明文 2)本地重定向 3)外部重定向
# 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
#
#
# MaxRanges: Maximum number of Ranges in a request before
# returning the entire resource, or one of the special
# values 'default', 'none' or 'unlimited'.
# Default setting is to accept 200 Ranges.
# MaxRanges:定義了在一個請求返回全部資源之前Ranges的最大數字,或者在'default', 'none' or 'unlimited'三個值中指定的一個值。
#MaxRanges unlimited
#
# 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 broken on your system.
# Defaults: EnableMMAP On, EnableSendfile Off
# EnableMMAP and EnableSendfile:在支援它的系統上,記憶體對映或“傳送檔案系統呼叫”可被用於分發檔案。這通常能提高伺服器效能,但是當服務來自“網路設定的檔案系統”【?】時它必須被關閉。或者在你的系統上對於這些功能的支援因為其它原因被破壞。【?】
#EnableMMAP off
#EnableSendfile on
# Supplemental configuration
#補充配置
#
# The configuration files in the conf/extra/ directory can be
# included to add extra features or to modify the default configuration of
# the server, or you may simply copy their contents here and change as
# necessary.
# conf/extra/ directory目錄中的配置檔案可以被包含以新增擴充套件功能或修改伺服器的預設配置,或者必要時你可以在這裡只是複製它們的內容
# Server-pool management (MPM specific)
#伺服器池管理
#Include conf/extra/httpd-mpm.conf
# Multi-language error messages 多語言錯誤訊息
#Include conf/extra/httpd-multilang-errordoc.conf
# Fancy directory listings動態目錄列表形式配置
#Include conf/extra/httpd-autoindex.conf
# Language settings 語言設定
#Include conf/extra/httpd-languages.conf
# User home directories 使用者家庭目錄
#Include conf/extra/httpd-userdir.conf
# Real-time info on requests and configuration 請求和配置上的實時資訊
#Include conf/extra/httpd-info.conf
# Virtual hosts 虛擬主機
#Include conf/extra/httpd-vhosts.conf
# Local access to the Apache HTTP Server Manual 本地訪問Apache Http Server手冊。
#Include conf/extra/httpd-manual.conf
# Distributed authoring and versioning (WebDAV) 分散式創作和版本控制
#Include conf/extra/httpd-dav.conf
# Various default settings 多種類預設設定
#Include conf/extra/httpd-default.conf
# Configure mod_proxy_html to understand HTML4/XHTML1 配置mod_proxy_html,使它支援HTML4/XHTML1
<IfModule proxy_html_module>
Include conf/extra/proxy-html.conf
</IfModule>
# Secure (SSL/TLS) connections安全連線
#Include conf/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random equivalent
# but a statically compiled-in mod_ssl.
#注意:
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
#
# uncomment out the below to deal with user agents that deliberately
# violate open standards by misusing DNT (DNT *must* be a specific
# end-user choice)
#
#<IfModule setenvif_module>
#BrowserMatch "MSIE 10.0;" bad_DNT
#</IfModule>
#<IfModule headers_module>
#RequestHeader unset DNT env=bad_DNT
#</IfModule>