当前位置: 首页 > 图文教程 > 服务器 > Linux服务器 > ApacheHTTP最新官方配置(中译版)

Linux服务器
在Apache环境下成功的运行ASP.NET
NoMachine,NX远程遥控的新典范
用gnump3d架设流体服务器
LinuxNFS(网络文件系统)服务器性能优化
Linux中建立安全的ProFTPD应用经验谈
手把手教你配Liunx流媒体服务器(上)
Linux系统中搭建LAMP动态博客网站
实例教你在Linux下建立代理服务器
简单架设Jabber局域网即时通讯服务器
ldap大容量邮件系统数据库应用指南
超全的NFSserver教程手册
用slackware架设虚拟主机管理系统(一)
用slackware架设虚拟主机管理系统(二)
slackware10.1下架设apache+tomcat+jk实例
SFTPD服务器架设菜鸟手记
手把手教你wuftp服务器的配置
使用TSIG和DNSSEC加固域名服务器
Linux上构建一个RADIUS服务器详解(1)
用CoyoteLinux制作好的打印服务器
routeros常用命令详解

Linux服务器 中的 ApacheHTTP最新官方配置(中译版)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-18   浏览: 39 ::
收藏到网摘: n/a


文章简介: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