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

Linux»·¾³½ø³Ì¼äͨÐÅ ¹²ÏíÄÚ´æ(ÉÏ£©

   ¹²ÏíÄÚ´æ¿ÉÒÔ˵ÊÇ×îÓÐÓõĽø³Ì¼äͨÐÅ·½Ê½£¬Ò²ÊÇ×î¿ìµÄIPCÐÎʽ¡£Á½¸ö²»Í¬½ø³ÌA¡¢B¹²ÏíÄÚ´æµÄÒâ˼ÊÇ£¬Í¬Ò»¿éÎïÀíÄÚ´æ±»Ó³Éäµ½½ø³ÌA¡¢B¸÷×ԵĽø³ÌµØÖ·¿Õ¼ä¡£½ø³ÌA¿ÉÒÔ¼´Ê±¿´µ½½ø³ÌB¶Ô¹²ÏíÄÚ´æÖÐÊý¾ÝµÄ¸üУ¬·´Ö®ÒàÈ»¡£ÓÉÓÚ¶à¸ö½ø³Ì¹²Ïíͬһ¿éÄÚ´æÇøÓò£¬±ØÈ»ÐèҪijÖÖͬ²½»úÖÆ£¬»¥³âËøºÍÐźÅÁ¿¶¼¿ÉÒÔ¡£
   ²ÉÓù²ÏíÄÚ´æͨÐŵÄÒ»¸öÏÔ¶øÒ×¼ûµÄºÃ´¦ÊÇЧÂʸߣ¬ÒòΪ½ø³Ì¿ÉÒÔÖ±½Ó¶ÁдÄڴ棬¶ø²»ÐèÒªÈκÎÊý¾ÝµÄ¿½±´¡£¶ÔÓÚÏñ¹ÜµÀºÍÏûÏ¢¶ÓÁеÈͨÐÅ·½Ê½£¬ÔòÐèÒªÔÚÄں˺ÍÓû§¿Õ¼ä½øÐÐËĴεÄÊý¾Ý¿½±´£¬¶ø¹²ÏíÄÚ´æÔòÖ»¿½±´Á½´ÎÊý¾Ý[1]£ºÒ»´Î´ÓÊäÈëÎļþµ½¹²ÏíÄÚ´æÇø£¬ÁíÒ»´Î´Ó¹²ÏíÄÚ´æÇøµ½Êä³öÎļþ¡£Êµ¼ÊÉÏ£¬½ø³ÌÖ®¼äÔÚ¹²ÏíÄÚ´æʱ£¬²¢²»×ÜÊǶÁдÉÙÁ¿Êý¾Ýºó¾Í½â³ýÓ³É䣬ÓÐеÄͨÐÅʱ£¬ÔÙÖØн¨Á¢¹²ÏíÄÚ´æÇøÓò¡£¶øÊDZ£³Ö¹²ÏíÇøÓò£¬Ö±µ½Í¨ÐÅÍê±ÏΪֹ£¬ÕâÑù£¬Êý¾ÝÄÚÈÝÒ»Ö±±£´æÔÚ¹²ÏíÄÚ´æÖУ¬²¢Ã»ÓÐд»ØÎļþ¡£¹²ÏíÄÚ´æÖеÄÄÚÈÝÍùÍùÊÇÔÚ½â³ýÓ³Éäʱ²Åд»ØÎļþµÄ¡£Òò´Ë£¬²ÉÓù²ÏíÄÚ´æµÄͨÐÅ·½Ê½Ð§ÂÊÊǷdz£¸ßµÄ¡£
LinuxµÄ2.2.xÄÚºËÖ§³Ö¶àÖÖ¹²ÏíÄڴ淽ʽ£¬Èçmmap()ϵͳµ÷Óã¬Posix¹²ÏíÄڴ棬ÒÔ¼°ÏµÍ³V¹²ÏíÄÚ´æ¡£linux·¢Ðа汾ÈçRedhat 8.0Ö§³Ömmap()ϵͳµ÷Óü°ÏµÍ³V¹²ÏíÄڴ棬µ«»¹Ã»ÊµÏÖPosix¹²ÏíÄڴ棬±¾ÎĽ«Ö÷Òª½éÉÜmmap()ϵͳµ÷Óü°ÏµÍ³V¹²ÏíÄÚ´æAPIµÄÔ­Àí¼°Ó¦Óá£
1¡¢page cache¼°swap cacheÖÐÒ³ÃæµÄÇø·Ö£ºÒ»¸ö±»·ÃÎÊÎļþµÄÎïÀíÒ³Ã涼פÁôÔÚpage cache»òswap cacheÖУ¬Ò»¸öÒ³ÃæµÄËùÓÐÐÅÏ¢ÓÉstruct pageÀ´ÃèÊö¡£struct pageÖÐÓÐÒ»¸öÓòΪָÕëmapping £¬ËüÖ¸ÏòÒ»¸östruct address_spaceÀàÐͽṹ¡£page cache»òswap cacheÖеÄËùÓÐÒ³Ãæ¾ÍÊǸù¾Ýaddress_space½á¹¹ÒÔ¼°Ò»¸öÆ«ÒÆÁ¿À´Çø·ÖµÄ¡£
2¡¢ÎļþÓëaddress_space½á¹¹µÄ¶ÔÓ¦£ºÒ»¸ö¾ßÌåµÄÎļþÔÚ´ò¿ªºó£¬Äں˻áÔÚÄÚ´æÖÐΪ֮½¨Á¢Ò»¸östruct inode½á¹¹£¬ÆäÖеÄi_mappingÓòÖ¸ÏòÒ»¸öaddress_space½á¹¹¡£ÕâÑù£¬Ò»¸öÎļþ¾Í¶ÔÓ¦Ò»¸öaddress_space½á¹¹£¬Ò»¸öaddress_spaceÓëÒ»¸öÆ«ÒÆÁ¿Äܹ»È·¶¨Ò»¸öpage cache »òswap cacheÖеÄÒ»¸öÒ³Ãæ¡£Òò´Ë£¬µ±ÒªÑ°Ö·Ä³¸öÊý¾Ýʱ£¬ºÜÈÝÒ׸ù¾Ý¸ø¶¨µÄÎļþ¼°Êý¾ÝÔÚÎļþÄÚµÄÆ«ÒÆÁ¿¶øÕÒµ½ÏàÓ¦µÄÒ³Ãæ¡£
3¡¢½ø³Ìµ÷ÓÃmmap()ʱ£¬Ö»ÊÇÔÚ½ø³Ì¿Õ¼äÄÚÐÂÔöÁËÒ»¿éÏàÓ¦´óСµÄ»º³åÇø£¬²¢ÉèÖÃÁËÏàÓ¦µÄ·ÃÎʱêʶ£¬µ«²¢Ã»Óн¨Á¢½ø³Ì¿Õ¼äµ½ÎïÀíÒ³ÃæµÄÓ³Éä¡£Òò´Ë£¬µÚÒ»´Î·ÃÎʸÿռäʱ£¬»áÒý·¢Ò»¸öȱҳÒì³£¡£
4¡¢¶ÔÓÚ¹²ÏíÄÚ´æÓ³ÉäÇé¿ö£¬È±Ò³Òì³£´¦Àí³ÌÐòÊ×ÏÈÔÚswap cacheÖÐÑ°ÕÒÄ¿±êÒ³£¨·ûºÏaddress_spaceÒ


Ïà¹ØÎĵµ£º

LinuxÏÂApacheµÄ°²×°

µØÖ·£ºhttp://httpd.apache.org/
ÏÂÔصØÖ·£ºhttp://httpd.apache.org/download.cgi
1,½âѹËõ
tar -xzvf httpd-2.0.63.tar.gz
2,ÅäÖÃ
./configure --prefix=/usr/local/apache --enable-module=all --enable-shared=max
3,±àÒë
make
4,°²×°
make install
5,¹ÜÀí
apachectl start
apachectl stop
apachectl rest ......

Linux ÅжϻúÆ÷µÄ×Ö½Ú˳Ðò

#include <fcntl.h>
int main(void)
{
    typedef union un{
        short s;
        char c[sizeof(short)];
    }un;
    un myun;
    myun.s = 0x0102;
  ......

Linux sockaddr_in¸³Öµ

serv_addr.sin_family=AF_INET;
serv_addr.sin_port=htons(SERVPORT);
inet_pton(AF_INET,"127.0.0.1",&serv_addr.sin_addr);
IPµØַת»»º¯ÊýÓУºinet_pton,inet_addr,inet_aton,inet_ntoa£¬inet_ntop
Ç°Èý¸öÊǽ«ASCII×Ö·ûת»»³ÉÍøÂç×Ö½ÚÐò£»
×îºóÁ½¸öÊǽ«ÍøÂç×Ö½ÚÐòת»»³ÉASCII×Ö·û¡£
ÏÖÔÚÍƼöʹÓÃine ......

Linux±¾µØrootÃÜÂëÆƽⷽ·¨


£¨Ò»£©RedHat/CentOS/Fedora ϵͳÃÜÂëÆƽâ
¡¡¡¡1.ÔÚgrubÑ¡Ïî²Ëµ¥°´E½øÈë±à¼­Ä£Ê½¡£
¡¡¡¡2.±à¼­kernel ÄÇÐÐ×îºó¼ÓÉÏS£¨»òÕßSingle£©¡£
¡¡¡¡3.°´B£¬Æô¶¯µ½single-user mode¡£
¡¡¡¡4.½øÈëºóÖ´ÐÐÏÂÁÐÃüÁ
¡¡¡¡# mount -t proc proc /proc
¡¡¡¡# mount -o remount,rw /
¡¡¡¡#passwd
¡¡¡¡#sync
¡¡¡¡#reboot
£¨¶þ£©D ......

ÔÚLinux²Ù×÷ϵͳÏÂÐÞ¸ÄIP¡¢DNSºÍ·ÓÉÅäÖÃ


ÔÚLinux²Ù×÷ϵͳÏÂÐÞ¸ÄIP¡¢DNSºÍ·ÓÉÅäÖÃ
ZDNetÈí¼þƵµÀ2007-10-06×÷ÕߣºÈüµÏÍø | ÈüµÏÍø
±¾ÎĹؼü´Ê£ºÂ·ÓÉ DNS IP Linux
 
ifconfig eth0 ÐÂIP
È»ºó±à¼­/etc/sysconfig/network-scrIPts/ifcfg-eth0£¬ÐÞ¸ÄIP
Ò»¡¢ÐÞ¸ÄIPµØÖ·
[aeolus@db1 network-scrIPts]$ vi ifcfg-eth0
DEVICE=eth0
ONBOO ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