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

linuxÏÂ¶à½ø³Ì¡¢¶àÏ̱߳à³Ì


linuxϽø³Ì
 
£¨Ò»£© Àí½âLinuxϽø³ÌµÄ½á¹¹
¡¡¡¡ LinuxÏÂÒ»¸ö½ø³ÌÔÚÄÚ´æÀïÓÐÈý²¿·ÝµÄÊý¾Ý£¬¾ÍÊÇ“Êý¾Ý¶Î”£¬“¶ÑÕ»¶Î”ºÍ“´úÂë¶Î”£¬Æäʵѧ¹ý»ã±àÓïÑÔµÄÈËÒ»¶¨ÖªµÀ£¬Ò»°ãµÄCPUÏóI386£¬¶¼ÓÐÉÏÊöÈýÖֶμĴæÆ÷£¬ÒÔ·½±ã²Ù×÷ϵͳµÄÔËÐС£“´úÂë¶Î”£¬¹ËÃû˼Ò壬¾ÍÊÇ´æ·ÅÁ˳ÌÐò´úÂëµÄÊý¾Ý£¬¼ÙÈç»úÆ÷ÖÐÓÐÊý¸ö½ø³ÌÔËÐÐÏàͬµÄÒ»¸ö³ÌÐò£¬ÄÇôËüÃǾͿÉÒÔʹÓÃͬһ¸ö´úÂë¶Î¡£
¡¡¡¡ ¶ÑÕ»¶Î´æ·ÅµÄ¾ÍÊÇ×Ó³ÌÐòµÄ·µ»ØµØÖ·¡¢×Ó³ÌÐòµÄ²ÎÊýÒÔ¼°³ÌÐòµÄ¾Ö²¿±äÁ¿¡£¶øÊý¾Ý¶ÎÔò´æ·Å³ÌÐòµÄÈ«¾Ö±äÁ¿£¬³£ÊýÒÔ¼°¶¯Ì¬Êý¾Ý·ÖÅäµÄÊý¾Ý¿Õ¼ä£¨±ÈÈçÓÃmallocÖ®ÀàµÄº¯ÊýÈ¡µÃµÄ¿Õ¼ä£©¡£ÕâÆäÖÐÓÐÐí¶àϸ½ÚÎÊÌ⣬ÕâÀïÏÞÓÚÆª·ù¾Í²»¶à½éÉÜÁË¡£ÏµÍ³Èç¹ûͬʱÔËÐÐÊý¸öÏàͬµÄ³ÌÐò£¬ËüÃÇÖ®¼ä¾Í²»ÄÜʹÓÃͬһ¸ö¶ÑÕ»¶ÎºÍÊý¾Ý¶Î¡£
£¨¶þ£© ÈçºÎʹÓÃfork
¡¡¡¡ ÔÚLinuxϲúÉúеĽø³ÌµÄϵͳµ÷ÓþÍÊÇforkº¯Êý£¬Õâ¸öº¯ÊýÃûÊÇÓ¢ÎÄÖГ·Ö²æ”µÄÒâ˼¡£ÎªÊ²Ã´È¡Õâ¸öÃû×ÖÄØ£¿ÒòΪһ¸ö½ø³ÌÔÚÔËÐÐÖУ¬Èç¹ûʹÓÃÁËfork£¬¾Í²úÉúÁËÁíÒ»¸ö½ø³Ì£¬ÓÚÊǽø³Ì¾Í“·Ö²æ”ÁË£¬ËùÒÔÕâ¸öÃû×ÖÈ¡µÃºÜÐÎÏó¡£ÏÂÃæ¾Í¿´¿´ÈçºÎ¾ßÌåʹÓÃfork£¬Õâ¶Î³ÌÐòÑÝʾÁËʹÓÃforkµÄ»ù±¾¿ò¼Ü£º
void main(){
int i;
if ( fork() == 0 ) {
/* ×Ó½ø³Ì³ÌÐò */
for ( i = 1; i <1000; i ++ )
printf("This is child process\n");
}
else {
/* ¸¸½ø³Ì³ÌÐò*/
for ( i = 1; i <1000; i ++ )
printf("This is process process\n");
}
}
¡¡¡¡ ³ÌÐòÔËÐкó£¬Äã¾ÍÄÜ¿´µ½ÆÁÄ»ÉϽ»Ìæ³öÏÖ×Ó½ø³ÌÓ븸½ø³Ì¸÷´òÓ¡³öµÄһǧÌõÐÅÏ¢ÁË¡£Èç¹û³ÌÐò»¹ÔÚÔËÐÐÖУ¬ÄãÓÃpsÃüÁî¾ÍÄÜ¿´µ½ÏµÍ³ÖÐÓÐÁ½¸öËüÔÚÔËÐÐÁË¡£
¡¡¡¡ ÄÇôµ÷ÓÃÕâ¸öforkº¯Êýʱ·¢ÉúÁËÊ²Ã´ÄØ£¿Ò»¸ö³ÌÐòÒ»µ÷ÓÃforkº¯Êý£¬ÏµÍ³¾ÍΪһ¸öеĽø³Ì×¼±¸ÁËǰÊöÈý¸ö¶Î£¬Ê×ÏÈ£¬ÏµÍ³ÈÃеĽø³ÌÓë¾ÉµÄ½ø³ÌʹÓÃͬһ¸ö´úÂë¶Î£¬ÒòΪËüÃǵijÌÐò»¹ÊÇÏàͬµÄ£¬¶ÔÓÚÊý¾Ý¶ÎºÍ¶ÑÕ»¶Î£¬ÏµÍ³Ôò¸´ÖÆÒ»·Ý¸øÐµĽø³Ì£¬ÕâÑù£¬¸¸½ø³ÌµÄËùÓÐÊý¾Ý¶¼¿ÉÒÔÁô¸ø×Ó½ø³Ì£¬µ«ÊÇ£¬×Ó½ø³ÌÒ»µ©¿ªÊ¼ÔËÐУ¬ËäÈ»Ëü¼Ì³ÐÁ˸¸½ø³ÌµÄÒ»ÇÐÊý¾Ý£¬µ«Êµ¼ÊÉÏÊý¾ÝÈ´ÒѾ­·Ö¿ª£¬Ï໥֮¼ä²»ÔÙÓÐÓ°ÏìÁË£¬Ò²¾ÍÊÇ˵£¬ËüÃÇÖ®¼ä²»ÔÙ¹²ÏíÈκÎÊý¾ÝÁË¡£¶øÈç¹ûÁ½¸ö½ø³ÌÒª¹²ÏíʲôÊý¾ÝµÄ»°£¬¾ÍҪʹÓÃÁíÒ»Ì׺¯Êý£¨shmget£¬shmat£¬shmdtµÈ£©À´²Ù×÷¡£ÏÖÔÚ£¬ÒѾ­ÊÇÁ½¸ö½ø³ÌÁË£¬¶ÔÓÚ¸¸½ø³Ì£¬forkº¯Êý·µ»ØÁË×Ó³ÌÐòµÄ½ø³ÌºÅ£¬¶ø¶ÔÓÚ×Ó³ÌÐò£¬forkº¯ÊýÔò·µ»ØÁ㣬ÕâÑù£¬¶ÔÓÚ³ÌÐò£¬Ö»ÒªÅ


