版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Linux网络嵌入架构工程师培训班二十三1WebWeb还可以提供与客户之间的信息交互,提本节课详细讲解Apache的源代码安装以及基本配置2、说明tar-zxvfhttpd-2.2.9.tar.gz //现在是2.2.9 ./configuremake##ThisisthemainApacheHTTPserverconfigurationfile. Itcontainsthe#configurationdirectivesthatgivetheserveritsinstructions.#See<URL:>fordetailedinformation.#Inparticular,see#<URL:#foradiscussionofeachconfigurationdirective.#DoNOTsimplyreadtheinstructionsinherewithout#whattheydo. They'rehereonlyashintsorreminders. Ifyouareunsure#consulttheonlinedocs.Youhavebeenwarned.##Configurationandlogfilenames:Ifthefilenamesyouspecifyformany#oftheserver'scontrolfilesbeginwith"/"(or"drive:/"forWin32),the#serverwillusethatexplicitpath. Ifthefilenamesdo*not*begin#with"/",thevalueofServerRootisprepended--so"logs/foo_log"#withServerRootsetto"/usr/local/apache"willbeinterpretedbythe#serveras"/usr/local/apache/logs/foo_log".##ServerRoot:Thetopofthedirectorytreeunderwhichtheserver's#configuration,error,andlogfilesarekept.##Donotaddaslashatofthedirectory Ifyou#ServerRootatanon-localdisk,besuretopointtheLockFiledirective#atalocaldisk. IfyouwishtosharethesameServerRootformultiple#httpddaemons,youwillneedtochangeatleastLockFileandPidFile.ServerRoot##Listen:AllowsyoutobindApachetospecificIPaddressesand/or#ports,insteadofthedefault.Seealsothe<VirtualHost>#directive.#ChangethistoListenonspecificIPaddressesasshownbelowto#preventApachefromglommingontoallboundIPaddresses.##ListenListen##DynamicSharedObject(DSO)##TobeabletousethefunctionalityofamodulewhichwasbuiltasaDSOyou#havetoplacecorresponding`LoadModule'linesatthislocationsothe#directivescontainedinitareactuallyavailable_before_theyareused.#Staticallycompiledmodules(thoselistedby`httpd-l')donotneed#tobeloadedhere.##LoadModulefoo_modulemodules/mod_foo.so<IfModule<IfModule!mpm_winnt_module>#Ifyouwishhttpdtorunasadifferentuserroup,youmustrun#httpdasrootinitiallyanditwillswitch.##User/Group:Thename(or#number)oftheuser/grouptorunhttpdas.#Itisusuallygoodpracticetocreateadedicateduserandgroupfor#runninghttpd,aswithmostsystemservices.UserdaemonGroupdaemon#'Main'serverconfiguration#Thedirectivesinthissectionsetupthevaluesusedbythe'main'#server,whichrespondstoanyrequeststhataren'thandledbya#<VirtualHost>definition. Thesevaluesalsoprovidedefaultsfor#any<VirtualHost>containersyoumaydefinelaterinthefile.##Allofthesedirectivesmayappearinside<VirtualHost>containers,#inwhichcasethesedefaultsettingswillbeoverriddenforthe#virtualhostbeingdefined.##ServerAdmin:Youraddress,whereproblemswiththeservershouldbe ed.Thisaddressappearsonsomeserver-generatedpages,such#aserror s.e.g.adm###ServerNamegivesthenameandportthattheserverusestoidentify#Thiscanoftenbedeterminedautomatically,butwe mendyouspecify#itexplicitlytopreventproblemsduringstartup.##Ifyourhostdoesn'thavearegisteredDNSname,enteritsIPaddresshere.# Root:Thedirectoryoutofwhichyouwillserve s.Bydefault,allrequestsaretakenfromthisdirectory,but#symboliclinksandaliasesmaybeusedtopointtootherlocations.#Root##EachdirectorytowhichApachehasaccesscanbeconfiguredwithrespect#towhichservicesandfeaturesareallowedand/ordisabledinthat#directory(anditssubdirectories).#,weconfigurethe"default"tobeaveryrestrictivesetof#features.#<DirectoryOptionsFollowSymLinksAllowOverrideNoneOrderdeny,allowDenyfrom##Notethatfromthispointforwardyoumustspecifically#particularfeaturestobeenabled-soifsomething'snotworkingas#youmightexpect,makesurethatyouhavespecificallyenabledit#below.###Thisshouldbechangedtowhateveryouset Rootto.<Directory##PossiblevaluesfortheOptionsdirectiveare"None","All",#oranycombinationof: IndexesIncludesFollowSymLinksSymLinksifOwnerMatchExecCGIMultiViews#Notethat"MultiViews"mustbenamed*explicitly*"OptionsAll"#doesn'tgiveittoyou.##TheOptionsdirectiveisbothcomplicatedandimportant. Pleasesee##formoreinformation.OptionsIndexes##AllowOverridecontrolswhatdirectivesmaybeplacedin.htaccessfiles.#Itcanbe"All","None",oranycombinationofthekeywords: OptionsFileInfoAuthConfigLimit##Controlswhocangetstufffromthisserver.Orderallow,denyAllowfromall#DirectoryIndex:setsthefilethatApachewillserveifadirectory#isrequested.#<IfModuleDirectoryIndexindex.html##Thefollowinglinesprevent.htaccessand.htpasswdfilesfrombeing#viewedbyWebclients.#<FilesMatch"^\.ht">Orderallow,denyDenyfromall##ErrorLog:Thelocationoftheerrorlog#IfyoudonotspecifyanErrorLogdirectivewithina<VirtualHost>#container,errormessagesrelatingtothatvirtualhostwillbe#loggedhere. Ifyou*do*defineanerrorlogfilefora<VirtualHost>#container,thathost'serrorswillbeloggedthereandnothere.#ErrorLog##LogLevel:Controlthenumberofmessagesloggedtotheerror_log.#Possiblevaluesinclude:debug,info,notice,warn,error,crit,#alert,emerg.LogLevel<IfModulelog_config_module>#Thefollowingdirectivesdefinesomeformatnicknamesforusewith#aCustomLogdirective(seebelow).#LogFormat"%h%l%u%t\"%r\"%>s%b\"%{Referer}i\"\"%{User-Agent}i\""combinedLogFormat"%h%l%u%t\"%r\"%>s%b"common<IfModule#Youneedtoenablemod_logio.ctouse%IandLogFormat"%h%l%u%t\"%r\"%>s%b\"%{Referer}i\"\"%{User-Agent}i\"%I%O"##Thelocationandformatoftheaccesslogfile(CommonLogfileFormat).#Ifyoudonotdefineanyaccesslogfileswithina<VirtualHost>#container,theywillbeloggedhere. Contrariwise,ifyou*do*#defineper-<VirtualHost>accesslogfiles,transactionswillbe#loggedthereinand*not*inthisfile.CustomLog"logs/access_log"##Ifyoupreferalogfilewithaccess,agent,andrefererinformation#(CombinedLogfileFormat)youcanusethefollowing##CustomLog"logs/access_log"<IfModulealias_module>#Redirect:Allowsyoutolclientsabout sthatusedto#existinyourserver'snamespace,butdonotanymore.Theclient#willmakeanewrequestforthe atitsnewlocation.##Redirectpermanent/foo ##Alias:Mapswthsintofilesystempathsandisusedto#accesscontentthatdoesnotliveunderthe #Example:#Alias/wth/full/filesystem/path#Ifyouincludeatrailing/on/wththentheserverwill#requireittobepresentintheURL. Youwillalsolikely#needtoprovidea<Directory>sectiontoallowaccessto#thefilesystempath.##ScriptAlias:Thiscontrolswhichdirectoriescontainserverscripts.#ScriptAliasesareessentiallythesameasAliases,exceptthat#sinthedirectoryaretreatedasapplications#runbytheserverwhenrequestedratherthanasssenttothe#client. Thesamerulesabouttrailing"/"applytoScriptAlias#directivesastoAlias.<IfModulecgid_module>#ScriptSock:Onthreadedservers,designatethepathtotheUNIX#socketusedtocommunicatewiththeCGIdaemonofmod_cgid.#Scriptsock#"/usr/local/apache/cgi-bin"shouldbechangedtowhateveryourScriptAliased#CGIdirectoryexists,ifyouhavethatconfigured.#<Directory"/usr/local/apache/cgi-bin">AllowOverrideNoneOptionsNoneOrderallow,denyAllowfromall##DefaultType:thedefaultMIMEtypetheserverwillusefor#ifitcannototherwisedetermineone,suchasfromfilenameextensions.#IfyourservercontainsmostlytextorHTML s,"text/plain"is#agoodvalue. Ifmostofyourcontentisbinary,suchasapplications#orimages,youmaywanttouse"application/octet-stream"insteadto#keepbrowsersfromtryingtodisplaybinaryfilesasthoughtheyare#text.#<IfModulemime_module>#TypesConfigpointstothefilecontainingthelistofmapsfrom#filenameextensiontoMIME-type.###AddTypeallowsyoutoaddtooroverridetheMIMEconfiguration#filespecifiedinTypesConfigforspecificfiletypes.##AddTypeapplication/x-gzip.tgz#AddEncodingallowsyoutohavecertainbrowsers #informationonthefly.Note:Notallbrowserssupportthis.# press.Z#AddEncodingx-gzip.gz.tgz#IftheAddEncodingdirectivesabovearecommented-out,thenyou#probablyshoulddefinethoseextensionstoindicatemediatypes:# press##AddHandlerallowsyoutomapcertainfileextensionsto"handlers":#actionsunrelatedtofiletype.Thesecanbeeitherbuiltintotheserver#oraddedwiththeActiondirective(seebelow)##TouseCGIscriptsoutsideofScriptAliased#(Youwillalsoneedtoadd"ExecCGI"tothe"Options"directive.)#AddHandlercgi-script#Fortypemaps(negotiated#AddHandlertype-map##Filtersallowyoutoprocesscontentbeforeitissenttotheclient.#Toparse.shtmlfilesforserver-sideincludes#(Youwillalsoneedtoadd"Includes"tothe"Options"directive.)#AddTypetext/html.shtml#AddOutputFilterINCLUDES.shtml##Themod_mime_magicmoduleallowstheservertousevarioushintsfromthe#contentsofthefileitselftodetermineitstype. TheMIMEMagicFile#directivelsthemodulewherethehintdefinitionsarelocated.#MIMEMagicFile##Customizableerrorresponsescomeinthreeflavors:#1)plaintext2)localredirects3)externalredirects##Some#Error500"Theservermadeaboo 404 404"/cgi- 402http ##EnableMMAPandEnableSendfile:Onsystemsthatsupportit,#memory-maporthesendfilesyscallisusedtodeliver#files. Thisusuallyimprovesserverperformance,butmust#beturnedoffwhenservingfrom
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年度医疗服务合同
- 2024年国际快递服务代理与合作合同
- 2024年城市成品油配送服务合同
- 2024年度信息技术咨询服务合同
- 2024年度设备维修保养服务合同
- 2024年度货物采购合同标的质量保证与安全生产责任书
- 做课件步骤教学课件
- 仓库个人年终工作总结
- 2024国际货运代理及供应链管理服务合同
- 2024年建筑垃圾无害化处理合同
- 评茶员国家三级理论考试题库(近年真题300题)
- 船舶发展史 课件
- 小学养成教育内容序列细目
- 织物结构与性能课件:第三章 织物上机图与织物分析
- 研究思路图模板
- 无人机应用技术专业建设发展规划
- 职员员工行为规范检查表
- 中学德育课程体系
- Linux操作系统完整版课件全书电子教案教材课件(完整)
- 员工专业技术职级评定方案与评定细则1
- 幼儿绘本故事:《摩天轮》原版PPT课件
评论
0/150
提交评论