1.apacheçä¼å
apacheçä¼å
码分找准支压线源码 æ们å¨ä½¿ç¨Apacheä½ä¸ºwebæå¡å¨çè¿ç¨ä¸ï¼åªæ对Apacheæå¡å¨è¿è¡éå½çä¼åé ç½®ï¼æè½è®©Apacheåæ¥åºæ´å¥½çæ§è½ï¼ååè¿æ¥è¯´ï¼å¦æApacheçé ç½®é常ç³ç³ï¼Apacheå¯è½æ æ³æ£å¸¸ä¸ºæ们æå¡ãå æ¤ï¼é对æ们çåºç¨éæ±å¯¹Apacheæå¡å¨çé ç½®è¿è¡ä¸å®çä¼åæ¯å¿ ä¸å¯å°çã码分找准支压线源码硬件åæä½ç³»ç»
码分找准支压线源码毫æ çé®ï¼è¦æ³è®©Apacheæå¡å¨åæ¥åºæ´å¥½çæ§è½ï¼é¦å å¿ é¡»å¾ä¿è¯ç¡¬ä»¶åæä½ç³»ç»è½å¤æ»¡è¶³Apacheæå¡å¨çè´è½½éè¦ãå¦æç±äºç¡¬ä»¶åæä½ç³»ç»åå 导è´Apacheçè¿è¡æ§è½åå°è¾å¤§çå½±åï¼å³ä½¿å¯¹Apacheæå¡å¨æ¬èº«ä¼åé ç½®å¾å好ä¹æ æµäºäºï¼ãæ³è¦é©¬å¿è·å¾å¥½ï¼åæ³é©¬å¿ä¸åèãå½ç¶æ¯è¡ä¸éçã
码分找准支压线源码ä¸è¬èè¨ï¼å½±åwebæå¡å¨æ§è½çæ大çå ç´ æ¯å åãå½å åä¸è¶³æ¶ï¼æä½ç³»ç»å°ä¼ä½¿ç¨å å交æ¢æºå¶ãå å交æ¢æºå¶ï¼ç®èè¨ä¹ï¼å°±æ¯å°æ¬å°ç£ççä¸é¨åä½ä¸ºèæå å空é´ä¾ç¨åºä½¿ç¨ãwebæå¡å¨æ³è¦æ´å¥½å°ææç¨æ·æå¡ï¼åå ¶åºè¯¥æ°¸è¿ä¸è¦ä½¿ç¨å å交æ¢æºå¶ï¼å¦åå ¶æ§è½å°ä¼åå°è¾å¤§çå½±åãä¸ä» å¦æ¤ï¼ç±äºæå¡å¨ä½¿ç¨äºå å交æ¢æºå¶æ产ççãæ»åãï¼ãæ»åãçç´æ¥åæå°±æ¯è®©ç¨æ·æè§ç½ç«ç访é®é度å¾æ ¢ï¼æ¤æ¶ç¨æ·ææå¯è½ä¼ç¹å»ãåæ¢ãæè ãå·æ°ãï¼å¦æç¨æ·ä¸åå°ç¹å»ãå·æ°ãï¼å°ä¼ç»æå¡å¨å¸¦æ¥æ´å¤§çè´è½½ï¼ä»èè¿å ¥ä¸ä¸ªæ¶æ§å¾ªç¯ã
码分找准支压线源码对äºApacheæå¡å¨çå åéæ±éï¼æ们å¯ä»¥éè¿æä½ç³»ç»ç¸å ³å½ä»¤æ¥çæå¡å¨æ£å¸¸è¿è¡æ¶æ¯ä¸ªä¸ºç¨æ·æå¡çè¿ç¨(æ线ç¨)å¹³åå ç¨å¤å°çå åï¼åæ ¹æ®éæ±æè ç¸å ³æ°æ®å¾åºå个æå¡å¨æè¦æ¯æçæ大并åè´è½½æ°ï¼ä»è计ç®åºApacheæå¡å¨çå åéæ±éã为Apacheæå¡å¨åé çå åæ好è½å¤å¤§äºè®¡ç®å¾æ¥çéæ±éã
码分找准支压线源码é¤æ¤ä¹å¤ï¼ç¡¬ä»¶æ好è½å¤ä¿è¯æ足å¤å¿«çCPUã足å¤å¿«çç½å¡(足å¤ç带宽)ã足å¤å¿«è¶³å¤å¤§ç硬çãè¿éçã足å¤ãæ¯æè½å¤æ»¡è¶³webåºç¨çå®é éæ±ã
码分找准支压线源码è³äºæä½ç³»ç»ï¼æ好è½å¤éæ©ä¸ä¸ªæå©äºæå¡å¨è¿è¡çææ°æ稳å®ççæ¬å¹¶å®è£ 好äºå¯¹åºçè¡¥ä¸ç¨åºãæ¯ç«ï¼éçæ¶ä»£çåå±ï¼æä½ç³»ç»ä¹å¨ä¸æè¿æ¥ã许å¤æä½ç³»ç»ååé½æä¾äºå¯ä»¥æ¾èæ¹åæ§è½çTCPåè®®æ å线ç¨åºãä¾å¦ï¼å¦æä½ çæä½ç³»ç»æ¯æsendfile()ç³»ç»è°ç¨ï¼Apache 2.xæå¡å¨å¯ä»¥ä½¿ç¨sendfile()ä»èæ´å¿«å°åééæå 容并ä¸å ç¨è¾å°çCPUæ¶é´ã
码分找准支压线源码ä¼åApacheé ç½®
码分找准支压线源码1.å°½é使ç¨IPå°å代æ¿åå
码分找准支压线源码å¨Apacheçé ç½®æ件ä¸ï¼æ许å¤å¯ä»¥éå¯¹å ·ä½è¯·æ±æ¥æºè¿è¡ç¸åºæä½çé ç½®ï¼ä¾å¦ allow from mini.com表示å 许åå为mini.comçç¨æ·è®¿é®ãå¨è¿ç§æ åµä¸ï¼å¦ææ们ç¥é该ååæ主æºåä¸æ个IPå°åä¸ä¸å¯¹åºï¼åæ好使ç¨å ·ä½çIPå°åæ¥ä»£æ¿ååãå¦åApacheæå¡å¨å°è¦è¿è¡å¤æ¬¡DNSæ¥è¯¢æ¥ç¡®å®è¯¥ååæ主æºåæ对åºçIPå°åã 注æï¼å¯è½åå¨ä¸äºä¾å¤æ åµï¼ä¾å¦ä¸ä¸ªIPå°å对åºå¤ä¸ªååï¼æè ä¸ä¸ªåå对åºå¤ä¸ªIPå°åæè 对åºä¸ä¸ªååçIPå°åï¼æ¤æ¶ä»ç¶è¦ä½¿ç¨ååæ主æºåãä¸è¬èè¨ï¼åªæååæ主æºåä¸IPå°åå ·æä¸ä¸å¯¹åºå ³ç³»æ¶ï¼æ使ç¨IPå°åæ¥ä»£æ¿ååãè¯·æ ¹æ®å®é æ åµä½åºéæ©ã 2.å¯ç¨FollowSymLinksé项
码分找准支压线源码å½Apacheå¤ç请æ±æ¶ï¼å¦æ对åºç请æ±æ件æå¨ç®å½æ²¡æå¯ç¨FollowSymLinksé项ï¼æ使ç¨äºSymLinksIfOwnerMatché项ï¼Apacheå°±å¿ é¡»æ§è¡é¢å¤çç³»ç»è°ç¨æ¥éªè¯ç¬¦å·è¿æ¥çå®å ¨æ§ãæ件åçæ¯ä¸ä¸ªç»æé¨åé½éè¦ä¸æ¬¡é¢å¤çè°ç¨ãå æ¤ï¼å¦æå¨å®å ¨æ§å 许çæ åµä¸ï¼ä¸ºäºå¾å°æ´å è¯å¥½çè¿è¡æ§è½ï¼åºå½æ¾å¼å¯¹ç¬¦å·è¿æ¥çä¿æ¤ï¼å¨ææå°æ¹é½è®¾ç½®FollowSymLinksï¼å¹¶æ¾å¼ä½¿ç¨SymLinksIfOwnerMatchã #å¯ç¨FollowSymLinksé项ï¼å¦æåç®å½æ²¡æé¢å¤ç设置ï¼å°ä¼ç»§æ¿è¯¥è®¾ç½®
码分找准支压线源码<Directory />
码分找准支压线源码Options FollowSymLinks
码分找准支压线源码</Directory> 3.ç¦ç¨AllowOverride
码分找准支压线源码å¦æApacheçé ç½®æ件ä¸å 许äºAllowOverrideæ令ï¼åApacheå¨å¤çæ¯ä¸ªè¯·æ±è·¯å¾æ¶ï¼é½ä¼å°è¯å¯¹æ件路å¾çæ¯ä¸ä¸ªç»æé¨åé½æå¼è¯¥ç®å½ä¸ç.htaccessæ件ã
码分找准支压线源码ä¾å¦ï¼å½ç¨æ·è¯·æ±è®¿é®æå¡å¨ä¸ç/static/test/hello.htmlï¼åApacheå°ä¼å°è¯æå¼/static/test/.htaccessã/static/.htaccessã/.htaccessä¸ä¸ªæ件ãä»èå½±åæå¡å¨çè¿è¡æ§è½ã
码分找准支压线源码å æ¤ï¼å¦æå½åç¨æ·æ¥æApacheé ç½®æ件çç¼è¾æéï¼å»ºè®®å°.htaccessæ件ä¸çé ç½®å 容ç´æ¥åå¨Apache对åºçé ç½®æ件(ä¸è¬ä¸ºwareãmpmt_os2ãmpm_preforkãmpm_winntãmpm_workerãå¦ææ¡ä»¶å 许ï¼æ们å¯ä»¥æ ¹æ®å®é éæ±å°æå®çMPM模åç¼è¯è¿æ们èªå·±çApacheä¸(Apacheçæºç æ¯å¼æ¾çï¼å 许ç¨æ·èªè¡ç¼è¯)ãä¸è¿ï¼å¦æå¨ç¼è¯æ¶æ们没æéæ©ï¼Apacheå°æç §å¦ä¸è¡¨æ ¼æ ¹æ®ä¸åçæä½ç³»ç»èªè¡éæ©å¯¹åºçMPM模åï¼è¿ä¹æ¯Apacheé对ä¸åå¹³å°æ¨è使ç¨çMPM模åã ä¸åæä½ç³»ç»ä¸é»è®¤çMPM模å æä½ç³»ç» MPM模å æè¿° Windows mpm_winnt ä¸ç¨ä»ç»äºå§:) Unix/Linux mpm_prefork ä¸ç¨ä»ç»äºå§:) BeOS mpm_beos ç±Beå ¬å¸å¼åçä¸ç§å¤åªä½æä½ç³»ç»ï¼å®æ¹çå·²åæ¢æ´æ°ã Netware mpm_netware ç±NOVELLå ¬å¸æ¨åºçä¸ç§ç½ç»æä½ç³»ç» OS/2 mpmt_os2 ä¸ç§æåç±å¾®è½¯åIBMå ±åå¼åçæä½ç³»ç»ï¼ç°ç±IBMåç¬å¼å(微软æ¾å¼OS/2ï¼è½¬èå¼åWindows) mpm_event模åå¯ä»¥çä½æ¯mpm_worker模åçä¸ä¸ªåç§ï¼ä¸è¿å ¶å ·æå®éªæ§è´¨ï¼ä¸è¬ä¸æ¨è使ç¨ã
码分找准支压线源码å½ç¶ï¼Apacheå¨å ¶å®æ¹ç½ç«ä¸ä¹æä¾äºæ ¹æ®ä¸åæä½ç³»ç»å·²ç»ç¼è¯å¥½å¯¹åºMPM模åçæåApacheãä½ å¯ä»¥ç¹å»æ¤å¤è¿å ¥Apacheå®æ¹ç½ç«ä¸è½½ã
码分找准支压线源码æ¤å¤ï¼å¦ææ们æ³è¦ç¥éæ个Apacheå é¨ä½¿ç¨çæ¯ä½ç§MPM模åï¼æ们å¯ä»¥ä»¥å½ä»¤è¡çæ¹å¼è¿å ¥Apacheå®è£ ç®å½\binï¼ç¶åé®å ¥å½ä»¤wareçé»è®¤å¼æ¯ãæ¢ç¶è¿ä¸ªMPMåªè¿è¡åç¬ä¸ä¸ªåè¿ç¨ï¼æ¤MPMå½ç¶äº¦åºäºæ´ä¸ªæå¡å¨çè§ç©ºé²çº¿ç¨æ°ãmpm_beosåmpmt_os2çå·¥ä½æ¹å¼ä¸mpm_netwareå·®ä¸å¤ï¼mpm_beosçé»è®¤å¼æ¯1ï¼mpmt_os2çé»è®¤å¼æ¯5ã) MaxSpareThreadså¤äºç©ºé²ç¶æçæ大线ç¨æ°ã
码分找准支压线源码(注ï¼ä¸åçMPM对è¿ä¸ªæ令çå¤çæ¯ä¸ä¸æ ·çï¼mpm_workerçé»è®¤å¼æ¯ãè¿ä¸ªMPMå°åºäºæ´ä¸ªæå¡å¨çè§ç©ºé²çº¿ç¨æ°ãå¦ææå¡å¨ä¸æ»ç空é²çº¿ç¨æ°å¤ªå¤ï¼åè¿ç¨å°ææ»å¤ä½ç空é²çº¿ç¨ãmpm_netwareçé»è®¤å¼æ¯ãæ¢ç¶è¿ä¸ªMPMåªè¿è¡åç¬ä¸ä¸ªåè¿ç¨ï¼æ¤MPMå½ç¶äº¦åºäºæ´ä¸ªæå¡å¨çè§ç©ºé²çº¿ç¨æ°ãmpm_beosåmpmt_os2çå·¥ä½æ¹å¼ä¸mpm_netwareå·®ä¸å¤ï¼mpm_beosçé»è®¤å¼æ¯ï¼mpmt_os2çé»è®¤å¼æ¯ã) å¤æ³¨ï¼ServerLimit表示Apacheå 许å建çæ大è¿ç¨æ°ãå¼å¾æ³¨æçæ¯ï¼Apacheå¨ç¼è¯æ¶å é¨æä¸ä¸ªç¡¬éå¶ServerLimit(对äºmpm_prefork模å为ServerLimit)ãä½ ä¸è½è¶ è¶è¿ä¸ªéå¶ã
码分找准支压线源码使ç¨è¿ä¸ªæ令æ¶è¦ç¹å«å½å¿ãå¦æå°ServerLimit设置æä¸ä¸ªé«åºå®é éè¦è®¸å¤çå¼ï¼å°ä¼æè¿å¤çå ±äº«å å被åé ãå¦æå°ServerLimitåMaxClients设置æè¶ è¿ç³»ç»çå¤çè½åï¼Apacheå¯è½æ æ³å¯å¨ï¼æè ç³»ç»å°åå¾ä¸ç¨³å®ã 注æï¼å¨é ç½®ç¸å ³åæ°æ¶ï¼è¯·å ä¿è¯æå¡å¨å ·å¤è¶³å¤ç硬件æ§è½(ä¾å¦ï¼CPUãå åç)ãå¦æåç°èªå¯å¨åï¼éçæå¡å¨çè¿è¡æ¶é´å¢å ï¼æå¡å¨çå åå ç¨ä¹éä¹å¢å ï¼å¯è½æ¯ç¨åºä¸åºç°å åæ³é²ï¼è¯·åä¸è°æ´åæ°MaxRequestsPerChildçå¼ä»¥éä½å åæ³é²å¸¦æ¥çå½±åï¼ç¶å尽快æ¾åºç¨åºä¸çé®é¢ä¹æå¨ã
码分找准支压线源码码分找准支压线源码