文章简介:Apache最新官方配置文件中文版。帮忙web服务器管理员更方便的对Apache进行配置。
#
#BasedupontheNCSAserverconfigurationfilesoriginallybyRobMcCool.
#参照NCSA服务器的配置文件,原版由RobMcCool发布
#
#ThisisthemainApacheserverconfigurationfile. Itcontainsthe
#configurationdirectivesthatgivetheserveritsinstructions.
#See<URL:http://httpd.apache.org/docs-2.0/>fordetailedinformationabout
#thedirectives.
#这是Apacheserver的主配置文件.它包含配置指令,来指示服务器
#请参考http://httpd.apache.org/docs-2.0了解关于指令的详细信息
#DoNOTsimplyreadtheinstructionsinherewithoutunderstanding
#whattheydo. They'rehereonlyashintsorreminders. Ifyouareunsure
#consulttheonlinedocs.Youhavebeenwarned.
#不要仅仅是阅读本指令,而应该理解指令做了什么。在这里仅起提示的作用。
#如果你不清楚请参阅在线文档。特别提示
#Theconfigurationdirectivesaregroupedintothreebasicsections:
#配置文件批令分为三个基本组
# 1.DirectivesthatcontroltheoperationoftheApacheserverprocessasa
#whole(the'globalenvironment').
# 1.控制Apacheserver的全局操作的指令(全局环境变量).
# 2.Directivesthatdefinetheparametersofthe'main'or'default'server,
#whichrespondstorequeststhataren'thandledbyavirtualhost.
#Thesedirectivesalsoprovidedefaultvaluesforthesettings
#ofallvirtualhosts.
# 2.配置主服务或者默认服务的指令,它针对那些被虚拟主机以外的请求作出响应.
#它也包含虚拟主机的一些默认参数
# 3.Settingsforvirtualhosts,whichallowWebrequeststobesentto
#differentIPaddressesorhostnamesandhavethemhandledbythe
#sameApacheserverprocess.
# 3.虚拟主机设置,这使得发往不同的ip或者主机名的请求可以被子同一个Apache服务#器处理
#Configurationandlogfilenames:Ifthefilenamesyouspecifyformany
#oftheserver'scontrolfilesbeginwith"/"(or"drive:/"forWin32),the
#serverwillusethatexplicitpath. Ifthefilenamesdo*not*begin
#with"/",thevalueofServerRootisprepended--so"logs/foo.log"
#withServerRootsetto"C:/ProgramFiles/ApacheGroup/Apache2"willbeinterpretedbythe
#serveras"C:/ProgramFiles/ApacheGroup/Apache2/logs/foo.log".
#配置和日志文件名:如果你所指定的文件名以”/”(在Win32中以盘符:/)开头,服务器将以绝对路径来处理。如果不以”/”开头,则以相对于ServerRoot不解释,所以对于logs/foo.log来讲,当ServerRoot为"C:/ProgramFiles/ApacheGroup/Apache2”时,则指的是
C:/ProgramFiles/ApacheGroup/Apache2/logs/foo.log文件
#NOTE:Wherefilenamesarespecified,youmustuseforwardslashes
#insteadofbackslashes(e.g.,"c:/apache"insteadof"c:\apache").
注意,在文件名的定义中,必须用正斜杠,而不是反斜杠,如c:/apache而不是c:\apache
#Ifadriveletterisomitted,thedriveonwhichApache.exeislocated
#willbeusedbydefault. Itisrecommendedthatyoualwayssupply
#anexplicitdriveletterinabsolutepaths,however,toavoid
#confusion.
#如果省略了盘符,则以Apache.exe所在的盘符为默认值
建议在绝对路径中永远使用显式的盘符,这样有助于消除误解
###Section1:GlobalEnvironment
#第一部分全局环境
#
#ThedirectivesinthissectionaffecttheoveralloperationofApache,
#suchasthenumberofconcurrentrequestsitcanhandleorwhereit
#canfinditsconfigurationfiles.
#本部分的指令将影响整个Apache服务器,例如它所能处理的并发请求数或者它在哪里能够找到其配置文件
#
#ServerRoot:Thetopofthedirectorytreeunderwhichtheserver's
#configuration,error,andlogfilesarekept.
#ServerRoot:服务器的配置,错误和日志文件的根目录
#NOTE! IfyouintendtoplacethisonanNFS(orotherwisenetwork)
#mountedfilesystemthenpleasereadtheLockFiledocumentation(available
#at<URL:http://httpd.apache.org/docs-2.0/mod/mpm_common.html#lockfile>);
#youwillsaveyourselfalotoftrouble.
#注意:如果将其保存到NFS上或者网络上mounted的文件系统上,然后应该阅读LockFile文档,http://httpd.apache.org/docs-2.0/mod/mpm_common.html#lockfile,将能解决你的很多麻烦.
#DoNOTaddaslashattheendofthedirectorypath.
#不要在目录的末尾加上斜杠
ServerRoot"C:/ProgramFiles/ApacheGroup/Apache2"
ServerRoot:根目录
#
#ScoreBoardFile:Fileusedtostoreinternalserverprocessinformation.
#Ifunspecified(thedefault),thescoreboardwillbestoredinan
#anonymoussharedmemorysegment,andwillbeunavailabletothird-party
#applications.
ScoreBoardFile:保存服务器内部的处理信息
如果未定议(默认状态),scoreboard将被保存在匿名的共享内存段中,并且对于第三方来讲,是不可获得的
#Ifspecified,ensurethatnotwoinvocationsofApachesharethesame
#scoreboardfile.ThescoreboardfileMUSTBESTOREDONALOCALDISK.
#如果已定义,应确保Apache的两个调用不能共享同一个scoreboard.Scoreboard文件必须存放在可分配的磁盘上
#ScoreBoardFilelogs/apache_runtime_status
#
#PidFile:Thefileinwhichtheservershouldrecorditsprocess
#identificationnumberwhenitstarts.
#PidFile:当服务器起努时,服务器需要将其进程ID号存放在此文件中
PidFilelogs/httpd.pid
#
#Timeout:Thenumberofsecondsbeforereceivesandsendstimeout.
#Timeout:接收和发送数据的超时设置,秒数
Timeout300
#
#KeepAlive:Whetherornottoallowpersistentconnections(morethan
#onerequestperconnection).Setto"Off"todeactivate.
#KeepAlive:是否支持持久联接(而不是每个请求建一个连接),设off关闭此功能
KeepAliveOn
#
#MaxKeepAliveRequests:Themaximumnumberofrequeststoallow
#duringapersistentconnection.Setto0toallowanunlimitedamount.
#Werecommendyouleavethisnumberhigh,formaximumperformance.
#MaxKeepAliveRequests:在持久连接期间,所允许的最大请求数量。设为0表示不作限制
建议设为较高的数,以提高性能
MaxKeepAliveRequests100
#
#KeepAliveTimeout:Numberofsecondstowaitforthenextrequestfromthe
#sameclientonthesameconnection.
#KeepAliveTimeout:在同一个客户连接中,等待下一个请求的等待时间。
KeepAliveTimeout15
##
##Server-PoolSizeRegulation(MPMspecific)
##常规Server-Pool服务器池的大小(每分钟M数)
#WinNTMPMWinNT的MPM
#ThreadsPerChild:constantnumberofworkerthreadsintheserverprocess
ThreadPerChild:服务器进程中工作的线程数量
#MaxRequestsPerChild:maximum numberofrequestsaserverprocessserves
每个服务进程的最大请求数
<IfModulempm_winnt.c>
ThreadsPerChild250
MaxRequestsPerChild