ºìÁªLinuxÃÅ»§
Linux°ïÖú

web·þÎñÆ÷apache£«mysql£«phpµÄÉ趨

·¢²¼Ê±¼ä:2005-06-15 00:07:56À´Ô´:ºìÁª×÷Õß:ºÎ¸ç
web·þÎñÆ÷µÄÉ趨
apache£«mysql£«phpÒ»°ã±»ÈÏΪÊDZȽÏÓÅÐãµÄÍøÒ³·þÎñÆ÷×éºÏ£¬ÎÞÂÛ¶ÔÓÚ¸öÈ˵ÄʵÑé·þÎñÆ÷£¬»¹ÊÇ×÷ΪÖеȹæÄ£µÄ·þÎñÆ÷£¬¶¼±È½ÏÀíÏ룬¶ÔÓÚ´óÐÍ·þÎñÆ÷£¬ÎÒ²»´óÁ˽âÓжàÉÙÒ³ÃæÓÃphpÓïÑÔÀ´Ð´£¬Ö÷ÒªÊÇÒòΪphpÒ³ÃæÖ´ÐÐЧÂʲ»ÊǺܺ㬵«ÊǼ´±ãÈç´Ëapache·þÎñÆ÷ÈÔÈ»ÊÇʹÓÃ×î¹ã·ºµÄ·þÎñÆ÷Ö®Ò»£¬mysql×ÔÈ»²»±Ø˵£¬¶ÔÓÚ»ùÓÚÍøÂçµÄÊý¾Ý¿â£¬ËüÊǺÜÓÅÐãµÄ¡£ÒÔÇ°ÔÚÍøÉÏ¿´¹ýºÜ¶àÓйØÕâ·½ÃæµÄÎÄÕ£¬ËäȻдµÄºÜÏêϸ£¬µ«ÊÇ°´ÕÕÎÄÕÂÉÏÃæµÄ·½·¨£¬ÎÒÖ»³É¹¦ÁËÒ»´Î¡£ºÜ¶àÈ˶¼Ëµ×Ô¼ºÊµÑé³É¹¦¹ý£¬µ«ÊÇʵ¼ÊÉϺܶàÈËÒÅʧÁËһЩ²½Öè¡£ÒÔÏÂÕâƪÎÄÕÂÊǸù¾ÝһƪÎÄÕ²¢×Ô¼º×ö´óÁ¿ÐÞ¸Äд³ÉµÄ¡£

LinuxÏÂapache+mysql+php

apache1.3.28+php-4.3.3+mysql-4.0.16
ÕâÀïҪעÒâµÄÊÇapache 1.3.x¿ÉÒÔÓþ²Ì¬phpÄ£¿é
±¾°²×°ËùÐèÒªµÄÈí¼þ°ü:
apache_1.3.28.tar.gz
php-4.3.3.tar.bz2
MySQL-client-4.0.16-0.i386.rpm
MySQL-devel-4.0.16-0.i386.rpm
MySQL-server-4.0.16-0.i386.rpm
MySQL-shared-4.0.16-0.i386.rpm


0£¬°²×°Ç°µÄ¹¤×÷£º

Ê×ÏÈжÔص÷ϵͳ×Ô´øµÄ·þÎñÆ÷Èí¼þ£¬ÒòΪapache±ØÐëÖØбàÒ룬phpÔ­À´ÏµÍ³ÓÖ²»´ø£¬ÖÁÓÚmysqlÈç¹ûÔÚ³õװϵͳµÄʱºòÒѾ­°²×°£¬ÔÚÕâÄã¿ÉÒÔ²»°²×°£¬µ«ÎÒ±£Ö¤£¬Õâ¸ö±ÈÄãÔ­À´´øµÄÐÂһЩ¡«¡«£º£©¡£

жÔØapache£ºrpm -e apache£¬Èç¹ûʧ°Ü¼ÓÉÏ--nodepsµÄ²ÎÊý¡£

