Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Linux»·¾³µÄAMP°²×° MEMCACHED°²×°


MEMCACHED°²×°
Ò»¡¢·þÎñ¶Ë¡£ÏÈ°²×°libevent£¬ÔÙ°²×°memcached¡££¨×¢£ºlibeventÊÇÒ»Ì׿çƽ̨µÄʼþ´¦Àí½Ó¿ÚµÄ·â×°£¬Äܹ»¼æÈÝ°üÀ¨£ºWindows/Linux/BSD/SolarisµÈ²Ù×÷ϵͳµÄʼþ´¦Àí£©
1¡¢ÏÂÔØ×îа汾µÄlibeventºÍmemcached£¬±ÊÕߵݲװĿ¼Ϊ/soft
>cd /soft
>wget http://www.dange.com/memcached/dist/memcached-1.4.0.tar.gz
>wget http://www.monkey.org/~provos/libevent-1.4.12-stable.tar.gz
2¡¢°²×°libevent
>tar -zxvf libevent-1.4.12-stable.tar.gz
>cd libevent-1.4.12-stable
>./configure --prefix=/opt/libevent£¨×¢£ºÖ¸¶¨°²×°Ä¿Â¼£©
>make
>make install
3¡¢°²×°memcached
>tar -zxvf memcached-1.4.0.tar.gz
>cd memcached-1.4.0
>./configure --prefix=/opt/memcached --with-libevent=/opt/libevent
>make
>make install
4¡¢Æô¶¯memcached
>/opt/memcached/bin/ -d -m 10 -u root -l 192.168.0.35 -p 12000
×¢£º
Èç¹ûÆô¶¯Ê§°Ü£¬ÌáʾûÓÐÕÒµ½libeventÀ©Õ¹¿âµÄ»°£¬½â¾ö·½·¨£º¸´ÖÆlibeventÀ©Õ¹¿âµ½memcached²éÕÒ·¾¶£¬>ln -s
/opt/libevent/lib/libevent-1.4.so.2 /usr/lib/libevent-1.4.so.2¡£
Æô¶¯²ÎÊý˵Ã÷£º-dÆô¶¯Ò»¸öÊØ»¤½ø³Ì£¬-m·ÖÅä¸ømemcachedʹÓõÄÄÚ´æMBÊýÁ¿£¬-uÔËÐÐmemcachedµÄÓû§£¬-l¼àÌýµÄ·þÎñÆ÷IPµØÖ·£¬-p¼àÌý¶Ë¿Ú£¬ÆäËûÉèÖÃÇë²Î¿´Êֲᡣ
¶þ¡¢PHP¿Í»§¶Ë£¬Liunx»·¾³ÔÚhttp://pecl.php.net
ÏÂÔØPHPÀ©Õ¹¿â£¬WindowsÈ¥ÏÂÔØphp_memcache.dllÖÁPHPÀ©Õ¹Îļþ¼Ð£¬ÅäÖÃphp.ini£¬¼´¿É¡£µ±È»¹»Ç¿µÄ»°£¬°´ÕÕmemcachedЭÒé×Ô¼ºÐ´¡£
Èý¡¢MemcacheÔËÓÃ
<?php
$m = new Memcache;
$m->set('val1', 'Hello Memcached!', 0, 60);
echo $m->get('val1');
……
?>
ËÄ¡¢Memcached²¿·ÖÌØÐÔºÍÏÞÖÆ
1¡¢ÔÚMemcachedÖпÉÒÔ±£´æµÄitemÊý¾ÝÁ¿Ã»ÓÐÏÞÖÆ£¬Ö»ÒªÄÚ´æ×ã¹»
2¡¢Memcachedµ¥½ø³Ì×î´óʹÓÃÄÚ´æÊÇ2G£¬ÒªÊ¹Óøü¶àÄڴ棬¿ÉÒÔ·Ö¶à¸ö¶Ë¿Ú¿ªÆô¶à¸öMemcached½ø³Ì
3¡¢×î´ó30ÌìµÄÊý¾Ý¹ýÆÚʱ¼ä£¬ÉèÖÃΪÓÀ¾ÃÒ²ÊÇ30Ìì¹ýÆÚ£¬³£Á¿REALTIME_MAXDELTA 60*60*24*30¿ØÖÆ
4¡¢×î´ó¼ü³¤250×Ö½Ú£¬>250½«ÎÞ·¨´æ´¢£¬³£Á¿KEY_MAX_LENGTH 250¿ØÖÆ
5¡¢µ¥¸öitem×î´óÊý¾ÝÊÇ1MB£¬>1MBÎÞ·¨´æ´¢£¬³£Á¿POWER_BLOCK 1048576¿ØÖÆ£¬Ä¬ÈÏÊÇslab´óС
6¡¢×î´óͬʱÁ¬½ÓÊý200£¬Í¨¹ýconn_init()ÖеÄfreetotal¿ØÖÆ£¬×î´óÈíÁ¬½ÓÊý1024£¬Í¨¹ýsettings.maxconns=1024¿ØÖ


