Apache+PHP+MySQL »ç¿ëÀ» À§ÇÑ ¼³Ä¡

±Û : Á¤¿ë¼®/ freemir2k@intizen.com

 

 

    <¸ñ Â÷>

    0. µé¾î°¡±â¿¡ ¾Õ¼­
    1. APM ¼¼Æ®¸¦ »ç¿ëÇÏ´Â ¸ñÀûÀº ¹«¾ùÀԴϱî?
    2. APMÀº ¾î¶»°Ô ±¸Çմϱî?
    3. ½ÇÀü! APM ¼³Ä¡Çϱâ

 

0. µé¾î°¡±â¿¡ ¾Õ¼­

    °¡Á¤ÀÇ ³×Æ®¿öÅ©È­·Î ÀÎÇØ °³ÀÎ »ç¿ëÀڵ鵵 ÀÚ½ÅÀÇ È¨ÆäÀÌÁö¸¦ ¿î¿µÇÏ°íÀÚ ÇÏ´Â ¿å±¸°¡ Áõ°¡µÇ°í ÀÖ½À´Ï´Ù. ¹°·Ð »ç¿ëÀڵ鿡°Ô ÀÏÁ¤·®ÀÇ °ø°£À» ÇÒ´çÇÏ¿© °³ÀΠȨÆäÀÌÁö ¿î¿µ ¼­ºñ½º¸¦ Á¦°øÇÏ´Â ¾÷ü°¡ ºÎÁö±â¼ö·Î ´Ã¾î°¡°í ÀÖ´Â °ÍÀÌ ¿äÁòÀÇ ¼¼ÅÂÀÔ´Ï´Ù. ±×·¯³ª Áö±Ý ÀÌ Ã¥À» º¸°í ÀÖ´Â µ¶ÀÚµéÀÇ ¼Ò¸ÁÀº ¾Æ¸¶µµ ÀÚ½ÅÀÇ È¨ÆäÀÌÁöÀÇ »ç¿ë°¡´É °ø°£ÀÇ Á¦ÇÑÀÌ ¾ø±â¸¦ ¹Ù¶ó°Å³ª, ÀÚ½ÅÀÌ °øºÎÇÑ PerlÀ̳ª PHP¸¦ ÀÌ¿ëÇÏ¿© ÀڽŰú Á¢¼ÓÀÚ °£ÀÇ »óÈ£ °³¹æÀûÀÎ ´ëÈ­Çü ȨÆäÀÌÁö¸¦ ±¸ÃàÇÏ°í ½Í°Å³ª, ±×°Íµµ ¾Æ´Ï¶ó¸é ÀÚ½ÅÀÇ µµ¸ÞÀÎÀ¸·Î ÀÚ½ÅÀÌ Á÷Á¢ À¥ ¼­¹ö¸¦ ±¸ÃàÇÏ°í ½ÍÀº »ý°¢À» °¡Áö°í ÀÖÀ» °ÍÀ̶ó »ý°¢Çغ¾´Ï´Ù.

    ±×·¸´Ù¸é ÀÌ ±Û¿¡¼­´Â Apache¿Í PHP, MySQLÀ» »ç¿ëÇÏ¿© ÀÚ½ÅÀÇ ÄÄÇ»ÅÍ¿¡ µ¥ÀÌÅͺ£À̽º¿Í ½ºÅ©¸³Æ® ¾ð¾î¸¦ »ç¿ëÇÒ ¼ö ÀÖ´Â ÀÚ½ÅÀÌ ¿î¿µÇÏ´Â À¥ ¼­¹ö¸¦ ±¸ÃàÇØ º¸µµ·Ï ÇÏ°Ú½À´Ï´Ù. ÀÌ¹Ì ¿©·¯ ¸Åü¸¦ ÅëÇØ ¼³Ä¡¹æ¹ýÀÌ ¸¹ÀÌ ¾Ë·ÁÁ® ÀÖÁö¸¸, »õ·ÎÀÌ ½ÃµµÇϽô ºÐµé°ú ÀÌÁ¦ ¸· °øºÎ¸¦ ½ÃÀÛÇϽŠºÐµé, ±×¸®°í ¼³Ä¡´Â ÇßÁö¸¸ ¾ÆÁ÷ Àß ¸ð¸£°Ú´Ù°í ´À³¢½Ã´Â ºÐµéÀ» À§ÇØ ºñ·Ï ªÀº Áö½ÄÀÌÁö¸¸ ¼³Ä¡¿¡ ÇÊ¿äÇÑ °ÍµéÀ» »ó¼¼È÷ ¼³¸íÇϵµ·Ï ³ë·ÂÇÏ°Ú½À´Ï´Ù. ±×·¯¸é ÀÌÁ¦ Àú¸¦ µû¶ó¼­ APMÀ̶ó ÀÏÄþîÁö´Â Apache+PHP+MySQLÀÇ ¼¼°è·Î ¶°³ªº¸µµ·Ï ÇÏ°Ú½À´Ï´Ù.

 

