LAMP(Linux+Apache+Mysql+PHP)²¿ÊðÈÕÖ¾
±¾ÎļǼһϱ¾ÈË°²×°LAMPµÄÈ«¹ý³Ì
±¾ÈËʹÓõÄLinuxΪRedHat Enterprise 5 X64
µÚÒ»²½:°²×°Mysql
MysqlµÄ°²×°±È½Ï¼òµ¥£¬ÎªÁ˱ÜÃâ³öÏÖÎļþÕÒ²»µ½µÄÇé¿ö£¬ÎÒÒÀ´ÎÏÂÔØ°²×°ÁËÒÔÏÂ4¸öRPM°ü
MySQL-server-community-5.1.46-1.rhel5.x86_64.rpm
MySQL-client-community-5.1.46-1.rhel5.x86_64.rpm
MySQL-devel-community-5.1.46-1.rhel5.x86_64.rpm
MySQL-shared-community-5.1.46-1.rhel5.x86_64.rpm
µÚ¶þ²½£º°²×°Apache
ÆäʵÊÇ°²×°ApacheÏîĿϵÄhttpd
1¡¢´Ó http://httpd.apache.orgÏÂÔØÎļþhttpd-2.2.14.tar.bz2 2.
2¡¢½âѹËõ
$ bzip2 –d httpd-2.2.14.tar.bz2
$ tar –xvf httpd-2.2.14.tar
3¡¢ÅäÖÃ
$ cd httpd-2.2.14
$ ./configure --prefix=/usr/local/apache --enable-so
¼´½«°²×°ÔÚ·¾¶/usr/local/apache Ï¡£
4¡¢±àÒë²¢°²×°
$ make
$ make install
½«»á°²×°µ½--prefixÖ¸¶¨µÄ/usr/local/apacheÏÂÃæ
6¡¢¶¨ÖÆÅäÖÃÎļþ
$ vi /usr/local/apache/conf/httpd.conf
7¡¢²âÊÔ
Start Apache HTTP Server bu running:
$ /usr/local/apache/bin/apachectl -k start
It should be able to request your first document via http://localhost. The document is located in DocumentRoot, which is set in http.conf.
Stop the server
$ /usr/local/apache/bin/apachectl -k stop
µÚÈý²½£º°²×°PHP
´Óhttp://cn.php.netÏÂÔØphp-5.2.13.tar.bz2
½âѹËõ
$ bzip2 –d php-5.2.13.tar.bz2
$ tar –xvf php-5.2.13.tar
ÅäÖÃ
$ cd php-5.2.13
$ ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs --with-mysql
Õâʱºò»á³öÏÖCannot find libmysqlclient under /usrµÄ´íÎó
Õâ¿ÉÄÜÒòΪÎÒµÄÊÇ64λµÄ£¬libmysqlclient.soÔÚ/usr/lib64ÏÂÃ棬ÓÚÊǽ«Æ俽±´µ½/usr/libÏÂÃæ
ÔÚÔËÐÐÕâʱºò£¬Í¨¹ýÁË¡£
ÆäÖÐ--with-apxs2=/usr/local/apache/bin/apxs Ó¦¸ÃÊÇÓëapache¹ØÁª£¬ÔÚÆä¶ÔÓ¦ÏÂÃæÉú³Élibphp5.so
±àÒë
$ make
²âÊÔ
$ make test
°²×°
$ make install
½«php.ini-dist ¿½±´µ½--with-config-file-pathËù±íʾµÄ/usr/local/php/etcĿ¼Ï¸ÄÃûΪphp.ini
ÐÞ¸ÄapacheµÄhttpd.confÎļþ ÔÚÆäÖмÓÉÏ AddType application/x-httpd-php .php
²¢×¢Òâ LoadModule php5_mod
Ïà¹ØÎĵµ£º
Ŀ¼
1 ÒýÑÔ... 3
1.1 ±³¾°... 3
1.2 ±àдĿµÄ... 3
1.3 ¶¨Òå... 3
1.4 ²Î¿¼×ÊÁÏ... 3
2. ApacheÓëJBoss·þÎñÆ÷¼ò½é... 3
2.1 Apache·þÎñÆ÷... 3
2.2 JBoss·þÎñÆ÷... 3
3. ApacheÓëJBoss·þÎñÆ÷ÅäÖÃÕûºÏ... 3
3.1 ÈÃApacheÓëJBossÒ»Æð¹¤×÷... 3
3.1.1 ¼ò½é... 3
3.1.2 »·¾³... 3
3.1.3 °²×°... 4
3.1.4 ÅäÖÃ... ......
linux file lock
linuxµÄÎļþËø·ÖΪÁ½ÖÖ£º
Ò»ÖÖÊÇadvasory lock£¬Ö»Äܱ£Ö¤½ø³ÌÄÚ¶Ôͬһ¸öÎļþËøµÄ»¥³âÓÐЧ£¬µ«ÊǶà¸ö½ø³Ì¿ÉÒÔͬʱ¶ÔÒ»¸öÎļþ¼Ó»¥³âµÄËø£¬ËùÒÔÕâÖÖËøÊǼÓÔÚfile ½á¹¹ÉÏ;Ò»ÖÖÊÇmandatory lock£¬ÕâÖÖËø¿ÉÒÔ±£Ö¤¶à¸ö½ø³ÌÎÞ·¨¶Ôͬһ¸öÎļþ¶¼¼ÓÉÏ»¥³âËø£¬ËùÒÔÕâÖÖËøÊǼÓÔÚinode ½á¹¹Éϵġ£
µ±¼Ómandatroy lockÊ ......
´°Ì嶥¶Ë
Ë÷Òý£º
1.fork¡¢execºÍexit¶ÔIPC¶ÔÏóµÄÓ°Ïì
2.fcntl¼Ç¼Ëø
3.¹ÜµÀºÍFIFOµÄÊôÐÔ
4.¹ÜµÀºÍFIFOµÄÏÞÖÆ
5.pipeº¯Êý
6.popenºÍpclose
7.mkfifoº¯Êý
8.System V IPC¹²ÐÔÃèÊö
9.msqid_ds½á¹¹
10.msggetº¯Êý
11.msgsndº¯Êý
12.msgrcvº¯Êý
13.msgctlº¯Êý
14.ÔÚSystem VÏûÏ¢¶ÓÁÐÉÏʹÓÃselectºÍpoll
15.sem ......
¹²ÏíÄÚ´æ:
ʹÓù²ÏíÄÚ´æºÍʹÓÃmalloc()À´·ÖÅäÄÚ´æÇøÓòºÜÏàËÆ¡£Ê¹Óù²ÏíÄÚ´æµÄ·½·¨ÊÇ£º
1 ¶ÔÒ»¸ö½ø³Ì/Ïß³ÌʹÓÃshmget()·ÖÅäÄÚ´æÇøÓò¡£
2 ʹÓÃshmat()·ÅÖÃÒ»¸ö»ò¶à¸ö½ø³Ì/Ïß³ÌÔÚ¹²ÏíÄÚ´æÖУ¬Ò²¿ÉÒÔÓÃshmctl()À´»ñÈ¡ÐÅÏ¢»òÕß¿ØÖƹ²ÏíÇøÓò¡£
3 ʹÓÃshmdt()´Ó¹²Ïí ......