MySQL + Apache + PHP4 + IMAP + Zend Optimizer ¼³Ä¡Çϱâ

ÀÛ¼ºÀÚ: ¹é¸íÈÆ
E-mail:
mhbaek@chollian.net
URL:
http://www.rotaract.or.kr     http://linux.ks.ac.kr

ÃÖÁ¾¼öÁ¤ÀÏ: 2001³â 1¿ù28ÀÏ

¼³Ä¡È¯°æ
CPU : Intel Pentium III 333Mhz *2
RAM: 384M
HDD: IBM 9G
OS: Redhat Linux 7.0
Kernel: 2.2.16

¼³Ä¡¿¡ ÇÊ¿äÇÑ ÆÄÀÏ
imap-2000b.tar.Z (
ftp://ftp.cac.washington.edu/imap)
mysql-3.23.32.tar.gz  (
http://www.mysql.com/downloads/mysql-3.23.html)
apache_1.3.14.tar.gz  (
http://www.apache.org/mirrors/ )
php-4.0.4pl1.tar.gz (
http://www.php.net/downloads.php)
ZendOptimizer-1.0.0-PHP_4.0.4-Linux_glibc21-i386.tar.gz (
http://www.zend.com/download.php)

PHP Zend¸¦ ¼³Ä¡¸¦ Çغ¸°í ½Í¾îÇÏ´Â ºÐµéÀ» À§ÇØ ÀÌ ±ÛÀ» ÀÛ¼ºÇÕ´Ï´Ù.
°¡±ÞÀû Ãʺ¸ºÐµéÀ» À§ÇØ ÃÖ´ëÇÑ ½±°Ô ¼³¸íÇÏ¿´À¸³ª Àǹ®Á¡ÀÌ ÀÖÀ¸¸é ¸ÞÀÏÀ» ÁÖ¼¼¿ä.
±×µ¿¾È ÀÌ ±ÛÀ» ÀÐ°í ¿©·¯ °¡Áö ¹®Á¦Á¡À» ÁöÀûÇØ ÁֽŠºÐµé²² °¨»çµå¸³´Ï´Ù.
ÄÄÆÄÀÏÀ» À§ÇÑ ¼Ò½º´Â 2001³â1¿ù28ÀÏ ÇöÀç °¡Àå ÃֽŹöÁ¯À¸·Î ÇÏ¿´½À´Ï´Ù.

ÇöÀç Ãâ½ÃµÇ¾î ÀÖ´Â RedHat 7.0¿¡¼­ Àüü¼³Ä¡¸¦ ÇÏ°í, ¾÷µ¥ÀÌÆ® ¿¡ÀÌÁ¯Æ®¸¦ ÀÌ¿ëÇÏ¿© Àüü¾÷µ¥ÀÌÆ®¸¦ Çϸé php-4.0.4pl1À¸·Î ¾÷µ¥ÀÌÆ® µË´Ï´Ù.
¼³Ä¡°¡ ¾î·Æ°Ô ´À²¸Áö´Â ºÐÀº ·¹µåÇÞ7.0ÀÇ ±âº» RPMÆÐÅ°Áö¸¦ ÀÌ¿ëÇϼŵµ ¹«³­ÇÒ °Í °°±º¿ä.
ÀÌÈÄ »õ·Î¿î ¹öÀüÀÌ Ãâ½ÃµÇ¾î ¼³Ä¡¹æ¹ý¿¡ ¹®Á¦°¡ ÀÖÀ¸¸é Àú¿¡°Ô °³¼±¹æ¾ÈÀ» ¸ÞÀÏ·Î º¸³»ÁÖ½Ã¸é °¨»çÇÏ°Ú½À´Ï´Ù.

Áö±Ý ºÎÅÍ´Â °æ¾î¸¦ »ý·«ÇÏ°í ¼³¸íÇÏ°Ú½À´Ï´Ù.

¼³Ä¡¼ø¼­
1. ¼³Ä¡¿¡ ÇÊ¿äÇÑ ÆÄÀÏ ´Ù¿î¹Þ±â
2. RPMÀ¸·Î ¼³Ä¡µÈ ÆÐÅ°Áö Á¦°ÅÇϱâ
3. IMAP, MySQL, Apache, PHP4 ¹ÙÀ̳ʸ® ÆÄÀÏ ¾ÐÃàÇ®±â
4. IMAP ¼³Ä¡
5. MySQL ¼³Ä¡
6. Apache Configure(1)
7. PHP4¼³Ä¡
8. Apache Configure(2), ÄÄÆÄÀÏ
9. Zend Optimizer ¼³Ä¡
10. ȯ°æ¼³Á¤È­ÀÏ ÆíÁý
11. Test Çϱâ
12. ½Ã½ºÅÛ ºÎÆýà ÀÚµ¿À¸·Î ¾ÆÆÄÄ¡ µ¥¸ó°ú MySQLµ¥¸ó ½ÇÇàÇϱâ


1. ¼³Ä¡¿¡ ÇÊ¿äÇÑ ÆÄÀÏ ´Ù¿î¹Þ±â

imap-2000b.tar.Z (ftp://ftp.cac.washington.edu/imap)
mysql-3.23.32.tar.gz  (
http://www.mysql.com/downloads/mysql-3.23.html)
apache_1.3.14.tar.gz  (
http://www.apache.org/mirrors/ )
php-4.0.4pl1.tar.gz (
http://www.php.net/downloads.php)
ZendOptimizer-1.0.0-PHP_4.0.4-Linux_glibc21-i386.tar.gz (
http://www.zend.com/download.php)

ÇØ´ç »çÀÌÆ® ¶Ç´Â ¹Ì·¯»çÀÌÆ® µîÀ» ÀÌ¿ëÇÏ¿© ÆÄÀÏÀ» ´Ù¿î·Îµå ¹Þ´Â´Ù.
¾Æ´Ï¸é ÀúÀÇ È¨ÆäÀÌÁö¿¡¼­ ¹ÞÀ¸¼Åµµ µË´Ï´Ù. http://linux.ks.ac.kr

2. RPMÀ¸·Î ¼³Ä¡µÈ ÆÐÅ°Áö Á¦°ÅÇϱâ

ÁÖÀÇ: Áö±ÝºÎÅÍÀÇ ÀÛ¾÷Àº ¹Ýµå½Ã rootÀÇ ±ÇÇÑÀ¸·Î ÇØ¾ß ÇÑ´Ù.

¹èÆ÷º» ¸®´ª½º¿¡ ±âº»ÀûÀ¸·Î ¼³Ä¡µÇ¾î ÀÖ´Â RPM ÆÐÅ°Áö¸¦ Á¦°ÅÇÑ´Ù.
[root@www /root]#/etc/rc.d/init.d/httpd stop    ¾ÆÆÄÄ¡ µ¥¸óÀ» Á¾·á½ÃŲ´Ù.¶Ç´Â killall httpd
[root@www /root]#ps -ef | grep httpd    httpd µ¥¸óÀÌ ¾ø´Â °ÍÀ» È®ÀÎÇÏÀÚ.
[root@www /root]#/etc/rc.d/init.d/mysqld stop     mysql  µ¥¸óÀ» Á¾·á½ÃŲ´Ù.
[root@www /root]#ps -ef | grep mysqld  

[root@www /root]#rpm -qa | grep apache    ¼³Ä¡µÈ ¾ÆÆÄÄ¡ ÆÐÅ°Áö¸¦ °Ë»öÇÑ´Ù.
apache-1.3.14-3
apache-devel-1.3.14-3
................................

[root@www /root]#rpm -qa | grep php    ¼³Ä¡µÈ phpÆÐÅ°Áö¸¦ °Ë»öÇÑ´Ù.
...............................

[root@www /root]#rpm -qa | grep mysql    ¼³Ä¡µÈ mysql ÆÐÅ°Áö¸¦ °Ë»öÇÑ´Ù. (Âü°í: ¹èÆ÷ÆÇ¿¡ µû¶ó MySQL·Î °Ë»öÇØ¾ß ÇÒ °æ¿ìµµ ÀÖÀ½.)
..............................

[root@www /root]#rpm -qa | grep imapl    ¼³Ä¡µÈ imap ÆÐÅ°Áö¸¦ °Ë»öÇÑ´Ù.
imap-2000-3
imap-devel-2000-3  

[root@www /root]#rpm -e apache    
error: removing these packages would break defendencies:
    webserver is needed by mod_perl-1.24-6
    webserver is needed by mod_php-4.0.4pl1-1
    webserver is needed by mod_ssl-2.7.1-3
    webserver is needed by mod_dav-1.0.2-2 

¾ÆÆÄÄ¡¸¦ Á¦°ÅÇսôÙ. ±×·±µ¥ ¿¡·¯¸Þ½ÃÁö°¡ ¶ßÁÒ? ÀÇÁ¸¼ºÀÌ ÀÖ´Â ÆÐÅ°Áö¸¦ ¸ÕÀú Á¦°ÅÇÕ´Ï´Ù. 
[root@www /root]# rpm -e mod_perl
[root@www /root]# rpm -e php    (php¸¦ Áö¿ï ¶§ ÀÇÁ¸¼º ¹®Á¦°¡ ¶ß´Â ÆÐÅ°Áöµµ °°Àº ¹æ¹ýÀ¸·Î Áö¿î´Ù)
[root@www /root]# rpm -e mod_ssl
[root@www /root]# rpm -e mod_dav

ÀÇÁ¸¼ºÀÌ ÀÖ´Â ÆÐÅ°Áö¸¦ Á¦°ÅÇÏ°í ¾ÆÆÄÄ¡µµ Á¦°ÅÇÕ´Ï´Ù.
[root@www /root]# rpm -e apache
[root@www /root]# rpm -e apache-devel (óÀ½ ¾ÆÆÄÄ¡ÀÇ ÆÐÅ°Áö °Ë»ç½Ã¿¡ º¸¿´´ø ÆÐÅ°Áö¸¦ ¸ðµÎ Áö¿î´Ù)

³ª¸ÓÁö php, mysql, imap°ü·Ã ÆÐÅ°Áöµµ À§¿Í °°Àº ¹æ¹ýÀ¸·Î Áö¿ó´Ï´Ù.

¹èÆ÷ÆÇÀÌ »ý¼º½ÃŲ MySQL µ¥ÀÌÅ͵µ Áö¿ó´Ï´Ù.
[root@www /root]# rm -rf /var/lib/mysql

3. IMAP, MySQL, Apache, PHP4 ¹ÙÀ̳ʸ® ÆÄÀÏ ¾ÐÃàÇ®±â

¼Ò½ºÈ­ÀϵéÀÌ tmp µð·ºÅ丮¿¡ ÀÖ´Ù°í °¡Á¤ÇÏ°í ¼³¸íÇÑ´Ù. root°èÁ¤À¸·Î ·Î±×¿Â µÇ¾î ÀÖÀ¸¸é ¼³Ä¡È­ÀÏÀÌ ¾îµð¿¡ À־ »ó°üÀº ¾ø´Ù.
[root@www /tmp]# tar zxvf imap-2000b.tar.Z
[root@www /tmp]# tar zxvf mysql-3.23.32.tar.gz
[root@www /tmp]# tar zxvf apache_1.3.14.tar.gz
[root@www /tmp]# tar zxvf php-4.0.4pl1.tar.gz

4. IMAP ¼³Ä¡
[root@www /tmp]# mv imap-2000b  /usr/local/imap
[root@www /tmp]# cd /usr/local/imap
[root@www /imap]# make slx  imapÀ» ÄÄÆÄÀÏ ÇÑ´Ù

ÄÄÆÄÀÏÀÌ ¿Ï·áµÇ¸é imapd µð·ºÅ丮¿¡ imapd°¡ ipopdµð·ºÅ丮¿¡´Â ipop2d, ipop3d°¡ »ý¼ºµÈ´Ù.
ipop2d´Â Àß ¾²Áö ¾ÊÀ¸¹Ç·Î º¹»çÇÏÁö ¾Ê¾Æµµ µÈ´Ù.

[root@www imap]# cp imapd/imapd /usr/sbin »ý¼ºµÈ ½ÇÇàÈ­ÀϵéÀ» º¹»çÇÑ´Ù.
[root@www imap]# cp ipopd/ipop3d /usr/sbin

À̵éÀº xinetd ½´ÆÛµ¥¸ó¿¡ ÀÇÇؼ­ ½ÇÇàµÇ¹Ç·Î Ŭ¶óÀ̾ðÆ® ÂÊ¿¡¼­ Á¢¼ÓÇÏ¿© »ç¿ëÇÒ ¼ö ÀÖµµ·Ï ÇÏ·Á¸é ȯ°æ¼³Á¤À» ¼öÁ¤ÇØ ÁÖ¾î¾ß ÇÑ´Ù.
¹èÆ÷ÆÇ ·¹µåÇÞ6.2ÀÌÇÏ¿¡¼­´Â inetd ½´ÆÛµ¥¸ó¿¡ ÀÇÇØ ½ÇÇàµÇ¹Ç·Î ȯ°æ¼³Á¤ÀÌ Á¶±Ý ´Ù¸£´Ù.

[root@www imap]# cd /etc/xinetd.d
[root@www xinetd.d]#  vim imapd    imapd ½ÇÇàÀ» À§ÇÑ È¯°æ¼³Á¤È­ÀÏÀ» »ý¼º½ÃŲ´Ù.

service imap
{
        disable = no
        socket_type = stream
        wait  = no
        user = root
        server = /usr/sbin/imapd
        log_on_success += DURATION USERID
        log_on_failure += USERID
}

[root@www xinetd.d]#  vim ipop3d

service pop3
{
        disable = no
        socket_type = stream
        wait  = no
        user = root
        server = /usr/sbin/ipop3d
        log_on_success += USERID
        log_on_failure += USERID
}

[root@www xinetd.d]# vim /etc/services
......
pop3            110/tcp         pop-3           # POP version 3
pop3            110/udp        pop-3                                          
......
imap2          143/tcp         imap            # Interim Mail Access Proto v2
imap2          143/udp        imap                                          
......

[root@www xinetd.d]# /etc/rc.d/init.d/xinetd restart    ½´ÆÛµ¥¸óÀ» Àç°¡µ¿ÇÑ´Ù.

Stopping xinetd: [  OK  ]
Starting xinetd: [  OK  ]

telnetÀ» ÀÌ¿ëÇÏ¿© ·ÎÄÃÈ£½ºÆ® 110Æ÷Æ®(pop3)·Î Á¢¼ÓÇÏ¿© Å×½ºÆ®ÇÑ´Ù.

[root@www xinetd.d]# telnet localhost 110

Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
+OK POP3 localhost.localdomain v2000.70 server ready
user mhbaek
+OK User name accepted, password please
pass abc123
+OK Mailbox open, 0 messages
quit
+OK Sayonara
Connection closed by foreign host.

IMAPÀº ±âº»ÀûÀ¸·Î 143 Æ÷Æ®¸¦ »ç¿ëÇÑ´Ù.

5. MySQL ¼³Ä¡

[root@www /tmp]#cd mysql-3.23.32
[root@www /mysql-3.23.32]#./configure --prefix=/usr/local/mysql \
                                            --with-charset=euc_kr

\(¿ª½½·¡½Ã) Ç¥½Ã´Â ÀÔ·ÂÇÒ ³»¿ëÀÌ ¸¹À» °æ¿ì ´ÙÀ½ÁÙ¿¡¼­ º¸±â ÁÁ°Ô ÀÔ·ÂÇϵµ·Ï ÇØÁØ´Ù.
¿É¼Ç°ú ¿É¼Ç»çÀÌ´Â °ø¹é Çϳª¸¸ ÀÖÀ¸¸é µÈ´Ù.
À§ ¿É¼ÇÀº ¼³Ä¡µð·ºÅ丮¸¦ ÁöÁ¤ÇÏ°í ÇѱÛÀ» Áö¿øÇϵµ·Ï ÇÏ´Â ¿É¼ÇÀÌ´Ù.
DB µ¥ÀÌÅ͸¦ ÀúÀåÇÒ µð·ºÅ丮¸¦ ÁöÁ¤À» ÇÏ·Á¸é --localstatedir=/usr/local/mysql/data ¿Í °°ÀÌ ÇØ ÁØ´Ù.
Ȥ½Ã ½Ç¼ö·Î ȯ°æ¼³Á¤À» ´Ù½Ã ÇؾßÇÒ °æ¿ì make distclean ¸í·ÉÀ» ÇÑ´Ù.

ÀÌ¿Ü¿¡µµ ÇÊ¿äÇÑ ¿É¼Ç¿¡ ´ëÇÏ¿© ¾Ë°í ½ÍÀ¸¸é  ./configure --help ¸í·ÉÀ¸·Î »ìÆ캸¼¼¿ä.

Thank you for choosing MySQL! À̶ó´Â ¸Þ½ÃÁö°¡ ¶ã°ÍÀÌ´Ù.

[root@www /mysql-3.23.32]#make    ÄÄÆÄÀÏÀ» ÇÑ´Ù.
½Ã½ºÅÛ »ç¾ç¿¡ µû¶ó ½Ã°£ Â÷ÀÌ°¡ ÀÖÀ¸¹Ç·Î »ç¾çÀÌ ³·Àº ÄÄÇ»ÅÍ´Â Á¶±Ý ±â´Ù¸®¼¼¿ä. ^^

[root@www /mysql-3.23.32]#make install    MySQLÀ» ¼³Ä¡ÇÑ´Ù.

[root@www /mysql-3.23.32]#cd /usr/local/mysql/bin    MySQLÀÌ ¼³Ä¡µÈ µð·ºÅ丮·Î À̵¿ÇÑ´Ù.
[root@www /bin]#./mysql_install_db    MySQLÀÇ µ¥ÀÌÅ͸¦ °ü¸®ÇÒ ±âÃÊÁ¤ÀÎ Å×À̺í 6°³¸¦ »ý¼º½ÃŲ´Ù.

ÁÖÀÇÇÒ Á¡Àº mysql_install_dbÀº ¹Ýµå½Ã Çѹø¸¸ ½ÇÇà½ÃÄÑ¾ß ÇÑ´Ù.

[root@www /bin]#cd /usr/local/mysql/share/mysql
[root@www /mysql]#vi mysql.server

ÆíÁý±â·Î ¿­¾î¼­ safe_mysqlÀÌ ½ÇÇàµÇ´Â ¶óÀÎ(78 line)¿¡ --language=korean ¿É¼ÇÀ» Ãß°¡ÇÑ´Ù.

$bindir/safe_mysqld --user=$mysql_daemon_user --pid-file=$pid_file --datadir=$datadir --language=korean &

[root@www /mysql]#chmod 755 mysql.server    ½ÇÇà±ÇÇÑÀ» ÁØ´Ù.

mysqlµ¥¸óÀÇ ½ÃÀÛ°ú Á¾·á ¹× °ü·Ã ¸í·É¾î¸¦ »ç¿ëÇϱâ ÆíÇÏ°Ô ÇϱâÀ§Çؼ­ ½Ã½ºÅÛ ºÎÆÃȯ°æ¿¡ PATH¸¦ ÁöÁ¤ÇصдÙ.
[root@www /mysql]# cp -p ./mysql.server /usr/local/mysql/bin
[root@www /mysql]# vim /etc/profile

# /etc/profile
# System wide environment and startup programs
# Functions and aliases go in /etc/bashrc

PATH="$PATH:/usr/X11R6/bin:/usr/local/mysql/bin"

[root@www /mysql]#mysql.server start    MySQL µ¥¸ó ½ÃÀÛÇϱâ, ¿£Å͸¦ Çѹø µÎµå¸®¼¼¿ä.
 Âü°í·Î mysql.server´Â mysqlÀÌ Á¤»óÀûÀ¸·Î ½ÇÇàµÇµµ·Ï Â¥¿© ÀÖ´Â ½ºÅ©¸³Æ®È­ÀÏÀÌ´Ù.

[root@www /mysql]#ps -ef | grep mysql    MySQL ÇÁ·Î¼¼½º È®ÀÎÇϱâ
[root@www /mysql]#mysql.server stop    MySQL µ¥¸ó Á¾·áÇϱâ

6. Apache Configure(1)

[root@www /mysql]#cd /tmp/apache_1.3.14    Ãʱ⿡ ¾ÆÆÄÄ¡¼Ò½º ¾ÐÃàÀ» Ç®¾î³õÀº °÷À¸·Î À̵¿.
[root@www /apache_1.3.14]#./configure --prefix=/usr/local/apache

 

7. PHP4¼³Ä¡

[root@www /apache_1.3.14]#cd ..
[root@www /tmp]#cd php-4.0.4pl1
[root@www /php-4.0.4pl1]#./configure --with-config-file-path=/etc/httpd --disable-debug \
--with-imap=/usr/local/imap --with-mysql=/usr/local/mysql --with-apache=../apache_1.3.14 \
--enable-track-vars --prefix=/usr --with-regex=system --with-gettext --with-gd=shared \
--with-jpeg-dir=/usr --with-png --with-zlib --enable-pic --with-db2 --with-db3 --with-gdbm \
--enable-debugger --enable-magic-quotes --enable-safe-mode --enable-sysvsem \
--enable-sysvshm --with-exec-dir=/usr/bin  --enable-ftp --enable-inline-optimization \
--with-xml --with-ldap  --enable-shared --enable-yp

¿É¼Ç¿¡ ´ëÇÑ Ãß°¡ ¼³¸íÀº PHP¸Þ´º¾óÀ» Âü°íÇϱ⠹ٶø´Ï´Ù.
¸¸¾à PostgeSQLÀ̳ª mSQLÀ» »ç¿ëÇÑ´Ù¸é --with-pgsql=µð·ºÅ丮°æ·Î --with-msql=µð·ºÅ丮 °æ·Î¿Í °°ÀÌ ¿É¼ÇÀ» »ç¿ëÇÏ¸é µÈ´Ù.
--enable-track-vars  ¿É¼ÇÀº HTTP_GET_VARS, HTTP_POST_VARS, HTTP_COOKIE_VARS ¹è¿­¿¡ µé¾î ÀÖ´Â GET, POST, cookie º¯¼öµéÀÌ ¾îµð¼­ ¿Ô´ÂÁö ±â¾ïÇϵµ·Ï ÇÕ´Ï´Ù. ²À ¼³Á¤ÇØ µÎ¼¼¿ä.
--disable-debug  ¿É¼ÇÀº Zend Optimizer ¸¦ À§ÇÑ ¿É¼ÇÀÔ´Ï´Ù.

À§ÀÇ ¸¹Àº ¿É¼ÇµéÀ» ¸ðµÎ ¼³Ä¡ÇÏ½Ç ÇÊ¿ä´Â ¾ø½À´Ï´Ù. ¹èÆ÷ÆÇÀÎ ·¹µåÇÞÀÇ ±âº»¼³Á¤¿¡¼­ Àú°¡ ÇÊ¿äÇÑ °ÍµéÀ» ¿¹¸¦ µé¾î ³ª¿­ÇÑ °ÍÀ̹ǷΠ²À ÇÊ¿äÇÑ ¿É¼Ç¸¸ »ç¿ëÇÏ½Ã¸é µË´Ï´Ù.
±×Áß¿¡¼­ ÆĶõ»öÀ¸·Î µÇ¾î ÀÖ´Â ¿É¼ÇÀº ±âº»ÀûÀ¸·Î ±ÇÀåÇÏ´Â ¿É¼ÇµéÀÔ´Ï´Ù.

[root@www /php-4.0.4pl1]#make    ÄÄÆÄÀÏÀ» ÇÏ°í,
[root@www /php-4.0.4pl1]#make install    ÀνºÅçÀ» ÇÑ´Ù.

 

8. Apache Configure(2), ÄÄÆÄÀÏ

[root@www /php-4.0.4pl1]#cd /tmp/apache_1.3.14
[root@www /apache_1.3.14]#./configure --prefix=/usr/local/apache \
--activate-module=src/modules/php4/libphp4.a

´Ü°ñ·Î ¹¯´Â Áú¹®ÀÇ ¿øÀÎ Áß¿¡ Çϳª°¡ À§ÀÇ ¿É¼Ç ¶§¹®ÀÔ´Ï´Ù. ¿É¼ÇÀ» ÁÙ ¶§ ±×³É TAB key¸¦ µÎ¸£¸®Áö ¸»°í À§ ¿É¼ÇÀ» Àß º¸°í ÀÔ·ÂÇϼ¼¿ä.

[root@www /apache_1.3.14]#make    ¾ÆÆÄÄ¡¸¦ ÄÄÆÄÀÏÇÑ´Ù.
[root@www /apache_1.3.14]#make install    ¾ÆÆÄÄ¡ ÀνºÅç

9. Zend Optimizer ¼³Ä¡

[root@www /apache_1.3.14]#cd /tmp
[root@www /tmp]#tar zvxf ZendOptimizer-1.0.0-PHP_4.0.4-Linux_glibc21-i386.tar.gz
[root@www /tmp]#mkdir /usr/local/Zend
[root@www /tmp]#mv ZendOptimizer-1.0.0-PHP_4.0.4-Linux_glibc21-i386 /usr/local/Zend/lib

¡¡

10. ȯ°æ¼³Á¤ ÆÄÀÏ ÆíÁý

[root@www /tmp]# cp /tmp/php-4.0.4pl1/php.ini-dist   /etc/httpd/php.ini

[root@www /tmp]#vim /etc/httpd/php.ini    php.ini ÆÄÀÏÀ» ¿­¾î¼­ ¸Ç ¸¶Áö¸·¿¡ ´ÙÀ½°ú °°ÀÌ Optimizer¸¦ À§ÇÑ ¼³Á¤À» Ãß°¡ÇÑ´Ù.   

zend_optimizer.optimization_level=15
zend_extension="/usr/local/Zend/lib/ZendOptimizer.so"

[root@www /tmp]#vim /usr/local/apache/conf/httpd.conf    ¾ÆÆÄÄ¡ÀÇ È¯°æ¼³Á¤ ÆÄÀÏÀ» ¿­¾î¼­ ´ÙÀ½°ú °°Àº ¼³Á¤À» ÇÑ´Ù.   

360¶óÀÎÂë¿¡ Default ½ÃÀÛÆäÀÌÁö ¼³Á¤À» ÇØ ÁØ´Ù
<IfModule mod_dir.c>
DirectoryIndex index.php index.php3  index.php4 index.html index.htm
</IfModule>

720¶óÀÎ Á¤µµ¿¡¼­ ´ÙÀ½ ³»¿ëÀÇ ÁÖ¼®À» Ç®°í ¿øÇϴ ȯ°æÀ¸·Î ¼³Á¤À» ÇÑ´Ù.

AddType application/x-httpd-php .php .php3 .ph
AddType application/x-httpd-php-source .phps

apache µ¥¸óÀÇ ½ÃÀÛ, Á¾·á, Àç½ÃÀÛÀ» ÆíÇÏ°Ô Çϱâ À§ÇÏ¿© ´ÙÀ½ ÀÛ¾÷À» ÇÑ´Ù.
[root@www /tmp]#cd /root
[root@www /root]#vim .bash_profile

PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH:$HOME/bin:/usr/local/apache/bin

 root ¿¡¼­¸¸ ÇÊ¿äÇϹǷΠrootÀÇ PATH¿¡ ¾ÆÆÄÄ¡ÀÇ µð·ºÅ丮¸¦ ÁöÁ¤ÇÑ´Ù. ´Ù½Ã root·Î ·Î±×ÀÎ ÇÏ¸é ¼³Á¤À» Àû¿ëÇÏ¿© »ç¿ëÇÒ ¼ö ÀÖ´Ù.

[root@www /root]# /usr/local/apache/httpd -t    ¿£Å͸¦ µÎµå¸®°í  ´ÙÀ½°ú °°Àº ¸Þ½ÃÁö¸¸ ÀÖÀ¸¸é ¾ÆÆÄÄ¡ ȯ°æÀÌ Àß ¼³Á¤µÇ¾ú´Ù.

Syntex OK

¸¸ÀÏ ¿¡·¯°¡ ¹ß»ýÇÏ¸é ¸î ¹ø° ¶óÀο¡¼­ À߸øµÇ¾ú´Ù´Â ¸Þ½ÃÁö¸¦ Àß º¸°í ¼öÁ¤Çϱ⠹ٶø´Ï´Ù.

[root@www root]# /usr/local/apache/apachectl start
/usr/bin/apachectl start: httpd started    ÀÌ·± ¸Þ¼¼Áö°¡ º¸ÀÎ´Ù¸é ¾ÆÆÄÄ¡°¡ Á¤»óÀûÀÎ ½ÇÇàÀÌ µÈ °ÍÀÌ´Ù.

 

11. Test Çϱâ

Å×½ºÆ® È­ÀÏÀ» ¸¸µé¾î È®ÀÎÀ» ÇØ º¸¼¼¿ä. ¹°·Ð ȨÆäÀÌÁö°¡ ¶ã ¼ö ÀÖ´Â µð·ºÅ丮°¡ µÇ¾î¾ß ÇÕ´Ï´Ù.
¸ÞÀΠȨÆäÀÌÁö °æ·Î´Â ¾ÆÆÄÄ¡ ȯ°æ¼³Á¤ÆÄÀÏ 281¶óÀÎ Á¤µµ¿¡¼­ DocumentRoot "/usr/local/apache/htdocs"¿¡ ÀÇÇØ ¼³Á¤µÈ °æ·ÎÀÔ´Ï´Ù.

[root@www /root]#vim /usr/local/apache/htdocs/test.php

¿¡µðÅÍ Ã¢¿¡¼­ ´ÙÀ½³»¿ëÀ» ÀÔ·ÂÇÕ´Ï´Ù.

<?
phpinfo();
?>


ÀúÀåÀ» ÇÏ°í ºê¶ó¿ìÀú¿¡¼­ http://localhost/test.php ¶Ç´Â ȨÆäÀÌÁöURL/test.php¸¦ ÀÔ·ÂÇÏ¿© ¾î¶² ³»¿ëÀÌ Ãâ·ÂµÇ´ÂÁö º¾½Ã´Ù.

´ÙÀ½°ú °°Àº ³»¿ëÀÌ Ãâ·ÂµÈ´Ù¸é Á¤»óÀûÀ¸·Î ¼³Ä¡°¡ Àß µÇ¾ú½À´Ï´Ù.

PHP Version 4.0.4pl1


System Linux linux.kyungsung.ac.kr 2.2.16-22smp #1 SMP Tue Aug 22 16:39:21 EDT 2000 i686 unknown
Build Date Nov 27 2000
Configure Command

'./configure' '--with-config-file-path=/etc/httpd' '--disable-debug' '--with-imap=/usr/local/imap' '--with-mysql=/usr/local/mysql' '--with-apache=../apache_1.3.14' '--enable-track-vars' '--prefix=/usr' '--with-regex=system' '--with-gettext' '--with-gd=shared' '--with-jpeg-dir=/usr' '--with-png' '--with-zlib' '--enable-pic' '--with-db2' '--with-db3' '--with-gdbm' '--enable-debugger' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sysvsem' '--enable-sysvshm' '--with-exec-dir=/usr/bin' '--enable-ftp' '--enable-inline-optimization' '--with-xml' '--with-ldap' '--enable-shared' '--enable-yp'

Server API Apache
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/httpd
ZEND_DEBUG disabled
Thread Safety disabled

Zend logo This program makes use of the Zend scripting language engine:
Zend Engine v1.0.3, Copyright (c) 1998-2000 Zend Technologies
    with Zend Optimizer v1.0.0, Copyright (c) 1998-2000, by Zend Technologies


¼Óµµ Å×½ºÆ®

ÀÚ½ÅÀÇ ½Ã½ºÅÛ¿¡¼­ ´ÙÀ½°ú °°Àº ÇÁ·Î±×·¡¹ÖÀ¸·Î OptimizerÇϱâÀü°ú ºñ±³ÇØ º¸¼¼¿ä.

<?
    $start = time();
    for ( $i = 1; $i <= 5000000; $i++ );
    $t_time = time() - $start;
    echo "Time : $t_time";
?>              
Âü°í·Î ÀúÀÇ PC¿¡¼­´Â óÀ½ 14ÃÊ°¡ ³ª¿Ô´Âµ¥ Optimizer¸¦ ÇÏ°í³­ÈÄ 7ÃÊ°¡ ³ª¿Ô½À´Ï´Ù.

 

12. ½Ã½ºÅÛ ºÎÆýà ÀÚµ¿À¸·Î ¾ÆÆÄÄ¡ µ¥¸ó°ú MySQLµ¥¸ó ½ÇÇàÇϱâ

/etc/rc.d/rc.local ÆÄÀÏÀ» ¿­¾î¼­ ¸¶Áö¸· ÁÙ¿¡ ´ÙÀ½ ¸í·ÉÀ» ÀÔ·ÂÇÑ´Ù.

[root@www /root]#vim /etc/rc.d/rc.local

/usr/local/apache/bin/apachectl start
/usr/local/mysql/bin/mysql.server &

¶Ç´Â ´ÙÀ½°ú °°ÀÌ ¹èÆ÷ÆÇó·³ ºÎÆýà ½ÇÇà°úÁ¤À» È®ÀÎÇϵµ·Ï ¸¸µé ¼öµµ ÀÖ´Ù.

[root@www root]# cp -p /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
[root@www root]# cp -p /usr/local/mysql/bin/mysql.server /etc/rc.d/init.d/mysqld
[root@www root]# cd /etc/rc.d/rc3.d
[root@www rc3.d]# ln -s /etc/rc.d/init.d/httpd S85httpd
[root@www rc3.d]# ln -s /etc/rc.d/init.d/mysqld S85mysqld

Ȥ½Ã ¼­¹ö¸¦ xwindow·Î ºÎÆõǵµ·Ï Çصξú´Ù¸é /etc/rc.d/rc5.d µð·ºÅ丮¿¡ °°Àº ¹æ¹ýÀ¸·Î ¼³Á¤ÇØ µÎ¸é µÈ´Ù

[root@www2 rc3.d]#reboot    ¸®ºÎÆÃÀ» ½ÃÄÑ Àß ½ÇÇàÀÌ µÇ´ÂÁö È®ÀÎÇÏÀÚ.

ÀÌ»óÀ¸·Î MySQL+Apache+PHP4+IMAP+Zend Optimizer ÀÇ ¼³Á¤À» ¸ðµÎ ¸¶ÃƽÀ´Ï´Ù.
ºÎÁ·ÇÑ ³»¿ëÀÌ ¸¹Áö¸¸ ÀÌ ±ÛÀ» ÅëÇØ ¸®´ª½º¿¡ ÀÔ¹®ÇÏ´Â ºÐµé²² ¸¹Àº µµ¿òÀÌ µÇ±â¸¦ ¹Ù¶ø´Ï´Ù.

2001. 1. 28     ¹é¸íÈÆ(mhbaek@chollian.net)