1. APM ¼¼Æ®¸¦ »ç¿ëÇÏ´Â ¸ñÀûÀº ¹«¾ùÀԴϱî?

    ¿ì¼± APM ¼¼Æ®¸¦ »ç¿ëÇÏ´Â ÀÌÀ¯¿¡ ´ëÇØ ¾Ë¾Æº¸µµ·Ï ÇÏ°Ú½À´Ï´Ù. ±×³É ¸·¿¬È÷ ³²ÀÌ »ç¿ëÇÏ´Ï±î ¾´´Ù´Â »ý°¢Àº ¾Æ´Ï¶ó°í »ý°¢Çغ¾´Ï´Ù. ÀÚ½ÅÀÌ »ç¿ëÇϴµ¥ ¾î¶² À̵æÀÌ ÀÖÀ¸´Ï±î »ç¿ëÇÏ´Â °ÍÀÔ´Ï´Ù. Çϳª¾¿ »ìÆ캸µµ·Ï ÇÏ°Ú½À´Ï´Ù. ¿ì¼± apache¿¡ ´ëÇؼ­´Â ¸¹ÀÌ µé¾îº¸¼ÌÀ¸¸®¶ó »ý°¢ÇÕ´Ï´Ù. ÇöÀç ÀÎÅͳݿ¡¼­ ¿î¿µµÇ´Â À¥ ¼­¹öµé °¡¿îµ¥ °¡Àå ¸¹Àº ÀÎÁöµµ¸¦ È®º¸ÇÏ°í ÀÖ´Â À¥ ¼­¹ö ÇÁ·Î±×·¥ÀÔ´Ï´Ù. Apache´Â ±âÁ¸ NCSA httpd 1.3¿¡ ÆÐÄ¡ÆÄÀÏÀ» Á¦°øÇß´ø ÀÏ·ÃÀÇ »ç¶÷µéÀÌ ¸ð¿© ±¸¼ºÇÑ apache ±×·ì¿¡¼­ "A PAtCH server"ÀÇ Á¶ÇÕÀ¸·Î apache¶ó´Â À̸§À» »ý°¢ÇØ ³»¾ú´Ù°í ÇÕ´Ï´Ù. ¹«·á·Î ¹èÆ÷µÇ¸ç ¸®´ª½º´Â ¹°·Ð UNIX, MS À©µµ¿ìÁî¿ëÀ¸·Îµµ Á¦°øµÇ°í ÀÖ½À´Ï´Ù. ÇöÀç ¾ËÆĹöÀü(°³¹ß¹öÀü)Àº 2.0a8 ±îÁö Á¦°øµÇ¸ç, ¾ÈÁ¤¹öÀüÀº 1.3.14ÀÔ´Ï´Ù. °³ÀÎÀûÀÎ °ßÇØ·Î ¾ÈÁ¤¹öÀüÀ» »ç¿ëÇÏ´Â °ÍÀÌ ¹Ù¶÷Á÷ÇÏ´Ù°í »ý°¢ÇÕ´Ï´Ù.

    À̹ø¿£ PHP¿¡ ´ëÇؼ­ ¾Ë¾Æº¸µµ·Ï ÇÏ°Ú½À´Ï´Ù. À¥ »ó¿¡¼­ »ç¿ëÇÒ ¼ö ÀÖ´Â ½ºÅ©¸³Æ® ¾ð¾î¿¡´Â ¿©·¯ °¡Áö°¡ ÀÖ½À´Ï´Ù. PerlÀ̳ª PHP, ±Ù·¡¿¡´Â python¿¡ ´ëÇÑ °ü½Éµµ ³ô¾ÆÁö°í ÀÖ½À´Ï´Ù. MSÞä¿¡¼­ °³¹ßÇÑ ASPµµ ÀÖ½À´Ï´Ù. ±×·¯³ª ¿ì¸®°¡ PHP¸¦ »ç¿ëÇÏ·Á´Â ÀÌÀ¯´Â ¹«¾ùÀϱî¿ä? ¸íÈ®ÇÏ°Ô À̾߱âÇÒ ¼ö´Â ¾øÁö¸¸ ¾Æ¸¶µµ ´ÙÀ½°ú °°Àº ÀÌÀ¯ ¶§¹®ÀÏ °ÍÀÔ´Ï´Ù. ¿ì¼± ´Ù¾çÇÑ ¿î¿ëüÁ¦¸¦ Áö¿øÇÏ°í, ´Ù¾çÇÑ ´ëÁßÀûÀÎ µ¥ÀÌÅͺ£À̽º, À¥¼­¹ö¿¡¼­ ÀÛµ¿ °¡´ÉÇϸç, PHP°¡ ´Ù¸¥ ½ºÅ©¸³Æ® ¾ð¾î¿Í ºñ±³ÇÏ¿´À» ¶§ µ¥ÀÌÅͺ£À̽º ¿¬µ¿¼Óµµ¸é¿¡¼­ ºü¸¥ Á¡À» µé ¼ö ÀÖ°Ú½À´Ï´Ù. ½ºÅ©¸³Æ® ¾ð¾î¿¡´Â ´Ù¾çÇÑ Á¾·ù°¡ ÀÖÀ¸´Ï ¸¸¾à PHP°¡ ¸¶À½¿¡ µéÁö ¾Ê´Â´Ù¸é ´Ù¸¥ ÁÁÀº ¾ð¾î¸¦ ¼±ÅÃÇÏ´Â °ÍÀº ¿©·¯ºÐÀÇ ¸òÀ̶ó ÇÏ°Ú½À´Ï´Ù.

    ¸¶Áö¸·À¸·Î MySQL¿¡ ´ëÇØ ¾Ë¾Æº¸µµ·Ï ÇÏ°Ú½À´Ï´Ù. ¿ì¼± MySQLÀº free¶ó´Â °­Á¡ÀÌ ÀÖ½À´Ï´Ù. °³ÀÎ »ç¿ëÀÚµéÀÌ »ç¿ëÇϴµ¥ À־´Â ¹«·á·Î ÀÌ¿ëÇÒ ¼ö ÀÖ´Ù´Â °ÍÀÌ Å« À̵æÀÏ °ÍÀÔ´Ï´Ù. ¿©±â¿¡´Ù ¼Ò½ºÄÚµå±îÁö Á¦°øµÇ´Ï ±Ý»ó÷ȭ°¡ ¾Æ´Ò ¼ö ¾ø°ÚÁö¿ä? ´Ü »ó¾÷ÀûÀÎ ÆǸſ¡ ÀÌ¿ëµÇ·Á¸é »ó¾÷¿ë ¶óÀ̼¾½º¸¦ ±¸ÀÔÇØ¾ß ÇÕ´Ï´Ù. MySQLÀº óÀ½ ±âȹµÉ ¶§ºÎÅÍ ÇöÁ¸ÇÏ´Â ¸ðµç µ¥ÀÌÅͺ£À̽ºº¸´Ù ºü¸£°í ´Ù¾çÇÑ ±â´ÉÀ» ±¸ÇöÀ» ¸ñÀûÀ¸·Î ¸¸µé¾îÁ³½À´Ï´Ù. MySQLÀº °ü°èÇü µ¥ÀÌÅͺ£À̽º(RDBMS - relational database management system)À̸ç, ÀÎÅͳݿ¡¼­ µ¥ÀÌÅͺ£À̽º¸¦ »ç¿ëÇϴµ¥ ÀÖ¾î ¿¬°á, ¼Óµµ, º¸¾È Ãø¸é¿¡¼­ ³ôÀº ¸¸Á·À» º¸ÀÌ°í ÀÖ½À´Ï´Ù. ´ë·«ÀûÀ¸·Î ¿ì¸®°¡ APMÀ» »ç¿ëÇÒ ¶§ ÃëÇÒ ¼ö ÀÖ´Â À̵濡 ´ëÇØ ¾Ë¾Æº¸¾Ò½À´Ï´Ù. ±×·¯¸é ÀÌÁ¦ APMÀ» ¼³Ä¡Çϱâ À§ÇÑ ÆÄÀÏÀ» ±¸ÇÏ´Â ¹æ¹ý°ú ¼³Ä¡ÇÏ´Â ¹æ¹ý, ¼³Ä¡ ÈÄ¿¡ Á¦´ë·Î ¼³Ä¡°¡ µÇ¾ú´ÂÁö È®ÀÎÇÏ´Â ¹æ¹ý¿¡ ´ëÇØ ¾Ë¾Æº¸µµ·Ï ÇÏ°Ú½À´Ï´Ù.

 