Ïà¹ØÎĵµ£º

Linux ƽ̨Ï MYSQL°²×° Æô¶¯ mysqlÃüÁî

MYSQL°²×°
//½âѹ±àÒë°²×°
# tar xzvf mysql-5.0.27.tar.gz
# cd mysql-5.0.27
# ./configure -prefix=/home/redadmin/mysql
# make
# make install
# cd /home/redadmin/mysql/
# cp share/mysql/my-medium.cnf ./
# mv my-medium.cnf my.cnf
// my.confÎļþÐÞ¸Ä
# vi my.cnf
ÐÞ¸Äǰ£º
port  &nb ......

linux jdk °²×°ÓиÐ

×¢Òâ×Ô¼ºµÄÄں˰汾 ÓÚ jdk °æ±¾ÎÊÌâ  £»»¹ÓÐ ¾ÍÊÇ Òª½âѹµ½ /usr/javaĿ¼Ï ºÜÖØÒª£¬Òª²»È»µÈ×ųԿàÍ·£»
Ò»¡¢ÏÂÔØJDK

×Ô¼ºÏÂÔØ°É£¬²½Öè²»ÓÃдÁ˰ɣ»ÎÒÏÂÔØµÄÊÇjdk
-1_6_0_11-linux-i586.bin
¶þ¡¢°²×°


(1)ÔÚusrÏÂн¨Ò»¸öjavaÎļþ¼Ð
#mkdir /usr/java
(2)ÎÒÓõÄWinSCP½«JDK
Îļþ·ÅÈ ......

ʹÓà /sys Îļþϵͳ·ÃÎÊ Linux ÄÚºË

sysfs ÊÇ Linux ÄÚºËÖÐÉè¼Æ½ÏеÄÒ»ÖÖÐéÄâµÄ»ùÓÚÄÚ´æµÄÎļþϵͳ£¬ËüµÄ×÷ÓÃÓë proc ÓÐЩÀàËÆ£¬µ«³ýÁËÓë
proc ÏàͬµÄ¾ßÓв鿴ºÍÉ趨Äں˲ÎÊý¹¦ÄÜÖ®Í⣬»¹ÓÐΪ Linux ͳһÉ豸ģÐÍ×÷Ϊ¹ÜÀíÖ®Óá£Ïà±ÈÓÚ proc Îļþϵͳ£¬Ê¹Óà sysfs
µ¼³öÄÚºËÊý¾ÝµÄ·½Ê½¸üΪͳһ£¬²¢ÇÒ×éÖ¯µÄ·½Ê½¸üºÃ£¬ËüµÄÉè¼Æ´Ó proc ÖÐÎüÈ¡Á˺ܶà½Ìѵ¡£±¾Îľ ......

linuxÏ£¬ÉèÖÃIPµØÖ·£¬ÖØÆô»úÆ÷ÓÐЧ

1. vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=example.com
GATEWAY=192.168.0.1
NDS1=219.150.32.132  // dns ·þÎñÆ÷µØÖ·
2.  vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:15:E9:B1:32:AF
BOOTPROTO=static
IPADDR=192.168.0.188
NETMASK=255. ......

LinuxÏÂÍü¼ÇMySQL rootÃÜÂëµÄ½â¾ö·½°¸

×î½üʵÑéÊÒÄÚ²¿µÄmysqlµÄrootÃÜÂë±»ÐÞ¸ÄÁË£¬ÐèÒªÏë°ì·¨ÐÞ¸ÄÐÂÃÜÂë¡£·½·¨ÈçÏ£º
1£¬ ¹Ø±Õmysql·þÎñ
/etc/init.d/mysqld stop
2£¬Ê¹ÓÖskip-grant-tablesÑ¡ÏîÆô¶¯MySQL·þÎñ,¿ÉÒÔÐÞ¸Ä/etc/inin.d/mysqld½Å±¾Æô¶¯Î»ÖÃÔö¼Ó´ËÑ¡Ï
vi /etc/init.d/mysqld
ÔÚÏÂÃæÔËÐÐÆô¶¯µÄÓï¾äÀïÔö¼Ó--skip-grant-tables
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