жÔØmysql£ºÏÈÓÃrpm -qa|grep MySQL ¼ì²éÒ»ÏÂϵͳËù°²×°µÄÈí¼þ°ü¡£

Èç¹ûÓÐMySQLµÄÈí¼þ°üÁгö£¬ÄÇôÒÀ´ÎжÔØ¡£×¢Òâ¼ÓÉÏ--nodeps£¬--forceµÄ²ÎÊý£¬ÒòΪËûÃÇ»¥ÏàÒÀÀµ£¬²»ÓòÎÊýû·¨Ð¶£º

rpm -e MySQL-client --nodeps --force
rpm -e MySQL-server --nodeps --force
rpm -e MySQL-shared --nodeps --force
rpm -e MySQL-devel --nodeps --force
rpm -e mysql

µ±È»ÄãÈç¹û²»ÏëжÔØÒ²¿ÉÒÔ¡£

ÏÂÃæ¾Í¿ªÊ¼°²×°ÁË¡£

1£¬mysql°²×°£º£¨Ç°ÃæÈç¹ûÄã²»´òËãжÔØÔ­À´µÄmysql£¬Ìø¹ýÕâÒ»²½£©

½«ÕâЩ°ü·ÅÔÚÒ»¸öĿ¼Ï£¬±ÈÈçÄãµÄÖ÷Ŀ¼/root

a£¬½¨Á¢ MySQL Óû§×飺£¨Èç¹ûϵͳԭÀ´ÒѾ­½¨Á¢ÁËÓû§¡¢×飬ÕâÒ»²½Ò»¶¨²»»á³É¹¦£¬²»¹ýû¹Øϵ£¬¿ÉÖ±½Ó½øÐÐÏÂÒ»²½£©

groupadd mysql
useradd -g mysql mysql

b£¬°²×°mysql

rpm -ivh MySQL-client-4.0.16-0.i386.rpm
rpm -ivh MySQL-devel-4.0.16-0.i386.rpm
rpm -ivh MySQL-server-4.0.16-0.i386.rpm
rpm -ivh MySQL-shared-4.0.16-0.i386.rpm

c£¬Æô¶¯

mysqld_safe &

d£¬Îª root ÉèÖÃÃÜÂë

mysqladmin -u root -p password

»Ø³µºóϵͳ»áÌáʾÄãÊäÈ뵱ǰÃÜÂ룬Ӧ¸ÃÊÇÏñÏÂÃæÕâÑù£º

Enter password:

ÒòΪ´Ëʱ»¹Ã»ÓÐÃÜÂ룬ËùÒÔÖ±½Ó»Ø³µ¼´¿É£¬²¢ÊäÈëÐÂÃÜÂëyour_password¡£

e£¬¹Ø±Õmysql·þÎñÆ÷¡£

mysqladmin -u root -p shutdown

ÊäÈëÃÜÂëºó£¬ÏµÍ³Ìáʾ MySQL Òѹرա£

2. °²×° apache + php

1£©£¬ÅäÖÃapache

a£¬½âѹapache_1.3.28.tar.gz

tar zxvf apache_1.3.28.tar.gz

b£¬ÅäÖã¬Ô¤±àÒëapache£¬Ö÷ÒªÊÇÒòΪ±àÒëphpʱ±ØÐèÒªÇóapacheÒѾ­±»±àÒ룬ËùÒÔÔÚÕâÖ»ÊDZàÒë¶ø²»°²×°¡£

cd apache_1.3.28
./configure --prefix=/usr/local/apache
make

2£©ÅäÖñàÒë°²×° php-4.3.3

a£¬½âѹËõphp-4.3.3.tar.bz2

tar zxvf php-4.3.3.tar.bz2

cd php-4.3.3

./configure --with-mysql=/usr/local/mysql --with-apache=../apache_1.3.28 --enable-track-vars --enable-inline-optimiation --enable-dio

ºóÃæ3¸ö²ÎÊý¿ÉÒÔ²»¼Ó£¬Ö»ÊÇÓÃÀ´ÓÅ»¯µÄÒÔ¼°¼ÓÔØijЩģ¿éµÄ¡£