2. APMÀº ¾î¶»°Ô ±¸Çմϱî?

    °¡. Apache¸¦ ±¸Çغ¾½Ã´Ù.

    ApacheÀÇ °ø½Ä ȨÆäÀÌÁöÀÇ ÁÖ¼Ò´Â http://apache.org/ÀÔ´Ï´Ù. ÃֽŠ¼Ò½ÄÀ» Á¢ÇÏ·Á¸é ÀÌ°÷¿¡ °¡¸é µË´Ï´Ù.

    ±×·¯³ª, ¸¸¾à ¿µ¾î¿¡ ÀÚ½ÅÀÌ ¾ø´Ù¸é http://apache.or.kr¿¡ °¡º¸½Ã±æ Á¦¾ÈÇÕ´Ï´Ù.

    ¹°·Ð ÀÌ È¨ÆäÀÌÁöµµ ¸Þ´º¸¸ ÇѱÛÀÌÁö ³»¿ëÀº ¿µ¾î·Î µÈ °ø½Ä ȨÆäÀÌÁö¿¡ ¿¬°áµÇ¾î ÀÖÀ¸´Ï Á¦°¡ ÃßõÇÏ´Â °÷ÀÎ 'Çѱ¹ ¾ÆÆÄÄ¡ »ç¿ëÀÚ ¸ðÀÓ(The Apache Korea Group)'À¸·Î °¡º¸±æ ±ÇÀåÇÕ´Ï´Ù. ÁÖ¼Ò´Â http://www.apache.kr.net/ÀÔ´Ï´Ù.

    ¿ì¼± ¾ÆÆÄÄ¡ÀÇ ÃֽŠ¾ÈÁ¤¹öÀüÀ» ±¸Çϱâ À§ÇØ ¾ÆÆÄÄ¡ °ø½Ä ȨÆäÀÌÁö·Î °¡º¸°Ú½À´Ï´Ù. ÁÂÃø¿¡ ÀÖ´Â ¸Þ´º Áß¿¡¼­ 'Apache Server'¸¦ ¼±ÅÃÇÕ´Ï´Ù. ´ÙÀ½, ¸Þ´º¿¡¼­ 'Download'¸¦ ¼±ÅÃÇÏ¿© apache_1.3.14.tar.gz ÆÄÀÏÀ» ¹Þ½À´Ï´Ù.

 

    ³ª. PHP¸¦ ±¸Çغ¾½Ã´Ù.

    ¿ì¼± PHPÀÇ °ø½Ä ȨÆäÀÌÁöÀÎ http://www.php.net/¿¡ °¡º¾½Ã´Ù.

    ÀÌ°÷¿¡¼­ ÁÂÃø¿¡ ÀÖ´Â 'downloads'¸¦ ¼±ÅÃÇÕ´Ï´Ù. ¿©±â¼­ PHPÀÇ ÃֽŠ¹öÀüÀ» ¹Þ½À´Ï´Ù. ÇöÀç ÃֽŹöÀüÀº PHP 4.0.3 patch level 1ÀÔ´Ï´Ù. PHP 4.0 ZendÀÇ È¨ÆäÀÌÁöµµ ¿­¾ú´Âµ¥ ÁÖ¼Ò´Â http://zend.org/ÀÔ´Ï´Ù. ÀÌ°÷¿¡¼­ ¹ÞÀ¸¼Åµµ ¹«¹æÇÕ´Ï´Ù.

 

    ´Ù. MySQLÀ» ±¸Çغ¾½Ã´Ù.

    ¸¶Áö¸·À¸·Î MySQLÀ» ±¸Çغ¸µµ·Ï ÇÏ°Ú½À´Ï´Ù. MySQLÀÇ °ø½Ä ȨÆäÀÌÁö ÁÖ¼Ò´Â http://www.mysql.com/ÀÔ´Ï´Ù.

    ÀÌ°÷ »ó´Ü ¿ìÃø¿¡ ÀÖ´Â 'DOWNLOADS' ¸Þ´º¸¦ ¼±ÅÃÇÏ°í ¼¼ºÎ Ç׸ñ Áß¿¡¼­ ¾ÈÁ¤¹öÀüÀÎ 'stable realese'¿¡¼­ ¸¶Áö¸· ¾ÈÁ¤¹öÀüÀÎ mysql-3.22-32À» ¹Þ½À´Ï´Ù.
    ÀÌÁ¦ ¼³Ä¡¸¦ À§ÇÑ Áغñ°¡ ³¡³µ½À´Ï´Ù. Çϳª¾¿ Â÷±ÙÂ÷±Ù ¼³Ä¡ÇØ º¸µµ·Ï ÇÏ°Ú½À´Ï´Ù.

 

