Linux下Web服务器架设笔录教学内容_第1页
Linux下Web服务器架设笔录教学内容_第2页
Linux下Web服务器架设笔录教学内容_第3页
Linux下Web服务器架设笔录教学内容_第4页
Linux下Web服务器架设笔录教学内容_第5页
已阅读5页,还剩128页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Good is good, but better carries it.精益求精,善益求善。Linux下Web服务器架设笔录Linux下Web服务器架设笔录本文环境:CentOS5.4+ApacheApache的安装CentOS默认已安装Apache服务器软件,可使用rpm命令检查安装情况:dxlocalhost$rpm-qa|grephttpdhttpd-2.2.3-31.el5.centos若没有默认安装,可在安装光盘内找到rpm包并进行安装:dxlocalhost$rpmivhhttpd-2.2.3-31.e15.i386.rpm安装成功后,几个重要的文件分布如下:/etc/httpd/

2、conf/httpd.confApache的主配置文件/etc/httpd/logsApache的日志存放目录/etc/httpd/modulesApache的模块存放目录/usr/lib/httpd/modulesApache模块存放的另一目录/usr/sbin/apachectlApache控制脚本(非目录),用于启动、停止等操作Httpd进程运行时需要apache用户的支持,CentOS在安装时一般情况下已默认创建了这个用户,如果系统中没有这个用户,应该重新创建。运行ApacheApache安装完成之后,有一套默认的配置文件可以启动:rootlocalhostdx#/usr/sbin/a

3、pachectlstart查看进程的启动状态:rootlocalhostdx#ps-eaf|grephttpdroot111961014:54?00:00:00/usr/sbin/httpd-kstartapache1119711196014:54?00:00:00/usr/sbin/httpd-kstartapache1119811196014:54?00:00:00/usr/sbin/httpd-kstartapache1119911196014:54?00:00:00/usr/sbin/httpd-kstartapache1120011196014:54?00:00:00/usr/sbi

4、n/httpd-kstartapache1120111196014:54?00:00:00/usr/sbin/httpd-kstartapache1120211196014:54?00:00:00/usr/sbin/httpd-kstartapache1120311196014:54?00:00:00/usr/sbin/httpd-kstartapache1120411196014:54?00:00:00/usr/sbin/httpd-kstart可以看到,有9个Apache的进程,其中一个是由root用户身份运行,另外8个以apache用户身份运行,这8个进程是第1个进程的子进程。启动多个进

5、程的目的是为了更好地为客户端提供服务,初始子进程的个数可以在配置文件中指定。设置Apache随系统启动而启动:rootlocalhostdx#chkconfig-listhttpdhttpd0:关闭1:关闭2:关闭3:关闭4:关闭5:关闭6:关闭rootlocalhostdx#chkconfighttpdonrootlocalhostdx#chkconfig-listhttpdhttpd0:关闭1:关闭2:启用3:启用4:启用5:启用6:关闭检查端口监听状态:rootlocalhostdx#netstat-an|grep:80tcp00:80:*LISTEN确定端口状态后,只要防火墙有设置ht

6、tp为信任的协议,就可以在客户端访问Apache的测试页面了:HYPERLINK43/43/Apache服务器的全局配置Apache服务器的配置主要集中在主配置文件/etc/httpd/conf/httpd.conf中,本节先介绍Apache服务器的全局基本配置,之后再介绍目录访问控制,用户个人网站配置,虚拟主机配置等其他高级配置。Apache的例子配置文件包含了很多的配置选项,涵盖了Apache服务器的大部分的重要功能,里面的配置指令包括全局配置、主服务器配置和虚拟主机配置三大部分,这里首先解释一下例子配置文件中有关全局配置的指令,他们决定了Apache服务器的总体性能。rootlocalh

7、ostconf#more/etc/httpd/conf/httpd.conf#ThisisthemainApacheserverconfigurationfile.Itcontainsthe#configurationdirectivesthatgivetheserveritsinstructions.#Seefordetailedinformation.#Inparticular,see#foradiscussionofeachconfigurationdirective.#DoNOTsimplyreadtheinstructionsinherewithoutunderstanding#wh

8、attheydo.Theyrehereonlyashintsorreminders.Ifyouareunsure#consulttheonlinedocs.Youhavebeenwarned.#Theconfigurationdirectivesaregroupedintothreebasicsections:#1.DirectivesthatcontroltheoperationoftheApacheserverprocessasa#whole(theglobalenvironment).#2.Directivesthatdefinetheparametersofthemainordefau