b£¬È»ºó±àÒë°²×°£º

make;make install

3) ÖØÐÂÅäÖò¢±àÒë°²×°apache£¬Ê×ÏÈÒª¿½±´libphp4.a libphp4.laµ½apacheÏÂÃæ

cd ../apache_1.3.28

cp ../php-4.3.3/libs/* src/modules/php4/

./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/libphp4.a --enable-module=php4 --enable-module=most --enable-shared=max

make;make install

4) ×îºóÉèÖÃ

a£¬°²×°phpÅäÖÃÎļþ£º

cd ../php-4.3.3
cp php.ini-dist /usr/local/lib/php.ini

Äã¿ÉÒÔ°´ÐèÒª±à¼­ php.ini

b£¬±à¼­ /usr/local/apache/conf Ŀ¼Ï嵀 httpd.conf£¨Õâ¸öÎļþÀïÃæÉæ¼°ËùÓе÷þÎñÆ÷±äÁ¿£¬¿ÉÒÔ¸ü¸Ä·þÎñÆ÷µØÖ·£¬¶Ë¿Ú£¬Ö÷Ŀ¼µÈµÈ£¬ÏÂÃæÂÞÁÐÊDZØÐèÒª¸ÄµÄ£©

ÕÒµ½:

DirectoryIndex index.html


¸ÄΪ£º

DirectoryIndex index.html index.php index.htm


ÔÚÎļþÖÐÔö¼ÓÒ»Ìõ£º
AddType application/x-httpd-php .php

c£¬Îª¿ØÖÆ·þÎñÆ÷¶ø½¨Á¢Ò»¸ö·ûºÅÁ¬½Ó£º

ln -s /usr/local/apache/bin/apachectl /usr/bin/apache

ÉèÖýáÊø¡£

5) µ÷ÊÔ

¿ÉÒÔдһ¸ö×î¼òµ¥µÃphp²âÊÔÒ³Ã棺

ÎļþÄÚÈÝ£º



±£´æΪindex.php£¬°ÑËü¿½±´µ½/usr/local/apache/htdocs/£¨Õâ¸öÊÇĬÈϵÃweb·þÎñÆ÷Ö÷Ŀ¼£©ÏÂÃ棬ȻºóÆô¶¯mysql·þÎñÆ÷£¬Æô¶¯web·þÎñÆ÷¡£

mysqld_safe &
apache start

È»ºó·ÃÎʲâÊÔÒ³°É¡£Èç¹û´òÓ¡³öÈ«²¿µÃ·þÎñÆ÷ÐÅÏ¢£¬ÄÇô֤Ã÷ÄãÒѾ­³É¹¦¡£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 8 ÌõÆÀÂÛ

  1. c_21 ÓÚ 2007-11-30 16:36:09·¢±í:

    :0wl;l1 :0wl;l1 :0wl;l1

  2. robertmaggie ÓÚ 2007-11-29 15:57:18·¢±í:

    Ö§³Ö

  3. usel ÓÚ 2005-12-07 14:39:40·¢±í:

    Ö§³Ö

  4. 154978 ÓÚ 2005-10-11 00:37:45·¢±í:

    Ö§³Ö

  5. °®µÄ±ßÔµ ÓÚ 2005-09-08 00:45:15·¢±í:

    ²»´í£¬ÔÙÌṩÏÂÔØ°ü¾ÍºÃÁË

  6. ·çÓêÎÞ×è ÓÚ 2005-07-26 00:27:33·¢±í:

    ÊܽÌ

  7. denghl ÓÚ 2005-06-26 16:29:31·¢±í:

    Èç¹ûÄÜ°ÑÕâÉÏÃæÓõ½µÄ°ü¶¼ÉÏ´«³É¸½¼þ¾ÍºÃÁË

  8. chentong ÓÚ 2005-06-25 12:32:21·¢±í:

    Ö§³Ö