Ïà¹ØÎĵµ£º

ǶÈëʽLinuxÎļþϵͳ¼°Æä´æ´¢»úÖÆ·ÖÎö

¡¡Ç¶ÈëʽϵͳÓëͨÓÃPC»ú²»Í¬£¬Ò»°ãûÓÐÓ²ÅÌÕâÑùµÄ´æ´¢É豸¶øÊÇʹÓÃFlashÉÁ´æоƬ¡¢Ð¡ÐÍÉÁ´æ¿¨µÈרΪǶÈëʽϵͳÉè¼ÆµÄ´æ´¢×°Ö㬱¾ÎÄ·ÖÎöÁËǶÈëʽϵͳÖг£ÓõĴ洢É豸¼°Æä¹ÜÀí»úÖÆ£¬½éÉÜÁ˳£ÓõĻùÓÚFLASHµÄÎļþϵͳÀàÐÍ¡£
     1£®Ç¶Èëʽϵͳ´æ´¢É豸¼°Æä¹ÜÀí»úÖÆ·ÖÎö
   
¡¡¡¡ ¹¹ ......

ϵͳѧϰLinuxµÄʮһµã½¨Ò飨ת£©

Ò»¡¢´Ó»ù´¡¿ªÊ¼ ¡¡¡¡³£³£ÓÐЩÅóÓÑÔÚLinuxÂÛ̳ÎÊһЩÎÊÌ⣬²»¹ý£¬ÆäÖдó¶àÊýµÄÎÊÌⶼÊǺܻùµÄ¡£ÀýÈ磺ΪʲôÎÒʹÓÃÒ»¸öÃüÁîµÄʱºò£¬ÏµÍ³¸æËßÎÒÕÒ²»µ½¸ÃĿ¼£¬ÎÒÒªÈçºÎÏÞÖÆʹÓÃÕßµÄȨÏÞµÈÎÊÌ⣬ÕâЩÎÊÌâÆäʵ¶¼²»ÊǺÜÄѵģ¬Ö»ÒªÁ˽âÁËLinuxµÄ»ù´¡Ö®ºó£¬Ó¦¸Ã¾Í¿ÉÒÔºÜÇáÒ׵Ľâ¾öµôÕâ·½ÃæµÄÎÊÌâ¡£¶øÓÐЩÅóÓÑÃdz£³£Ò»½Ó´¥Linux¾ÍÊÇ ......

Linux»·¾³µÄAMP°²×° APACHE°²×°


2¡¢APACHEµÄ°²×°
1£©µ±È»»¹ÊÇÏÂÔØÔ´Âë°ü£¬È磺httpd-2.0.55.tar.gz£¬µØÖ·×Ô¼ºÕÒ……
2£©½âѹËõ£¬>tar -zxvf httpd-2.0.55.tar.gz
3£©½øÈë½âѹºóµÄhttpd-2.0.55£¬>cd httpd-2.0.55
4£©°²×°ÅäÖã¬>./configure --prefix=/opt/apache --enable-cgi
5£©±àÒ룬>make
6£©°²×°£¬>make install ......

Linux»·¾³µÄAMP°²×° mcrypt°²×°


4¡¢mcrypt°²×°
1£©°²×°mcrypt֮ǰ£¬±ØÐë°²×°libmcryptºÍmhash£¬ÏÈÈ¥http://www.sourceforge.net
ÏÂÔØLibmcrypt£¬mhash£¬mcrypt°²×°°ü
2£©ÏÈ°²×°Libmcrypt
     >tar -zxvf libmcrypt-2.5.8.tar.gz
     >cd libmcrypt-2.5.8
     >./conf ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