3. ½ÇÀü! APM ¼³Ä¡Çϱâ

    °¡. MySQL ¼³Ä¡Çϱâ

    °¡Àå ¸ÕÀú ¼³Ä¡ÇØ¾ß ÇÏ´Â °ÍÀº MySQLÀÔ´Ï´Ù. ÀÌÀ¯´Â PHP¸¦ ÀνºÅç ÇÒ ¶§ MySQLÀ» »ç¿ëÇÑ´Ù´Â ¿É¼ÇÀ» Àû¾îÁÖ¾î¾ß Çϱ⠶§¹®ÀÔ´Ï´Ù. À̶§ MySQLÀÌ ¼³Ä¡µÇ¾î ÀÖ¾î¾ß ÇÕ´Ï´Ù. ¼³Ä¡¸¦ ½ÃÀÛÇØ º¸°Ú½À´Ï´Ù.

    (1) MySQLÀÌ ¼³Ä¡µÇ¾î ÀÖ´ÂÁö È®ÀÎÇØ º¾´Ï´Ù.
     

    [root@jinnee/churl]#rpm -qa | grep mysql
    [root@jinnee/churl]#

     

    ÇÊÀÚÀÇ ¸®´ª½º ¸Ó½Å¿¡´Â ¼³Ä¡µÇ¾î ÀÖÁö ¾Ê¾Æ¼­ ³ªÅ¸³ªÁö ¾Ê½À´Ï´Ù. ¸¸¾à °á°ú°¡ ³ªÅ¸³ª¸é
    [rpm -e Á¦°ÅÇÒ ÆÄÀϸí] ¸í·ÉÀ» »ç¿ëÇÏ¿© Á¦°ÅÇÏ¸é µË´Ï´Ù. ÀÇÁ¸¼º ¹®Á¦·Î ÀÎÇØ Á¦°ÅµÇÁö
    ¾Ê´Â´Ù¸é [--nodeps] ¿É¼ÇÀ» Ãß°¡ÇÏ¿© Á¦°ÅÇÏ¸ç µË´Ï´Ù.

    (2) ¼Ò½ºÆÄÀÏÀÇ ¾ÐÃàÀ» Ǭ µÚ ¼Ò½º µð·ºÅ丮¸¦ ¿Å°ÜÁÝ´Ï´Ù.
     

    [root@jinnee/churl]#tar xvfz mysql-3.22.32.tar.gz
    mysql-3.22.32/
    mysql-3.22.32/Makefile.in

    mysql-3.22.32/support-files/mysql.server.sh
    mysql-3.22.32/support-files/binary-configure.sh
    [root@jinnee/churl]#mv./mysql-3.22.32/usr/local/mysql

     

    (3) ¼Ò½º µð·ºÅ丮·Î À̵¿ÇÏ¿© ȯ°æ¼³Á¤À» ÇØÁÝ´Ï´Ù. 

    ¾Æ·¡¼­ º¸ÀÌ´Â '--prefix' ¿É¼ÇÀº ÇÁ·Î±×·¥ÀÌ ¼³Ä¡µÉ À§Ä¡¸¦ ÁöÁ¤ÇØ ÁÖ´Â °ÍÀÌ°í, '--with-charset'Àº »ç¿ëÇÒ ¾ð¾î¸¦ ¼³Á¤ÇÏ´Â °ÍÀÔ´Ï´Ù.
     

    [root@jinnee/churl]#cd/usr/local/mysql
    [root@jinnee mysql]#./configure --prefix=/usr/local/mysql --with-chaset=euc_kr
    creating cache./config.cache
    checking host system type...i586-pc-linux-gnu
                         .
                         .
                         .
    Remember to check the platform specific part in the reference manual for hints about installing on your platform. See the Docs directory.

    Thank you for choosing MySQL!

    [root@jinnee mysql]#

     

    (4) ¼Ò½º¸¦ ÄÄÆÄÀÏÇÕ´Ï´Ù.
     

    [root@jinnee mysql]#make
    cd client;make link_sources
    make[1]:Entering directory /usr/local/mysql/client'
    set -x;¡¬
                  .
                  .
                  .
    make[1]:Leaving directory /usr/local/mysql'
    [root@jinnee mysql]#make install

 

    (5) ÄÄÆÄÀÏÀ» ¸¶Ä£ ÆÄÀÏÀ» ¼³Ä¡ÇØÁÝ´Ï´Ù.
     

    [root@jinnee mysql]#make install
    Making install in include
    make[1]:Entering directory /usr/local/mysql/include'
                  .
                  .
                  .
    make[2]:Leaving directory /usr/local/mysql'
    make[3]:Leaving directory /usr/local/mysql'
    [root@jinnee mysql]#

     

    (6) MySQLÀ» ±¸µ¿Çϱâ À§ÇØ µ¥ÀÌÅͺ£À̽º¸¦ ¸¸µì´Ï´Ù.
     

    [root@jinnee mysql]#./scripts/mysql_install_db
    Creating db table
    Creating host table

    The latest information about MySQL is available on the web at http://www.mysql.com
    Support MySQL by buying support/licenses at
    http://www.tcx.se/license.htmy.

    [root@jinnee mysql]#

     

    (7) MySQLÀÇ µ¥¸ó(deamon)À» ½ÇÇà½Ãŵ´Ï´Ù.
     

    [root@jinnee mysql]#./bin/safe_mysqld &
    [1] 15670
    Starting mysqld deamon with databases from/usr/local/mysql/var
    [root@jinnee mysql]#

     

    (8) MySQLÀÇ µ¥¸ó(deamon)ÀÌ ½ÇÇà ÁßÀÎÁö È®ÀÎÇغ¾´Ï´Ù.
     

    [root@jinnee mysql]#ps ax
    PID TTY  STAT  TIME COMMAND
      1?      S     0:05 init
      2?      SW  0:00 [kflushd]

    15670 pts/0  S    0:00 sh./bin/safe_mysqld
    15682 pts/0  SN  0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/
    15684 pts/0  SN  0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/
    15685 pts/0  SN  0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/
    15686 pts/0  R    0:00 ps ax


    À§¿¡¼­ º¼ ¼ö ÀÖµíÀÌ Á¤»óÀûÀ¸·Î ÀÛµ¿ÇÏ°í ÀÖ½À´Ï´Ù.

    (9) MySQLÀÇ root(¡ØMySQLÀÇ rootÀÔ´Ï´Ù. ½Ã½ºÅÛÀÇ root°¡ ¾Æ´Õ´Ï´Ù.)ÀÇ Æнº¿öµå¸¦ ¼³Á¤ÇØÁÝ´Ï´Ù.
     

    [root@jinnee mysql]#./bin/mysqladmin -u root password '¿øÇÏ´Â Æнº¿öµå'

 

    (10) Á¤È®È÷ ¼³Ä¡µÇ¾ú´ÂÁö È®ÀÎÀ» Çغ¾½Ã´Ù.
     

    [root@jinnee mysql]#./bin/mysql -u root -p
    Enter password: ¢® ¿©±â¿¡ root Æнº¿öµå¸¦ ³Ö¾îÁÝ´Ï´Ù.
    Welcome to the MySQL monitor. Commands end with; or¡¬g.
    Your MySQL connection id is 2 to server version:3.22.32
    Type 'help' for help.

    mysql> show database;    µ¥ÀÌÅͺ£À̽º¸¦ º¸¿© ´Þ¶ó´Â ¸í·ÉÀÔ´Ï´Ù.
    +-------+
    |Database|
    +-------+
    |mysql     |
    |test        |
    +-------+
    2 rows in set (0.01 sec)
    mysql>¡¬q     ¢® Á¾·á ¸í·ÉÀÔ´Ï´Ù.
    Bye
        [root@jinnee mysql]#


    ÀÌÁ¦ MySQLÀÇ ¼³Ä¡´Â ³¡³µ½À´Ï´Ù. ¸¸¾à ½Ã½ºÅÛÀÌ Ã³À½ ½ÃÀÛµÉ ¶§ºÎÅÍ MySQLÀÌ ½ÇÇàµÇ±â¸¦ ¿øÇϽøé /etc/rc.local ÆÄÀÏÀÇ ¸Ç ¸¶Áö¸· ÁÙ¿¡ ¾Æ·¡¿Í °°Àº ¸í·ÉÁÙÀ» Ãß°¡½ÃÄÑ ÁÖ½Ã¸é µË´Ï´Ù.
    /usr/local/mysql/bin/safe_mysqld &

 

    ³ª. Apache¿Í PHP ¼³Ä¡Çϱâ

    (1) Apache¿Í PHP°¡ ¼³Ä¡µÇ¾î ÀÖ´ÂÁö È®ÀÎÇØ º¾´Ï´Ù.
     

    [root@jinnee/churl]#rpm -qa | grep apache
    [root@jinnee/churl]#rpm -qa | grep php


    ¸¸¾à ¼³Ä¡µÇ¾î ÀÖ´Ù¸é MySQLÀ» ¼³Ä¡ÇÒ ¶§Ã³·³ Çϳª¾¿ Á¦°ÅÇØÁÝ´Ï´Ù.

    (2) Apache¿Í PHP ÆÄÀÏÀÇ ¾ÐÃàÀ» Ç®°í µð·ºÅ丮¸¦ À̵¿½ÃÄÑ ÁÝ´Ï´Ù.
     

    [root@jinnee/churl]#tar xvfz php-4.0.3pl1.tar.gz
    php-4.0.3pl1/
    php-4.0.3pl1/build/

    php-4.0.3pl1/install-sh
    php-4.0.3pl1/aclocal.m4
    [root@jinnee/churl]#tar xvfz apache_1.3.14.tar.gz
    apache_1.3.14/
    apache_1.3.14/src/

    apache_1.3.14/htdocs/index.html.se
    apache_1.3.14/htdocs/index.html.tw.Big5
    [root@jinnee/churl]#mv./php-4.0.3pl1/usr/local/php
    [root@jinnee/churl]#mv./apache_1.3.14.tar.gz/usr/local/apache

     

    (3) Apache µð·ºÅ丮·Î À̵¿ÇÏ¿© ȯ°æ¼³Á¤À» ÇØÁÝ´Ï´Ù.
     

    [root@jinnee/churl]#cd/usr/local/apache
    [root@jinnee apache]#./configure --prefix=/usr/local/apache
    Configuring for Apache, Version 1.3.14
    + using installation path layout: Apache (config.layout)
               .
               .
               .
    Creating Makefile in src/lib/expat-lite
    Creating Makefile in src/modules/standard
    [root@jinnee apache]#

     

    (4) PHP µð·ºÅ丮·Î À̵¿ÇÏ¿© Apache¿Í MySQLÀ» »ç¿ëÇÑ´Ù´Â ¿É¼ÇÀ» ÁÖ°í ȯ°æ¼³Á¤À»
         ÇØÁÝ´Ï´Ù.
     

    [root@jinnee apache]#cd../php
    [root@jinnee php]#./configure --with-apache=/usr/local/apache --with-mysql=/usr/local/mysql
    mysql=/usr/local/mysql
    creating cache./config.cache
    checking for  BSD compatible install.../usr/bin/install-c
                 .
                 .
                 .
    |the installation process at this point.             |
    +----------------------------------+
    Thank you for using PHP.
    [root@jinnee php]#

     

    (5) ¼Ò½º¸¦ ÄÄÆÄÀÏ ÇØÁÝ´Ï´Ù.
     

    [root@jinnee php]#make
    Making alll in Zend
    make[1]:Entering directory /usr/local/php/Zend'
               .
               .
               .
    make[1]:Leaving directory /usr/local/php'
    Making all in pear
    make[1]:Entering directory /usr/local/php/pear'
    [root@jinnee php]#

     

    (6) ÄÄÆÄÀÏµÈ ÆÄÀÏÀ» ¼³Ä¡ÇØÁÝ´Ï´Ù.
     

    [root@jinnee php]#make install
    Making install in Zend
    make[1]:Entering directory /usr/local/php/Zend'
           .
           .
           .
    $prog;¡¬
    done
    [root@jinnee php]#

     

    (7) php.ini ÆÄÀÏÀ» ¸¸µé¾î ÁÝ´Ï´Ù. ÀÌ ÆÄÀÏÀ» PHPÀÇ È¯°æ¼³Á¤ ÆÄÀÏÀÔ´Ï´Ù.
     

    [root@jinnee php]#cp php.ini-dist /usr/local/lib/php.ini

     

    (8) Apache µð·ºÅ丮·Î À̵¿ÇÏ¿© PHP¸¦ apache ¸ðµâ·Î ÀνÄÇϱâ À§ÇÑ È¯°æ¼³Á¤À» ÇØÁÝ´Ï´Ù.
         ¿©±â¼­ ÁÖÀÇÇÒ °ÍÀº ¿É¼ÇÀÇ ¸Ç ¸¶Áö¸·¿¡ ÀÖ´Â libphp4.a ÆÄÀÏÀÌ ¾ø´Ù°í Çؼ­ ÆÄÀÏÀ̸§À»
         ÀÓÀÇ·Î ¹Ù²Ù¸é ¾ÈµÈ´Ù´Â °ÍÀÔ´Ï´Ù. [--activate-module]Àº apache ¼­¹ö¿¡¼­ ÀоîµéÀÏ
         ¸ðµâ¿¡ ´ëÇÑ ¼³Á¤ÀÔ´Ï´Ù.
     

    [root@jinnee php]# cd ../apache
    [root@jinnee apache]# ./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/libphp4.a
    Configuring for Apache, Version 1.3.14
    + using installation path layout: Apache (config.layout)

    Creating Makefile in src/modules/standard
    Creating Makefile in src/modules/php4
    [root@jinnee apache]#

     

    (9) ¼Ò½º ÆÄÀÏÀ» ÄÄÆÄÀÏ ÇØÁÝ´Ï´Ù.
     

    [root@jinnee apache]# make
    ===> src
    make[1]: Entering directory `/usr/local/apache'

    make[1]: Leaving directory `/usr/local/apache'
    <=== src
    [root@jinnee apache]#

     

    (10) ÄÄÆÄÀÏµÈ ÆÄÀÏÀ» ¼³Ä¡ÇÕ´Ï´Ù.
     

    [root@jinnee apache]# make install
    make[1]: Entering directory `/usr/local/apache'
    ===> [mktree: Creating Apache installation tree]

    | Thanks for using Apache. The Apache Group |
    |                              http://www.apache.org/ |
    +-----------------------------------+
    [root@jinnee apache]#

     

    (11) ¼³Ä¡´Â ¿Ï·áµÇ¾ú½À´Ï´Ù. PHP¸¦ »ç¿ëÇϱâ À§ÇØ ¼³Á¤À» °íÃ帵µ·Ï ÇÏ°Ú½À´Ï´Ù.
     

    [root@jinnee apache]# cd conf/
    [root@jinnee conf]# vi httpd.conf

     

    ¾Æ·¡ÀÇ ÁÙÀ» ã¾Æ ¹ØÁÙÀ» ±×Àº ºÎºÐÀ» Ãß°¡ÇØÁÝ´Ï´Ù. Ãß°¡ÇØÁÖ´Â ÀÌÀ¯´Â PHP¸¦ »ç¿ëÇØ º¸½Å ºÐµéÀº ¾Æ½ÃµíÀÌ HTML ¹®¼­¿¡ PHP¸¦ »ç¿ëÇÏ°Ô µÇ´Âµ¥, HTML ¹®¼­ ¾È¿¡¼­µµ PHP°¡ ½ÇÇàµÇµµ·Ï ¼³Á¤ÇØÁÖ´Â °ÍÀÔ´Ï´Ù.
     

    # And for PHP 4.x, use:
    #
    AddType application/x-httpd-php
    .php .php3 .ph .htm .html .inc .cfg
    AddType application/x-httpd-php-source .phps


    ¡Ø ±âº» HTML ¹®¼­ µð·ºÅ丮ÀÇ °æ·Î¸¦ ¹Ù²Ù·Á¸é 'DocumentRoot'ÀÇ ³»¿ëÀ» ¼öÁ¤ÇØÁÖ¸é °¡´ÉÇÕ´Ï´Ù.

    (12) Apache µ¥¸óÀ» ½ÇÇàÇØ º¸µµ·Ï ÇÏ°Ú½À´Ï´Ù. ½ÇÇàÀ» ¸ØÃß·Á¸é 'start' ´ë½Å 'stop'À» Àû¾î
          ÁÖ¸é µË´Ï´Ù.
     

    [root@jinnee apache]# ./bin/apachectl start
    ./bin/apachectl start: httpd started

     

    Á¤È®ÇÏ°Ô ½ÇÇàµÇ¾ú´ÂÁö È®ÀÎÇØ º¾´Ï´Ù. ¾Æ·¡¿Í °°ÀÌ ÀûÀçµÈ ¸ðµâÀÌ Ãâ·ÂµÇ¸é ¾Æ¹«·± ¹®Á¦¾øÀÌ ½ÇÇàµÈ °ÍÀÔ´Ï´Ù. ´Ù¸¥ ¹æ¹ýÀ¸·Î´Â ¿É¼ÇÀ» '-t'·Î Á־ 'Syntax OK'°¡ ³ª¿À´ÂÁö È®ÀÎÇÏ´Â °Íµµ ÀÖ½À´Ï´Ù.
     

    [root@jinnee conf]# /usr/local/apache/bin/httpd -l
    Compiled-in modules:
    http_core.c

    mod_php4.c
    suexec: disabled; invalid wrapper /usr/local/apache/bin/suexec
    [root@jinnee conf]#

 

    (13) ¸¶Áö¸·À¸·Î PHP°¡ Á¤È®ÇÏ°Ô ÀÛµ¿ÇÏ´ÂÁö È®ÀÎÇغ¸µµ·Ï ÇÏ°Ú½À´Ï´Ù.

    (°¡) HTML ¹®¼­ ±âº» µð·ºÅ丮·Î À̵¿ÇÕ´Ï´Ù. httpd.conf ÆÄÀÏ¿¡¼­ 'Document Root' ºÎºÐÀ»
          ¼öÁ¤ÇÏÁö ¾Ê¾Ò´Ù¸é '/usr/local/apache/htdocs/'ÀÔ´Ï´Ù.
     

    [root@jinnee conf]# cd ../htdocs/

     

    (³ª) ¾Æ·¡¿Í °°ÀÌ index.php ÆÄÀÏ°ú index.html ÆÄÀÏÀ» ¸¸µé¾î º¾´Ï´Ù.
     

    [root@jinnee htdocs]# cat > index.php
    <?
    phpinfo();
    ?>
    (¿©±â¼­ Ctrl+D¸¦ ´­·¯ÁÝ´Ï´Ù.)
    [root@jinnee htdocs]# cat > index.html
    <html>
    <?
    phpinfo();
    ?>
    </html>
    (¿©±â¼­ Ctrl+D¸¦ ´­·¯ÁÝ´Ï´Ù.)
    [root@jinnee htdocs]#

     

    (´Ù) À¥ ºê¶ó¿ìÀú¸¦ ½ÇÇà½ÃŲ ÈÄ ÀÚ½ÅÀÇ ÄÄÇ»ÅÍÀÇ ip address¸¦ Àû¾î¼­ È®ÀÎÇغ¸°Å³ª, ¾Æ·¡ÀÇ ¹æ¹ýÀ¸·Î PHP ³»¿ëÀÌ Ãâ·ÂµÇ´ÂÁö È®ÀÎÇØ º¾´Ï´Ù.

    À§¿Í °°ÀÌ È­¸éÀÌ Ãâ·ÂµÈ´Ù¸é ¸ðµç ¼³Ä¡¸¦ Á¤»óÀûÀ¸·Î ¸¶Ä£ °ÍÀÔ´Ï´Ù.

    ÀÌ»óÀ¸·Î APM Áï, Apache+PHP+MySQLÀÇ ¼³Ä¡¿¡ ´ëÇØ ¾Ë¾Æº¸¾Ò½À´Ï´Ù. ÃÖ´ëÇÑ ½±°Ô ¼³¸íÇÏ·Á°í ³ë·ÂÇÏ¿´À¸³ª ¹Þ¾ÆµéÀÌ´Â µ¶ÀÚÀÇ ÀÔÀåÀ» ¾î¶°ÇÒÁö ¸ð¸£´Â °ÍÀÌ ¾ÈŸ±õ½À´Ï´Ù. Ȥ ¼³Ä¡ Áß¿¡ ¹®Á¦°¡ »ý±â°Å³ª, Àǹ®ÀÌ »ý±â´Â »çÇ×ÀÌ ÀÖÀ¸¸é ÇÊÀÚÀÇ e-mail ÁÖ¼Ò 'freemir2k@intizen.com'À¸·Î ¿¬¶ôÇØÁÖ½Ã¸é ¾Æ´Â Çѵµ ³»¿¡¼­ ÃÖ´ëÇÑ ¼º½É ¼ºÀDz¯ ´äº¯ÇØ µå¸± °ÍÀ» ¾à¼Óµå¸³´Ï´Ù.




¡ã top

homeÀ¸·Î...