9、ltserver,#whichrespondstorequeststhatarenthandledbyavirtualhost.#Thesedirectivesalsoprovidedefaultvaluesforthesettings#ofallvirtualhosts.#3.Settingsforvirtualhosts,whichallowWebrequeststobesentto#differentIPaddressesorhostnamesandhavethemhandledbythe#sameApacheserverprocess.#Configurationandlogfilen

10、ames:Ifthefilenamesyouspecifyformany#oftheserverscontrolfilesbeginwith/(ordrive:/forWin32),the#serverwillusethatexplicitpath.Ifthefilenamesdo*not*begin#with/,thevalueofServerRootisprepended-sologs/foo.log#withServerRootsetto/etc/httpdwillbeinterpretedbythe#serveras/etc/httpd/logs/foo.log.#Section1:G

11、lobalEnvironment#全局配置部分指令#ThedirectivesinthissectionaffecttheoveralloperationofApache,#suchasthenumberofconcurrentrequestsitcanhandleorwhereit#canfinditsconfigurationfiles.#Dontgiveawaytoomuchinformationaboutallthesubcomponents#wearerunning.Commentoutthislineifyoudontmindremotesites#findingoutwhatma

12、joroptionalmodulesyouarerunningServerTokensOS#连接时显示Apache的版本和操作系统的名称#ServerRoot:Thetopofthedirectorytreeunderwhichtheservers#configuration,error,andlogfilesarekept.#NOTE!IfyouintendtoplacethisonanNFS(orotherwisenetwork)#mountedfilesystemthenpleasereadtheLockFiledocumentation#(availableat);#youwillsa

13、veyourselfalotoftrouble.#DoNOTaddaslashattheendofthedirectorypath.#ServerRoot/etc/httpd#指定服务器的根目录,以后在配置文件中指定起始符号不是”/”的路径时,以该目录作为起始目录,如logs/error_log即表示/etc/httpd/logs/error_log#PidFile:Thefileinwhichtheservershouldrecorditsprocess#identificationnumberwhenitstarts.#PidFilerun/httpd.pid#Timeout:Thenum

14、berofsecondsbeforereceivesandsendstimeout.#Timeout120#客户端建立连接后如果连续120秒内没有响应,则切断连接#KeepAlive:Whetherornottoallowpersistentconnections(morethan#onerequestperconnection).SettoOfftodeactivate.#KeepAliveOff#“Off”表示不使用持久连接功能,即在一个TCP连接中只传送一个请求和一个应答消息。建议设置为on,可提高服务器性能。#MaxKeepAliveRequests:Themaximumnumbero

15、frequeststoallow#duringapersistentconnection.Setto0toallowanunlimitedamount.#Werecommendyouleavethisnumberhigh,formaximumperformance.#MaxKeepAliveRequests100#使用持久连接时,该连接允许发送的最大请求消息数。如果设为0,表示没有限制。#KeepAliveTimeout:Numberofsecondstowaitforthenextrequestfromthe#sameclientonthesameconnection.#KeepAliveT

16、imeout15#使用持久连接功能时,客户端的下一个请求消息超过15秒还未到达,就切断该连接。#Server-PoolSizeRegulation(MPMspecific)#设置使用preforkMPM运行方式的参数,CentOS中默认以此方式运行Apache服务器。#配置Apache运行时启动多少个进程来处理客户端的请求。#preforkMPM#StartServers:numberofserverprocessestostart#MinSpareServers:minimumnumberofserverprocesseswhicharekeptspare#MaxSpareServers:m

17、aximumnumberofserverprocesseswhicharekeptspare#ServerLimit:maximumvalueforMaxClientsforthelifetimeoftheserver#MaxClients:maximumnumberofserverprocessesallowedtostart#MaxRequestsPerChild:maximumnumberofrequestsaserverprocessserves#模块定义开始StartServers8#初始的httpd子进程数为8个MinSpareServers5#最小的空闲httpd子进程总数为5个

18、MaxSpareServers20#最大的空闲httpd子进程总数为20个ServerLimit256#最大的httpd子进程数允许值为256个MaxClients256#最大客户端连接数为256MaxRequestsPerChild4000#每个httpd子进程处理了4000个请求后要关闭#模块定义结束#设置workerMPM方式的参数,与preforkMPM类似,但设置的是线程数。#workerMPM#StartServers:initialnumberofserverprocessestostart#MaxClients:maximumnumberofsimultaneousclient

