#
# Apache服务器主配置文件. 包括服务器指令的目录设置.
# 详见 <URL:
http://www.apache.org/docs/>
#
# 请在理解用途的基础上阅读各指令。
#
# 再读取此文档后,服务器将继续搜索运行
# E:/Program Files/Apache Group/Apache/conf/srm.conf
# E:/Program Files/Apache Group/Apache/conf/access.conf
# 除非用ResourceConfig或AccessConfig覆盖这儿的标识
#
# 配置标识由三个基本部分组成:
# 1. 做为一个总体来控制Apache服务器进程的标识 (the 'global environment').
# 2. 用于定义主(默认)服务器参数的标识。
# 响应虚拟主机不能处理的请求。
# 同时也提供全部虚拟主机的设置值。
# 3. 虚拟主机的设置。在一个Apache服务器进程中配置不一样的IP地址和主机名。
#
# 配置和日志文件名:指定服务器控制文件命名时,
# 以 "/" (或 "drive:/" for Win32)开始,服务器将使用这些绝对路径。
# 若是文件名不是以"/"开始的,预先考虑服务器根目录--
# 所以 "logs/foo.log",若是服务器根目录是"/usr/local/apache",
# 服务器将解释为 "/usr/local/apache/logs/foo.log".
#
# 注: 指定的文件名须要用"/"代替"\"。
# (例, "c:/apache" 代替 "c:\apache").
# 若是省略了驱动器名,默认使用Apache.exe所在的驱动器盘符
# 建议指定盘符,以避免混乱。
#
### 部分 1: 全局环境
#
# 本部分的表示将影响全部Apache的操做
# 例如,所能处理的并发请求数或配置文件地址
#
#
# ServerType 可取值 inetd 或 standalone. Inetd 只适用于Unix平台
#
ServerType standalone
#
# ServerRoot: 目录树的根结点。服务器配置、出错信息、日志文件都保存在根目录下。
#
# 不要再目录末尾加"/"
#
ServerRoot "C:/Program Files/Apache Group/Apache"
#
# PidFile: 服务器用于记录启动时进程ID的文件。
#
PidFile logs/httpd.pid
#
# ScoreBoardFile: 用于保存内部服务器进程信息的文件。
# 并不是必须。 可是若是指定了(此文件当运行Apache时生成)
# 那么必须确保没有两个Apache进程共享同一个scoreboard文件。
#
ScoreBoardFile logs/apache_runtime_status
#
# 在标准配置下,服务器将顺序读取 httpd.conf(此文件可经过命令行中-f参数指定),
# srm.conf 和 access.conf。
# 目先后两个文件是空的。为了简单起见,建议将全部的标识放在一个文件中。
# 如下两条注释的标识,是默认设置。
# 要让服务器忽略这些文件能够用 "/dev/null" (for Unix)
# 或"nul" (for Win32) 做为参数。
#
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf
#
# Timeout: 接受和发送timeout的时间
#
Timeout 300
#
# KeepAlive: 是否容许保持链接(每一个链接有多个请求)
# "Off" -无效
#
KeepAlive On
#
# MaxKeepAliveRequests: 每一个链接的最大请求数。
# 设置为0表示无限制
# 建议设置较高的值,以得到最好的性能。
#
MaxKeepAliveRequests 100
#
# KeepAliveTimeout: 同一链接同一客户端两个请求之间的等待时间。
#
KeepAliveTimeout 15
#
# 在Win32下,Apache每次产生一个子进程来处理请求。
# 若是这个进程死了,会自动产生另外一个子进程。
# 全部的进入请求在子进程中多线程处理。
# 如下两个标识控制进程的运行
#
#
# MaxRequestsPerChild: 每一个子进程死亡以前最大请求数
# 若是超过这个请求数,子程序会自动退出,避免延期使用致使内存溢出或其余问题。
# 大部分系统,并不须要此设置,
# 可是部分,象Solaris,确实值得注意。
# 对Win32, 可设置为0 (无限制)
# 除非有另外的考虑。
#
# 注: 此值不包括在每一个链接初始化请求后,"keptalive"请求
# 例如, 若是一个子进程处理一个初始化请求和10个后续"keptalive"请求,
# 在这个限制下,只会记为一个请求。
#
MaxRequestsPerChild 0
#
# ThreadsPerChild: 服务器所容许的并发线程数。
# 此值的设置取决于服务器的响应能力(约多的请求在同一时间激活,则每一个请求的处理时间越慢)
# 和服务器所容许消耗的系统资源。
#
ThreadsPerChild 50
#
# Listen: 容许将Apache绑顶到指定的IP地址和端口,做为默认值的辅助选项。
# 参见 <VirtualHost>
#
#Listen 3000
#Listen 12.34.56.78:80
#
# BindAddress: 经过此选项可支持虚拟主机。
# 此标识用于告诉服务器监听哪一个IP地址。
# 包括:"*", IP地址, 或域名.
# 参见 <VirtualHost> 和 Listen directives.
#
BindAddress 166.111.178.144
#
# Apache模块编译成标准的Windows结构。
#
# 如下模块绑定到标准的Apache二进制windows分布。
# 要修改标准操做,取消如下行的注释而且修改指定模块列表。
#
# 警告:这是高级选项。可能致使服务器崩溃。
# 没有专家的指导,不要轻易修改。
#
#ClearModuleList
#AddModule mod_so.c mod_mime.c mod_access.c mod_auth.c mod_negotiation.c
#AddModule mod_include.c mod_autoindex.c mod_dir.c mod_cgi.c mod_userdir.c
#AddModule mod_alias.c mod_env.c mod_log_config.c mod_asis.c mod_imap.c
#AddModule mod_actions.c mod_setenvif.c mod_isapi.c
#
# 动态共享对象(Dynamic Shared Object,DSO)
#
# 要使用基于DSO的功能模块,须要替换此处相应的
# `LoadModule' 行。这样在使用以前这些包含的标识都将生效。
# 有关DSO及至的详细资料请看Apache1.3版中的README.DSOSO。
# 运行"apche -l"将列表显示Apache内奸的模块(相似标准的链接已经生效)
#
# 注:模块载入的顺序很重要。没有专家的建议,不要修改如下的顺序。
#
#LoadModule anon_auth_module modules/ApacheModuleAuthAnon.dll
#LoadModule dbm_auth_module modules/ApacheModuleAuthDBM.dll
#LoadModule digest_auth_module modules/ApacheModuleAuthDigest.dll
#LoadModule cern_meta_module modules/ApacheModuleCERNMeta.dll
#LoadModule digest_module modules/ApacheModuleDigest.dll
#LoadModule expires_module modules/ApacheModuleExpires.dll
#LoadModule headers_module modules/ApacheModuleHeaders.dll
#LoadModule proxy_module modules/ApacheModuleProxy.dll
#LoadModule rewrite_module modules/ApacheModuleRewrite.dll
#LoadModule speling_module modules/ApacheModuleSpeling.dll
#LoadModule info_module modules/ApacheModuleInfo.dll
#LoadModule status_module modules/ApacheModuleStatus.dll
#LoadModule usertrack_module modules/ApacheModuleUserTrack.dll
#
# ExtendedStatus 在服务器状态句柄被呼叫时控制是产生“完整”的状态信息(ExtendedStatus On)
# 仍是仅返回基本信息(ExtendedStatus Off)
# 默认是:Off
#
#ExtendedStatus On
### 部分 2: 主服务器配置
#
# 此部分的标识用于主服务器全部的设置值,
# 响应任何<VirtualHost>定义不处理的请求
# 这些值同时给你稍后在此文件中定义的<VirtualHost>提供默认值。
#
# 全部的标识可能会在<VirtualHost>中出现。
# 对应的默认值会被虚拟主机从新定义覆盖。
#
#
# Port: Standalone服务器监听的端口。
# 在Apache可以监听指定端口前,须要在防火墙中进行设置。
# 其它运行httpd的服务器也可能影响此端口。 Disable
# 若是遇到问题,请关闭全部的防火墙、安全保护和其余的服务。
# Windos NT的"NETSTAT -a"指令会有助于问题的分析。
#
Port 80
#
# ServerAdmin: 你的地址。若是服务器有任何问题将发信到这个地址。
# 这个地址会在服务器产生的某些页面中出现,例如,错误报告。
#
ServerAdmin
chenyl98@mails.tsinghua.edu.cn
#
# ServerName 容许设置主机名。若是与程序得到的不一样,主机名将返回客户端。
# (例如,用"www"代替主机真实的名字)
#
# 注: 主机名不能随便指定。必须是你的机器有效的DNS名称。不然没法正常工做。
# 若是不能理解,倾向你的网络管理员询问。
# 若是你的主机没有注册DNS名,可在此输入IP地址。
# 此时必须用IP地址来访问。(如,
http://123.45.67.89/)
# 这样扔能够完成从新定向的工做。
#
# 127.0.0.1 是TCP/IP的本地环路地址, 一般命名为localhost.
# 机器默认此地置为自己。 若是只是使用Apache来进行本地测试和开发,
# 可以使用127.0.0.1 做为服务器名.
#
#ServerName new.host.name
#
# DocumentRoot: 放置服务文档的目录。
# 默认状态下,全部的请求都以这个目录为基础。
# 可是直接符号链接和别名可用于指向其余位置。
#
DocumentRoot "D:/www_root"
#
# Apache访问的每一个目录可设置相关的服务和特性是容许或(和)不容许。
# (一样影响其子目录)
#
# 首先,设置"default"地址只有最基本的权限。
#
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
#
# 注意从如今开始必须制定开启特殊的权限。
# 这样就不会产生意想不到的结果。
# 请仔细确认。
#
#
# 这个地址应与DocumentRoot保持一致
#
<Directory "D:/www_root">
#
# 此值但是: "None", "All", 或下列的组合: "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", 或 "MultiViews".
#
# 注意"MultiViews"必须明确指定--- "Options All"不包括此特性。
#
Options Indexes FollowSymLinks MultiViews
#
# 此项控制目录中哪些.htaccess文件可覆盖。
# 容许值: "All"或者如下项的组合:"Options", "FileInfo",
# "AuthConfig", "Limit"
#
AllowOverride None
#
# 控制哪些用户可今后服务器得到资料。
#
Order allow,deny
Allow from all
</Directory>
#
# UserDir: 当请求~user时,追加到用户主目录的路径地址。
#
# 在Win32下,并不要求指定为用户登录的主目录。
# 所以可以使用如下的格式。
# 详细参照文档UserDir
#
<IfModule mod_userdir.c>
UserDir "f:/homepages/"
</IfModule>
#
# 控制访问UserDir目录. The following is an example
# 如下是一个站点的例子,权限限制为只读。
#
#<Directory "E:/Program Files/Apache Group/Apache/users">
# AllowOverride FileInfo AuthConfig Limit
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
# <Limit GET POST OPTIONS PROPFIND>
# Order allow,deny
# Allow from all
# </Limit>
# <LimitExcept GET POST OPTIONS PROPFIND>
# Order deny,allow
# Deny from all
# </LimitExcept>
#</Directory>
#
# DirectoryIndex: 预设的HTML目录索引文件名。
# 用空格来分隔多个文件名。
#
<IfModule mod_dir.c>
DirectoryIndex index.html
</IfModule>
#
# AccessFileName: 每一个目录中用于控制访问信息的文件名。
#
AccessFileName .htaccess
#
# 如下行防止客户端可访问 .htaccess 文件。
# 由于 .htaccess文件一般包含受权信息,
# 处于安全的考虑不容许访问。
# 若是想让访客看到.htaccess文件的内容,
# 可将这些行注释。
# 若是修改了上面的AccessFileName,
# 请在此进行相应的修改。
#
# 同时,通常会用相似.htpasswd的文件保存密码。
# 这些文件一样能够获得保护。
#
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
#
# CacheNegotiatedDocs: 默认下,Apache对每一个文档发送"Pragma: no-cache"
# 这将要求代理服务器不缓存此文档。
# 取消下列行的可取消这个属性,这样代理服务器将缓存这些文档。
#
#CacheNegotiatedDocs
#
# UseCanonicalName: (1.3新增) 当此设置为on时,
# 不管什么时候Apache须要构建一个自引用的URL(指向响应来源服务器),
# 它将用ServerName和Port来构建一个规范的格式。
# 当此设置为off时,Apache将使用客户端提供的"主机名:端口"
# 这将同时影响CGI脚本中的SERVER_NAME和SERVER_PORT
#
UseCanonicalName On
#
# TypesConfig 记录媒体类型(mime.types)文件或相似的东东放置的位置
#
<IfModule mod_mime.c>
TypesConfig conf/mime.types
</IfModule>
#
# DefaultType 是服务器处理未确认类型的文件,如为止的扩展名,的默认类型。
# 若是你的服务器上主要包含的是文本或HTML文档,"text/plain"是较好的设置
# 若是服务器上主要包含二进制文件,如应用程序或图片,
# 最好设置成"application/octet-stream"防止浏览器将二进制文件以文本的方式显示。
#
DefaultType text/plain
#
# mod_mime_magic模块容许服务器使用文件自身的不一样标识来肯定文件类型。
# MIMEMagicFile指示模块文件标识的定义所在的位置。
# mod_mime_magic不是默认服务器的一部分。
# (必须自行用LoadModule来追加 [见'全局环境'部分的 DSO 章节],
# 或者在编译服务器时包含mod_mime_magic部分)
# 包含在 <IfModule> 中.
# 就是说,若是该模块是服务器的一部分,MIMEMagicFile标识将执行。
#
<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>
#
# HostnameLookups: 注册客户端的机器名或IP地址。
# 例如:
www.apache.org (on) 或 204.62.129.132 (off).
# 默认为off,由于对于网络来讲,最好让人们有意识的设置为on,
# 由于开启此功能意味着每一个客户请求将致使至少向name服务器发送一个lookup请求
#
HostnameLookups Off
#
# ErrorLog: 错误记录文件的地址
# 若是不在<VirtualHost>内指定ErrorLog
# 改虚拟主机的错误心细将记录到此处。
# 若是在<VirtualHost>中明确指定了错误记录文件,
# 则错误将记录在那儿而不是这儿。
#
ErrorLog logs/error.log
#
# LogLevel: 控制记录在error.log中信息的个数.
# 可能的值:debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn
#
# 如下标识定义CustomLog标识使用的格式。(见下)
#
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
#
# 访问记录的位置和格式 (功用的记录文件格式).
# 若是不在<VirtualHost>中定义记录文件,
# 那些访问记录就将保存在这儿。 Contrariwise, if you *do*
# 反之,若是指定了记录文件,那么访问记录将记录在那儿而不是这个文件中。
#
CustomLog logs/access.log common
#
# 若是但愿使用代理和参考的记录文件, 取消如下标识的注释符
#
#CustomLog logs/referer.log referer
#CustomLog logs/agent.log agent
#
# 若是想在一个文件中记录访问、代理、参考信息(复合的记录格式)
# 可以使用如下标识
#
#CustomLog logs/access.log combined
#
# 在服务器产生的页面(如错误文档信息,FTP目录列表等等,不包括CGI产生的文档)中
# 增长一条服务器版本和虚拟主机名的信息。
# 设置为"EMail"将包含mailto: ServerAdmin的链接.
# 可选值: On | Off | EMail
#
ServerSignature On
#
# 默认下,Apache用工做行解析全部CGI脚本
# 此注释行(脚本的第一行)包括'#'和'!'后面跟着执行特殊脚本的程序路径,
# 对perl脚原本说是C:\Program Files\Perl目录中的perl.exe。
# 工做行以下:
#!c:/program files/perl/perl
# 注意真实的工做行不能有缩进,必须是文件的第一行。
# 固然,CGI进程必须经过适当的scriptAlias或ExecCGI选项标识来启动。
#
# 然而,Windows下的Apache即容许以上的Unix方式,也能够经过注册表的形式。
# 用注册表执行文件的方法同在Windows资源管理器中双击运行的注册方法相同。
# 此脚本操做可在Windows资源管理器的“查看”菜单中设置。
# “文件夹选项”,而后查看“文件类型”。点击编辑按钮。
# 修改操做属性。Apache 1.3会尝试执行‘Open'操做,
# 若是失败则会尝试工做行
# 这个属性在Apache release 2.0中会有改变.
#
# 每一个机制都有自身特定的安全弱点,这样可能致使别人运行你不但愿调用的程序。
# 最佳的解决方案还在讨论中。
#
# 要是这个Windows的特殊属性生效 (同时会是Unix属性无效)
# 取消下列标识的注释符。
#
#scriptInterpreterSource registry
#
# 上面的标识可在<Directory>块或.htaccess文件中单独替换。
# 可选择'registry' (Windows behavior)或 'script'
# (Unix behavior) option, 将覆盖服务器的默认值。
#
#
# Aliases: 可无限制的追加别名。格式以下:
# Alias 假名 真名
#
<IfModule mod_alias.c>
#
# 注意若是假名中包含'/',服务器会在当前URL中发出请求。
# 所以"/icons"不能用于别名
# 必须用 "/icons/"..
#
Alias /icons/ "C:/Program Files/Apache Group/Apache/icons/"
<Directory "C:/Program Files/Apache Group/Apache/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
#
# scriptAlias: 控制哪一个目录包含服务器脚本。
# scriptAlias本质行和Aliases同样。, except that
# 区别在于真名目录中的文档被看做是一个应用程序。
# 请求时由服务器运行而不是发往客户端。
# "/"符号的规则同
# Alias相同.
#
scriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/"
#
# "C:/Program Files/Apache Group/Apache/cgi-bin" 可修改成任何放置CGI脚本的目录
#
<Directory "C:/Program Files/Apache Group/Apache/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
</IfModule>
# 别名结束
#php脚本说明
scriptAlias /php/ "d:/php/"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .phtml
Action application/x-httpd-php "/php/php.exe"
#php脚本说明结束
#
# Redirect 容许告诉客户端服务器上曾经有的文档,可是如今不存在了。
# 而且能够告诉客户端到哪儿去寻找。
# 格式: Redirect old-URL new-URL
#
#
# 控制服务器目录列表显示的标识
#
<IfModule mod_autoindex.c>
#
# FancyIndexing标识是使用特定的目录检索仍是标准的(standard)
#
IndexOptions FancyIndexing
#
# AddIcon*代表不一样文件或扩展名显示的图标。
# 这些图标只在特定检索状态下显示。
#
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
#
# DefaultIcon 用于为制定图标的文件所显示的图标。
#
DefaultIcon /icons/unknown.gif
#
# AddDescription在服务器生成的检索的某个文件后追加小段说明。
# 此项只在设置为FancyIndexed时有效
# 格式:AddDescription "描述" 文件名
#
#AddDescription "GZIP compressed document" .gz
#AddDescription "tar archive" .tar
#AddDescription "GZIP compressed tar archive" .tgz
#
# ReadmeName是服务器默认的README文件。
# 而且会追加到目录列表的最后。
#
# HeaderName 是目录中须要预先显示内容的文件名。
#
# 若是MultiViews在选项中,做为结果,服务器将先找name.html,
# 若是存在就包含它。若是name.html不存在,
# 服务器会继续寻找name.txt。若是存在就做为纯文本包含进来。
#
ReadmeName README
HeaderName HEADER
#
# IndexIgnore是一系列的文件名。目录索引将忽略这些文件而且不包含在列表中。
# 容许使用通配符。
#
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
</IfModule>
# indexing标识结束
#
# 文件类型
#
<IfModule mod_mime.c>
#
# AddEncoding 可用于特殊浏览器(Mosaic/X 2.1+)快速传输压缩信息。
# 注:并非全部的服务器都支持。
# 除了名字类似,如下Add*标识对上面的FancyIndexing定制标识无影响。
#
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz
#
# AddLanguage用于指定文档的语言。
# 可使用content标签指定每一个文件的语言。
#
# 注 1: 后缀没必要与所用语言的关键字相同。
# --- 波兰语(Polish,标准代码为pl)的文档能够用
# "AddLanguage pl .po" 来避免与perl脚本文件混淆。
#
# 注 2: 如下例子代表两个字母的语言缩写和两个字母的国家缩写并不必定相同。
# E.g. 'Danmark/dk' 对比 'Danish/da'.
#
# 注 3: 其中'ltz'使用了三个字符,与RFC的规定不一样。
# 可是这个问题正在修订中,而且从新清理RFC1766
#
# 丹麦Danish (da) - 荷兰Dutch (nl) - 英国English (en) - 爱萨尼亚Estonian (ee)
# 法国French (fr) - 德国German (de) - 现代希腊文Greek-Modern (el)
# 意大利Italian (it) - 朝鲜Korean (kr) - 挪威Norwegian (no)
# 葡萄牙Portuguese (pt) - 卢森堡Luxembourgeois* (ltz)
# 西班牙Spanish (es) - 瑞典Swedish (sv) - 加泰罗尼亚Catalan (ca) - 捷克Czech(cz)
# 波兰Polish (pl) - 巴西Brazilian Portuguese (pt-br) - 日本Japanese (ja)
# 俄国Russian (ru)
#
AddLanguage da .dk
AddLanguage nl .nl
AddLanguage en .en
AddLanguage et .ee
AddLanguage fr .fr
AddLanguage de .de
AddLanguage el .el
AddLanguage he .he
AddCharset ISO-8859-8 .iso8859-8
AddLanguage it .it
AddLanguage ja .ja
AddCharset ISO-2022-JP .jis
AddLanguage kr .kr
AddCharset ISO-2022-KR .iso-kr
AddLanguage no .no
AddLanguage pl .po
AddCharset ISO-8859-2 .iso-pl
AddLanguage pt .pt
AddLanguage pt-br .pt-br
AddLanguage ltz .lu
AddLanguage ca .ca
AddLanguage es .es
AddLanguage sv .se
AddLanguage cz .cz
AddLanguage ru .ru
AddLanguage tw .tw
AddCharset Big5 .Big5 .big5
AddCharset WINDOWS-1251 .cp-1251
AddCharset CP866 .cp866
AddCharset ISO-8859-5 .iso-ru
AddCharset KOI8-R .koi8-r
AddCharset UCS-2 .ucs2
AddCharset UCS-4 .ucs4
AddCharset UTF-8 .utf8
# LanguagePriority 可设置语言的优先级。
#
# 优先级降序排列
# 在此处按照字母顺序,可自行修改
#
<IfModule mod_negotiation.c>
LanguagePriority en da nl et fr de el it ja kr no pl pt pt-br ru ltz ca es sv tw
</IfModule>
#
# AddType 可临时改变mime.types或者指定特殊文件的格式。
#
# 例如:PHP 3.x 模块 (非Apache标准配件,参见
http://www.php.net)可用下面格式定义:
#
#AddType application/x-httpd-php3 .php3
#AddType application/x-httpd-php3-source .phps
#
# PHP 4.x, 使用:
#
#AddType application/x-httpd-php .php
#AddType application/x-httpd-php-source .phps
AddType application/x-tar .tgz
#
# AddHandler 可将特定文件扩展名映射处处理方法上。
# 与文件类型无关。此特性可内建到服务器中或者追加在操做指令中(见下)
#
# 若是但愿用服务器端应用或scriptAliased外的CGI,取消如下行的注释符
#
# 用CGI脚本:
#
#AddHandler cgi-script .cgi
#
# 用服务器解析的HTML文档
#
#AddType text/html .shtml
#AddHandler server-parsed .shtml
#
# 取消如下注释符可激活Apache的send-asis HTTP file特性
#
#AddHandler send-as-is asis
#
# 若是使用服务器端解析的图像定位文件,使用如下标识:
#
#AddHandler imap-file map
#
# 要激活type maps使用:
#
#AddHandler type-map var
</IfModule>
# 文档类型说明结束
#
# Action 定义在文件匹配时执行相应的脚本。
# 可简化经常使用CGI文件的调用。
# 格式: Action media/type /cgi-script/location
# 格式: Action handler-name /cgi-script/location
#
#
# MetaDir: 指定保存meta信息文件的目录。
# 这些文件包含附加的HTTP头,在发送文档是一并发送。
#
#MetaDir .web
#
# MetaSuffix: 指定包含meta信息的文件的后缀。
#
#MetaSuffix .meta
#
# 可定制的错误响应(Apache类型)
# 共三种风格:
#
# 1) 纯文本
#ErrorDocument 500 "The server made a boo boo.
# 注: 第一个"号用于表示是文本,实际不输出
#
# 2) 本地重定向
#ErrorDocument 404 /missing.html
# to redirect to local URL /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl
# 注:可重定向到任何一个服务器端的脚本或文档
#
# 3) 外部重定向
#ErrorDocument 402
http://some.other_server.com/subscription_info.html
# 注: 大部分与初始请求关联的环境变量对这样的脚本无效。
#
#
# 基于浏览器的定制操做
#
<IfModule mod_setenvif.c>
#
# 如下标识修改普通的HTTP响应操做。
# 第一个标识针对Netscape2.x和其余无此功能的浏览器取消保持激活状态的功能
# 这些浏览器在执行这些功能时会出错。
# 第二个标识针对IE4.0b2设置。其中有一条不完整的HTTP/1.1指令
# 在301或302(重定向)响应时不能正确的保持激活状态
#
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
#
# 下面的标识经过不产生基本的1.1响应取消对违反HTTP/1.0标准的浏览器的响应。
#
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
</IfModule>
# 浏览器定制标识结束
#
# 容许使用URL"http://servername/server-status"的形式查看服务器状态报告
# 修改 ".your_domain.com"来匹配相应的域名以激活此功能
#
#<Location /server-status>
# SetHandler server-status
# Order deny,allow
# Deny from all
# Allow from .your_domain.com
#</Location>
#
# 容许使用URL"://servername/server-info"(要求加载mod_info.c),
# 来远程察看服务器配置报告。
# 修改 ".your_domain.com"来匹配相应的域名以激活此功能
#
#<Location /server-info>
# SetHandler server-info
# Order deny,allow
# Deny from all
# Allow from .your_domain.com
#</Location>
#
# 据报有人试图利用一个老的1.1漏洞。
# 这个漏洞与CGI脚本在Apache服务器上分布有关。
# 经过取消下面几行的注释符,能够将此类攻击记录转移到phf.apache.org上的记录脚本上。
# 或者也能够利用脚本scriptsupport/phf_abuse_log.cgi记录在本地服务器上。
#
#<Location /cgi-bin/phf*>
# Deny from all
# ErrorDocument 403
http://phf.apache.org/phf_abuse_log.cgi
#</Location>
#
# 代理服务器标识。取消下列行的注释符可激活代理服务器。
#
#<IfModule mod_proxy.c>
# ProxyRequests On
# <Directory proxy:*>
# Order deny,allow
# Deny from all
# Allow from .your_domain.com
# </Directory>
#
# 激活/取消处理HTTP/1.1 "Via:" 报头
# ("Full":加入服务器版本; "Block":取消全部外发的Via: 报头)
# 可设置值: Off | On | Full | Block
#
# ProxyVia On
#
# 可修改下列各行并取消注释符来激活缓存。
# (没有CacheRoot标识就不使用缓存)
#
# CacheRoot "E:/Program Files/Apache Group/Apache/proxy"
# CacheSize 5
# CacheGcInterval 4
# CacheMaxExpire 24
# CacheLastModifiedFactor 0.1
# CacheDefaultExpire 1
# NoCache a_domain.com another_domain.edu joes.garage_sale.com
#</IfModule>
# 代理标识结束
### 部分 3: 虚拟主机
#
# 虚拟主机: 若是但愿在一台服务器上实现多个域名和主机名的服务,
# 可设置VirtualHost来实现。Most configurations
# 大部分的设置使用基于名称的虚拟主机,这样服务器就没必要为IP地址操心。
# 这些用星号在下面的标识中标出。
#
# 在试图设置虚拟主机前
# 请阅读<URL:
http://www.apache.org/docs/vhosts/>中的文档。
# 以了解细节问题。
#
# 可用命令行参数 '-S'来确认虚拟主机的设置。
#
#
# 使用基于名称的虚拟主机
#
#NameVirtualHost *
#
# 虚拟主机实例:
# 几乎全部的Apache标识均可用于虚拟主机内。
# 第一个VirtualHost部分用于申请一个无重复的服务器名。
#
#<VirtualHost *>
# ServerAdmin
webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
========================================================================================================
# power by phpStudy 2014 www.phpStudy.net 官网下载最新版 # # This is the main Apache HTTP server configuration file. It contains the # configuration directives that give the server its instructions. # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information. # In particular, see # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html> # for a discussion of each configuration directive. # #这是Apache HTTP Server的主配置文件。它包括了配置指令【directives】,这些指令给服务器服务器指令【instructions】【】查看<URL:http://httpd.apache.org/docs/2.4/>以取得更多信息 #特别指出,查看<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 "F:/phpStudy/Apache" # # Mutex: Allows you to set the mutex mechanism and mutex file directory # for individual mutexes, or change the global defaults # # 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地址 # #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 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 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 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 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 fcgid_module modules/mod_fcgid.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> # # If you wish httpd to run as a different user or group, you must run # httpd as root initially and it will switch. #UNIX系统:若是你但愿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>配置提供默认值 # # 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>配置里面,在这种状况下这些默认设置会被将要定义的虚拟主机重写 # # # 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@phpStudy.net # # 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 localhost # # 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 /> Options +Indexes +FollowSymLinks +ExecCGI AllowOverride All Order allow,deny Allow from all Require all granted </Directory> # # 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. #你要使用【serve】的文档的目录。默认为全部请求都从这个目录获取,可是可使用符号链接【symbolic link】和别名指定其它位置。 # DocumentRoot "D:\www" # # DirectoryIndex: sets the file that Apache will serve if a directory # is requested. #DirectoryIndex:设置当Apache服务获得一个目录请求的时候访问的文件【即默认首页】 # <IfModule dir_module> DirectoryIndex index.html index.php index.htm l.php </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" #ErrorLog "|bin/rotatelogs.exe -l logs/error-%Y-%m-%d.log 2M" # # LogLevel: Control the number of messages logged to the error_log. # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. #日志级别,控制记录到错误日志文件中的消息的数量。可能包括的值有:debug、info、notice、warn、error、crit LogLevel error <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 # 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. # 容许你通知客户端之前存在于服务器名字空间的文档,如今已经不存在了。客户端将发送一个新请求以得到新的文档位置。 # 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. # Example: # Alias /webpath /full/filesystem/path #将链接中/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. # #ScriptAlias /cgi-bin/ "F:/phpStudy/Apache/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 cgisock </IfModule> # # "c:/Apache4/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # 若是你配置了脚本别名指定的CGI目录而且它是存在的,那么"c:/Apache24/cgi-bin"这个目录应该改成那个目录。 # <Directory "F:/phpStudy/Apache/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 #AddType application/x-httpd-php .php .phtml </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. # #MIMEMagicFile conf/magic #本模块采起Unix系统下file(1)命令相同的方法:检查文件开始的几个字节,来断定文件的MIME类型。它被做为当mod_mime 没法解析时,用来处理的“第二道防线”。 #本模块源自于Unix系统命令file(1)的一个自由版本,它经过对来自文件的内容使用“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. # 定义了在一个请求返回所有资源以前Ranges的最大数字,或者在'default', 'none' or 'unlimited'三个值中指定的一个值。 # 客户端请求的http数量范围。 # 若是设置的MaxRanges范围大于服务器自己全部资源的范围,那么确定服务器没法知足,只能返回服务器自己的全部资源。 #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 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 Include conf/extra/httpd-php-sapi53.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 #Timeout 60 # Configure mod_proxy_html to understand HTML4/XHTML1 配置mod_proxy_html,使它支持HTML4/XHTML1 #<IfModule proxy_html_module> #Include conf/extra/proxy-html.conf #</IfModule> #Include conf/vhosts.conf # 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. # SSLSessionCache "shmcb:logs/ssl_scache(512000)" SSLSessionCacheTimeout 300 <IfModule ssl_module> SSLRandomSeed startup builtin SSLRandomSeed connect builtin </IfModule> # Deal with user agents that deliberately violate open standards # <IfModule setenvif_module> BrowserMatch "MSIE 10.0;" bad_DNT </IfModule> <IfModule headers_module> RequestHeader unset DNT env=bad_DNT </IfModule>