19、connections#MinSpareThreads:minimumnumberofworkerthreadswhicharekeptspare#MaxSpareThreads:maximumnumberofworkerthreadswhicharekeptspare#ThreadsPerChild:constantnumberofworkerthreadsineachserverprocess#MaxRequestsPerChild:maximumnumberofrequestsaserverprocessserves#模块定义开始StartServers2#主控制进程生成2个httpd子

20、进程MaxClients150#最大客户端连接数为150MinSpareThreads25#最小的空闲httpd线程总数为25个MaxSpareThreads75#最大的空闲httpd线程总数为75个ThreadsPerChild25#每个子进程可产生25个线程MaxRequestsPerChild0#每个子进程处理的最大请求数,0表示没有限制#模块定义结束#Listen:AllowsyoutobindApachetospecificIPaddressesand/or#ports,inadditiontothedefault.Seealsothe#directive.#Changethisto

21、ListenonspecificIPaddressesasshownbelowto#preventApachefromglommingontoallboundIPaddresses()#Listen8:80Listen80#设置服务器的监听端口为80#DynamicSharedObject(DSO)Support#TobeabletousethefunctionalityofamodulewhichwasbuiltasaDSOyou#havetoplacecorrespondingLoadModulelinesatthislocationsothe#directivescontainedini

22、tareactuallyavailable_before_theyareused.#Staticallycompiledmodules(thoselistedbyhttpd-l)donotneed#tobeloadedhere.#Example:#LoadModulefoo_modulemodules/mod_foo.so#加载动态模块(DSO)LoadModuleauth_basic_modulemodules/mod_auth_basic.soLoadModuleauth_digest_modulemodules/mod_auth_digest.soLoadModuleauthn_file

23、_modulemodules/mod_authn_file.soLoadModuleauthn_alias_modulemodules/mod_authn_alias.soLoadModuleauthn_anon_modulemodules/mod_authn_anon.soLoadModuleauthn_dbm_modulemodules/mod_authn_dbm.soLoadModuleauthn_default_modulemodules/mod_authn_default.soLoadModuleauthz_host_modulemodules/mod_authz_host.soLo

24、adModuleauthz_user_modulemodules/mod_authz_user.soLoadModuleauthz_owner_modulemodules/mod_authz_owner.soLoadModuleauthz_groupfile_modulemodules/mod_authz_groupfile.soLoadModuleauthz_dbm_modulemodules/mod_authz_dbm.soLoadModuleauthz_default_modulemodules/mod_authz_default.soLoadModuleldap_modulemodul

25、es/mod_ldap.soLoadModuleauthnz_ldap_modulemodules/mod_authnz_ldap.soLoadModuleinclude_modulemodules/mod_include.soLoadModulelog_config_modulemodules/mod_log_config.soLoadModulelogio_modulemodules/mod_logio.soLoadModuleenv_modulemodules/mod_env.soLoadModuleext_filter_modulemodules/mod_ext_filter.soLo

26、adModulemime_magic_modulemodules/mod_mime_magic.soLoadModuleexpires_modulemodules/mod_expires.soLoadModuledeflate_modulemodules/mod_deflate.soLoadModuleheaders_modulemodules/mod_headers.soLoadModuleusertrack_modulemodules/mod_usertrack.soLoadModulesetenvif_modulemodules/mod_setenvif.soLoadModulemime

27、_modulemodules/mod_mime.soLoadModuledav_modulemodules/mod_dav.soLoadModulestatus_modulemodules/mod_status.soLoadModuleautoindex_modulemodules/mod_autoindex.soLoadModuleinfo_modulemodules/mod_info.soLoadModuledav_fs_modulemodules/mod_dav_fs.soLoadModulevhost_alias_modulemodules/mod_vhost_alias.soLoad

28、Modulenegotiation_modulemodules/mod_negotiation.soLoadModuledir_modulemodules/mod_dir.soLoadModuleactions_modulemodules/mod_actions.soLoadModulespeling_modulemodules/mod_speling.soLoadModuleuserdir_modulemodules/mod_userdir.soLoadModulealias_modulemodules/mod_alias.soLoadModulerewrite_modulemodules/

29、mod_rewrite.soLoadModuleproxy_modulemodules/mod_proxy.soLoadModuleproxy_balancer_modulemodules/mod_proxy_balancer.soLoadModuleproxy_ftp_modulemodules/mod_proxy_ftp.soLoadModuleproxy_http_modulemodules/mod_proxy_http.soLoadModuleproxy_connect_modulemodules/mod_proxy_connect.soLoadModulecache_modulemo

30、dules/mod_cache.soLoadModulesuexec_modulemodules/mod_suexec.soLoadModuledisk_cache_modulemodules/mod_disk_cache.soLoadModulefile_cache_modulemodules/mod_file_cache.soLoadModulemem_cache_modulemodules/mod_mem_cache.soLoadModulecgi_modulemodules/mod_cgi.soLoadModuleversion_modulemodules/mod_version.so

31、#Thefollowingmodulesarenotloadedbydefault:#LoadModulecern_meta_modulemodules/mod_cern_meta.so#LoadModuleasis_modulemodules/mod_asis.so#Loadconfigfilesfromtheconfigdirectory/etc/httpd/conf.d.#将conf.d/目录下的所有后缀名为.conf的文件内容包含进来,根据以上ServerRoot的配置,这个目录应该是:/etc/httpd/conf.d/*.conf#这个目录中包含了许多专用功能的配置,如JSP、PH

32、P、SSL等的配置文件Includeconf.d/*.conf#ExtendedStatuscontrolswhetherApachewillgeneratefullstatus#information(ExtendedStatusOn)orjustbasicinformation(ExtendedStatus#Off)whentheserver-statushandleriscalled.ThedefaultisOff.#ExtendedStatusOn#Ifyouwishhttpdtorunasadifferentuserorgroup,youmustrun#httpdasrootinit

33、iallyanditwillswitch.#User/Group:Thename(or#number)oftheuser/grouptorunhttpdas.#.OnSCO(ODT3)useUsernouserandGroupnogroup.#.OnHPUXyoumaynotbeabletousesharedmemoryasnobody,andthe#suggestedworkaroundistocreateauserwwwandusethatuser.#NOTEthatsomekernelsrefusetosetgid(Group)orsemctl(IPC_SET)#whenthevalue

34、of(unsigned)Groupisabove60000;#dontuseGroup#-1onthesesystems!#指定运行httpd子进程的用户和用户组身份UserapacheGroupapacheApache主服务器配置Apache处理客户端的请求时,会根据URL来判断客户端是否需要访问虚拟主机。如果不是访问虚拟主机,则认为是访问主服务器。主服务器的配置将作为后面虚拟主机的默认配置,如果在虚拟主机中出现了同样的指令,则会覆盖对应的指令。#Section2:Mainserverconfiguration#主服务器配置部分指令#Thedirectivesinthissectionset

35、upthevaluesusedbythemain#server,whichrespondstoanyrequeststhatarenthandledbya#definition.Thesevaluesalsoprovidedefaultsfor#anycontainersyoumaydefinelaterinthefile.#Allofthesedirectivesmayappearinsidecontainers,#inwhichcasethesedefaultsettingswillbeoverriddenforthe#virtualhostbeingdefined.#ServerAdmi

36、n:Youraddress,whereproblemswiththeservershouldbe#e-mailed.Thisaddressappearsonsomeserver-generatedpages,such#aserrordocuments.e.g.admin#ServerAdminrootlocalhost#管理员的E-Mail地址,会出现在一些出错页面中#ServerNamegivesthenameandportthattheserverusestoidentifyitself.#Thiscanoftenbedeterminedautomatically,butwerecomme

37、ndyouspecify#itexplicitlytopreventproblemsduringstartup.#IfthisisnotsettovalidDNSnameforyourhost,server-generated#redirectionswillnotwork.SeealsotheUseCanonicalNamedirective.#IfyourhostdoesnthavearegisteredDNSname,enteritsIPaddresshere.#Youwillhavetoaccessitbyitsaddressanyway,andthiswillmake#redirec

38、tionsworkinasensibleway.#ServerN:80#当Apache服务器引用自己的URL时,使用这里指定的域名和端口号。#UseCanonicalName:DetermineshowApacheconstructsself-referencing#URLsandtheSERVER_NAMEandSERVER_PORTvariables.#WhensetOff,ApachewillusetheHostnameandPortsupplied#bytheclient.WhensetOn,Apachewillusethevalueofthe#ServerNamedirective.

39、#UseCanonicalNameOff#当Apache构建引用自己的URL时,使用这里指定的域名和端口号,如果此选项打开,则使用由ServerName指定的主机名和端口。#DocumentRoot:Thedirectoryoutofwhichyouwillserveyour#documents.Bydefault,allrequestsaretakenfromthisdirectory,but#symboliclinksandaliasesmaybeusedtopointtootherlocations.#DocumentRoot/var/www/html#主服务器的根文档路径。#Eachd

40、irectorytowhichApachehasaccesscanbeconfiguredwithrespect#towhichservicesandfeaturesareallowedand/ordisabledinthat#directory(anditssubdirectories).#First,weconfigurethedefaulttobeaveryrestrictivesetof#features.#设置根目录的访问控制权OptionsFollowSymLinksAllowOverrideNone#Notethatfromthispointforwardyoumustspeci

41、ficallyallow#particularfeaturestobeenabled-soifsomethingsnotworkingas#youmightexpect,makesurethatyouhavespecificallyenabledit#below.#ThisshouldbechangedtowhateveryousetDocumentRootto.#设置主服务器主目录的访问控制权#定义开始#PossiblevaluesfortheOptionsdirectiveareNone,All,#oranycombinationof:#IndexesIncludesFollowSymLi

42、nksSymLinksifOwnerMatchExecCGIMultiViews#NotethatMultiViewsmustbenamed*explicitly*OptionsAll#doesntgiveittoyou.#TheOptionsdirectiveisbothcomplicatedandimportant.Pleasesee#/docs/2.2/mod/core.html#options#formoreinformation.#OptionsIndexesFollowSymLinks#AllowOverridecontrolswhatdirectivesmaybeplacedin

43、.htaccessfiles.#ItcanbeAll,None,oranycombinationofthekeywords:#OptionsFileInfoAuthConfigLimit#AllowOverrideNone#Controlswhocangetstufffromthisserver.#Orderallow,denyAllowfromall#定义结束#UserDir:Thenameofthedirectorythatisappendedontoausershome#directoryifauserrequestisreceived.#Thepathtotheenduseraccou

44、ntpublic_htmldirectorymustbe#accessibletothewebserveruserid.Thisusuallymeansthatuserid#musthavepermissionsof711,userid/public_htmlmusthavepermissions#of755,anddocumentscontainedthereinmustbeworld-readable.#Otherwise,theclientwillonlyreceivea403Forbiddenmessage.#Seealso:/docs/misc/FAQ.html#forbidden#

45、用户个人服务器#UserDirisdisabledbydefaultsinceitcanconfirmthepresence#ofausernameonthesystem(dependingonhomedirectory#permissions).#UserDirdisable#不允许用户使用个人服务器#Toenablerequeststo/user/toservetheuserspublic_html#directory,removetheUserDirdisablelineabove,anduncomment#thefollowinglineinstead:#UserDirpublic_h

46、tml#ControlaccesstoUserDirdirectories.Thefollowingisanexample#forasitewherethesedirectoriesarerestrictedtoread-only.#用户个人服务器的配置,默认是禁用的#AllowOverrideFileInfoAuthConfigLimit#OptionsMultiViewsIndexesSymLinksIfOwnerMatchIncludesNoExec#Orderallow,deny#Allowfromall#Orderdeny,allow#Denyfromall#DirectoryInd

47、ex:setsthefilethatApachewillserveifadirectory#isrequested.#Theindex.html.varfile(atype-map)isusedtodelivercontent-#negotiateddocuments.TheMultiViewsOptioncanbeusedforthe#samepurpose,butitismuchslower.#指定主服务器的默认主页面的名称,当客户端访问服务器时,依次查找页面index.html、index.html.varDirectoryIndexindex.htmlindex.html.var#Ac

48、cessFileName:Thenameofthefiletolookforineachdirectory#foradditionalconfigurationdirectives.SeealsotheAllowOverride#directive.#每个目录都可以包含对本目录的访问权限进行设置的文件,这里指定配置文件的名称AccessFileName.htaccess#Thefollowinglinesprevent.htaccessand.htpasswdfilesfrombeing#viewedbyWebclients.#拒绝访问以.ht开头的文件,即保证.htaccess文件不被客户端

49、访问Orderallow,denyDenyfromall#TypesConfigdescribeswherethemime.typesfile(orequivalent)is#tobefound.#TypesConfig/etc/mime.types#DefaultTypeisthedefaultMIMEtypetheserverwilluseforadocument#ifitcannototherwisedetermineone,suchasfromfilenameextensions.#IfyourservercontainsmostlytextorHTMLdocuments,text/p

50、lainis#agoodvalue.Ifmostofyourcontentisbinary,suchasapplications#orimages,youmaywanttouseapplication/octet-streaminsteadto#keepbrowsersfromtryingtodisplaybinaryfilesasthoughtheyare#text.#DefaultTypetext/plain#Themod_mime_magicmoduleallowstheservertousevarioushintsfromthe#contentsofthefileitselftodet

51、ermineitstype.TheMIMEMagicFile#directivetellsthemodulewherethehintdefinitionsarelocated.#MIMEMagicFile/usr/share/magic.mimeMIMEMagicFileconf/magic#HostnameLookups:LogthenamesofclientsorjusttheirIPaddresses#e.g.,(on)or32(off).#Thedefaultisoffbecauseitdbeoverallbetterforthenetifpeople#hadtoknowinglytu

52、rnthisfeatureon,sinceenablingitmeansthat#eachclientrequestwillresultinATLEASTonelookuprequesttothe#nameserver.#日志中只记录连接Apache服务器的客户端IP地址,而不记录其主机名HostnameLookupsOff#EnableMMAP:Controlwhethermemory-mappingisusedtodeliver#files(assumingthattheunderlyingOSsupportsit).#Thedefaultison;turnthisoffifyouserv

53、efromNFS-mounted#filesystems.Onsomesystems,turningitoff(regardlessof#filesystem)canimproveperformance;fordetails,pleasesee#/docs/2.2/mod/core.html#enablemmap#分发文件时是否启用内存映射功能,启用时,在某些操作系统中可以提高性能#EnableMMAPoff#EnableSendfile:Controlwhetherthesendfilekernelsupportis#usedtodeliverfiles(assumingthattheOSs

54、upportsit).#Thedefaultison;turnthisoffifyouservefromNFS-mounted#filesystems.Pleasesee#/docs/2.2/mod/core.html#enablesendfile#分发文件时是否启用sendfile内核支持,如果使用NFS文件系统,应该要禁用#EnableSendfileoff#ErrorLog:Thelocationoftheerrorlogfile.#IfyoudonotspecifyanErrorLogdirectivewithina#container,errormessagesrelatingtot

55、hatvirtualhostwillbe#loggedhere.Ifyou*do*defineanerrorlogfilefora#container,thathostserrorswillbeloggedthereandnothere.#指定错误日志的存放位置,存放在/etc/httpd/logs/error_logErrorLoglogs/error_log#LogLevel:Controlthenumberofmessagesloggedtotheerror_log.#Possiblevaluesinclude:debug,info,notice,warn,error,crit,#ale

56、rt,emerg.#指定错误日志的记录级别为warn及以上LogLevelwarn#Thefollowingdirectivesdefinesomeformatnicknamesforusewith#aCustomLogdirective(seebelow).#定义combine、common、referer、agent四种日志的格式LogFormat%h%l%u%t%r%s%b%Refereri%User-AgenticombinedLogFormat%h%l%u%t%r%s%bcommonLogFormat%Refereri-%UrefererLogFormat%User-agentiag

57、ent#combinedioincludesactualcountsofactualbytesreceived(%I)andsent(%O);this#requiresthemod_logiomoduletobeloaded.#LogFormat%h%l%u%t%r%s%b%Refereri%User-Agenti%I%Ocombinedio#Thelocationandformatoftheaccesslogfile(CommonLogfileFormat).#Ifyoudonotdefineanyaccesslogfileswithina#container,theywillbelogge

58、dhere.Contrariwise,ifyou*do*#defineper-accesslogfiles,transactionswillbe#loggedthereinand*not*inthisfile.#指定访问日志的存放位置以及日志的格式,这里使用common格式#CustomLoglogs/access_logcommon#Ifyouwouldliketohaveseparateagentandrefererlogfiles,uncomment#thefollowingdirectives.#如果有需要,还可以将其他格式的日志同时记录在相应的日志文件中#CustomLoglogs/

59、referer_logreferer#CustomLoglogs/agent_logagent#Forasinglelogfilewithaccess,agent,andrefererinformation#(CombinedLogfileFormat),usethefollowingdirective:#如果只启用一个访问日志,默认使用的是combined格式CustomLoglogs/access_logcombined#Optionallyaddalinecontainingtheserverversionandvirtualhost#nametoserver-generatedpage

60、s(internalerrordocuments,FTPdirectory#listings,mod_statusandmod_infooutputetc.,butnotCGIgenerated#documentsorcustomerrordocuments).#SettoEMailtoalsoincludeamailto:linktotheServerAdmin.#Settooneof:On|Off|EMail#设置在Apache自身产生的页面中使用Apache服务器版本的签名ServerSignatureOn#Aliases:Addhereasmanyaliasesasyouneed(wi

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论