1. ¼³Ä¡ÆÄÀÏ ´Ù¿î·Îµå apache : http://httpd.apache.org/download.cgi php : http://kr.php.net mysql : http://www.mysql.com (Community server is free) zend optimizer : http://www.zend.com/en/ ######################### APM ¼³Ä¡ ######################### 1. MySQL ¼³Ä¡ http://www.mysql.com/¿¡¼­ ¼³Ä¡ÆÄÀÏ ´Ù¿î·Îµå(SUN¿¡¼­ ÀμöÇÑÈÄ ÀϺΠÀ¯·áÈ­ µÊ.) Windows ȯ°æº¯¼ö path¿¡ mysql\bin µð·ºÅ丮 µî·Ï 2. Apache ¼³Ä¡ http://httpd.apache.org/download.cgi ¿¡¼­ ¼³Ä¡ÆÄÀÏ(apache_2.2.8-win32-x86-openssl-0.9.8g.msi-Windows¿ë) ´Ù¿î·Îµå 3. PHP ¼³Ä¡ http://kr.php.net/downloads.php ¿¡¼­ ¼³Ä¡ ÆÄÀÏ(php-5.2.5-win32-installer.msi ȤÀº php-5.2.5-Win32.zip) ´Ù¿î·Îµå php5ts.dllÆÄÀÏÀ» windows\system32Æú´õ¿¡ º¹»ç 4. Zend Optimizer ¼³Ä¡ ¼³Ä¡ Àü¿¡ PHP Root Æú´õ¿¡ php.ini ÆÄÀÏÀÌ ÀÖ¾î¾ß ÇÑ´Ù. ######################### Apache ȯ°æ ¼³Á¤ ######################### 1. Apache ¼³Ä¡ °æ·ÎÀÇ confÆú´õ(D:/WWW_Service/PHP/Apache/conf)¿¡ ÀÖ´Â hpptd.conf ÆÄÀÏ ¿­±â 2. ¾Æ·¡ÀÇ ³»¿ëÀ¸·Î ¼öÁ¤Çϰųª Ãß°¡ #Start configuration------------------------------------------ #ServerRoot´Â apache°¡ ¼³Ä¡µÈ °æ·Î¸¦ ¸»ÇÔ. ServerRoot "D:/WWW_Service/PHP/Apache" #ListenÀº http ÇÁ·ÎÅäÄÝ·Î ¿¬°áÇÒ Æ÷Æ® ¹øÈ£ÀÓ. ±âº» 80 Listen 80 #¼³Ä¡ÇÒ¶§ ÀÔ·ÂÇÑ Á¤º¸ ServerAdmin justonesoul@naver.com #¼³Ä¡ÇÒ¶§ ÀÔ·ÂÇÑ Á¤º¸ ServerName localhost:80 #WWW(À¥ ÆäÀÌÁö)·Î »ç¿ëÇÒ Æú´õÀÇ ½ÇÁ¦ °æ·Î¸¦ Ç¥½Ã. \´Â /·Î º¯°æÇÏ¿© Ç¥½Ã DocumentRoot "D:/WWW_Service/PHP/WebDocs" # This should be changed to whatever you set DocumentRoot to. # DocumentRoot·Î ¼³Á¤ÇÑ °æ·Î¿Í µ¿ÀÏÇÏ°Ô ¼³Á¤ #http://scdc.iptime.orgó·³ µµ¸ÞÀÎÁÖ¼Ò¸¸ ÃÆÀ»¶§ ±âº»ÀûÀ¸·Î º¸¿©ÁÙ ÆäÀÌÁö ÁöÁ¤. #¿©·¯°³ ÁöÁ¤½Ã ¼ø¼­´ë·Î ÆÄÀÏÀ» °Ë»çÇÏ¿© ÆÄÀÏÀÌ ¾øÀ¸¸é ´ÙÀ½ ÆÄÀÏÀÌ º¸¿©Áö°Ô µÊ. DirectoryIndex index.php index.html #Alias¼³Á¤¹× URI ±âº» ¾ð¾î ¼³Á¤. #D:/WWW_Service/PHP/Apache¸¦ ½ÇÁ¦ apache °æ·Î·Î º¯°æÇؼ­ »ç¿ëÇÏ¸é µË´Ï´Ù. AliasMatch ^/manual(?:/(?:ko|de|en|es|fr|ja|ru))?(/.*)?$ "D:/WWW_Service/PHP/Apache/manual$1" SetEnvIf Request_URI ^/manual/(ko|de|en|es|fr|ja|ru)/ prefer-language=$1 RedirectMatch 301 ^/manual(?:/(ko|de|en|es|fr|ja|ru)){2,}(/.*)?$ /manual/$1$2 #½ÇÁ¦ °æ·Î¸¦ °£´ÜÇÏ°Ô »ç¿ëÇϵµ·Ï ÁöÁ¤ÇÔ. ScriptAlias /cgi-bin/ "D:/WWW_Service/PHP/Apache/cgi-bin/" ScriptAlias /php/ "D:/WWW_Service/PHP/Php/" DefaultType text/plain #À¥ÆäÀÌÁö ±âº» ¾ð¾î¸¦ Çѱ¹¾î·Î ¼³Á¤. ....... LanguagePriority ko en ca cs da de el eo es et fr he hr it ja ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW DefaultLanguage ko AddDefaultCharset EUC-KR #PHP ¸ðµâÀ» »ç¿ëÇϱâ À§ÇØ ¹Ýµå½Ã ÇÊ¿äÇÑ ¼³Á¤ #Start php------------------------------------------ PHPIniDir "/php/" LoadModule php5_module "/php/php5apache2_2.dll" #php ¸ðµâÀ» ¼öÇàÇϵµ·Ï È®ÀåÀÚ µî·Ï. ±âº»ÀûÀ¸·Î php¸¸ µî·ÏµÇÁö¸¸ html, htmµµ µî·Ï½Ã php ÆÄÀϷΠ󸮵Ê. AddType application/x-httpd-php .php .html .htm .inc .phtml AddType application/x-httpd-php-source .phps Action application/x-httpd-php "/php/php.exe" #End php------------------------------------------ #End configuration------------------------------------------ ¡Ø º¸¾È¹®Á¦. ÁÖ¼ÒÇ¥½ÃÁÙ¿¡ http://scdc.iptime.org/test/·Î ÀԷ½à À¥¼­¹öÀÇ Æú´õ ¸ñ·ÏÀÌ ³ª¿ÀÁö ¾Êµµ·Ï ó¸®. autoindex ±â´ÉÀ» Á×ÀδÙ..(#Àº ÁÖ¼®Ã³¸®¸¦ ÀǹÌÇÔ) #LoadModule autoindex_module modules/mod_autoindex.so ######################### PHP ȯ°æ ¼³Á¤ ######################### 1. PHP ¼³Ä¡ °æ·ÎÀÇ php.ini ÆÄÀÏ ¿­±â 2. ¾Æ·¡ÀÇ ³»¿ëÀ¸·Î ¼öÁ¤Çϰųª Ãß°¡ ;Start configuration------------------------------------------ asp_tags = Off max_execution_time = 30 ; Maximum execution time of each script, in seconds max_input_time = 60 ; Maximum amount of time each script may spend parsing request data memory_limit = 128M ; Maximum amount of memory a script may consume (8MB) error_reporting = E_ALL & ~(E_NOTICE | E_USER_NOTICE | E_WARNING | E_COMPILE_WARNING | E_CORE_WARNING | E_USER_WARNING) ; display all errors display_errors = On ;°³¹ß½Ã¿¡¸¸ On register_globals = Off ;Get, Post ¹æ½ÄÁß Post¹æ½Ä »ç¿ë½Ã ÃÖ´ë Å©±â ÁöÁ¤ post_max_size = 128M magic_quotes_gpc = On ;±âº» ¹®ÀÚ¼ÂÀ» Çѱ¹¾î·Î ÁöÁ¤ default_charset = "euc_kr" ;ÆÄÀÏ ¾÷·Îµå »ç¿ë ¹× ÃÖ´ë ¾÷·Îµå Å©±â ÁöÁ¤ file_uploads = On upload_max_filesize = 500M allow_url_fopen = Off SMTP = localhost ; for Win32 only smtp_port = 25 session.save_handler = files session.use_cookies = 1 short_open_tag = On ; echo ´ë½Å create database dbName; mysql>show databases; 7.»ç¿ëÀÚ »ý¼º & »ç¿ëÀÚ¿¡°Ô DBÇÒ´ç zbAdmin»ç¿ëÀÚ¿¡°Ô zb µ¥ÀÌÅÍ º£À̽ºÀÇ select,insert,update,delete ±ÇÇÑÀ» µî·Ï mysql> grant select,insert,update,delete on zb.* to zbAdmin@localhost identified by 'Æнº¿öµå' with grant option; mysql >flush privileges; mysql> grant select,insert,update,delete on scdc.* to scdcManager@localhost identified by 'Æнº¿öµå' with grant option; 8. Å×À̺í»ý¼º mysql>use scdc; mysql> create table Driver_List( dNo int(10) not null auto_increment, dClass varchar(40) not null, dTitle varchar(255) not null, dComment text not null, dFile varchar(255) not null, primary key(dNo) ); create table Customer_List( cNo int(10) not null auto_increment, cName varchar(20) not null, cMobile varchar(14), cTel varchar(14), cAddr varchar(60), cMemo text, primary key(cNo) ); alter table Customer_List add(serviceCnt int(3) not null default 0); create table Service_List( sNo int(10) not null auto_increment, cNo int(10) not null, sComment text not null, sDate varchar(16) not null, sCost varchar(8) not null, primary key(sNo) ); mysql> show tables; mysql> desc Driver_List; mysql>create database study; mysql> create table lecture( sNo int(10) not null auto_increment, sClass varchar(40) not null, sTitle varchar(255) not null, sContent text not null, sDay varchar(16) not null, sFile varchar(255), primary key(sNo) ); mysql>grant select,insert,update,delete on study.* to scdcManager@localhost identified by 'Æнº¿öµå' with grant option; create table bbsBoard ( bbsNo int(11) not null auto_increment, bbsTitle varchar(200) not null, bbsContext text not null, viewCnt int(11) not null default 0, fileName1 varchar(255), fileName2 varchar(255), fileName3 varchar(255), fileName4 varchar(255), fileName5 varchar(255), fileSize1 int(11), fileSize2 int(11), fileSize3 int(11), fileSize4 int(11), fileSize5 int(11), bbsdate date default 'now()' not null, primary key (bbsNo) ); CREATE TABLE `aa` ( `a` int(11) default NULL, `b` tinyint(4) default NULL, `c` smallint(6) default NULL, `d` bigint(20) default NULL, `e` varchar(10) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 Å×ÀÌºí ³» »õ·Î¿î Çʵå Ãß°¡½Ã alter table Custmoer_List add(serviceCnt int(3) not null default 0); %%%%% ÁÖÀÇ »çÇ× : ÇѱÛÀÌ ±ú¾îÁöÁö ¾Ê°Ô ÇÏ·Á¸é DB¸¦ »ý¼ºÇϱâ Àü¿¡ apache, php, mysql¿¡¼­ char setÀ» ¸ðµÎ Çѱ۷Π¼³Á¤ÇØÁÖ¾î¾ßÇÑ´Ù. ################################################################################################################ 1.mysql ¼³Ä¡ ÈÄ È¯°æº¯¼ö¿¡ mysql\bin °æ·Î¸¦ Ãß°¡ÇÏ°í mysqld-nt start¸¦ µµ½º ¸í·Éâ¿¡¼­ ½ÇÇà 2.´Ù¸¥ µµ½º ¸í·É â¿¡¼­ mysql -u root -p ·Î mysql commandâÀ¸·Î µé¾î°£´Ù. ÃÖÃÊ¿¡´Â root password°¡ ¾ø´Ù. ±×³É ¿£ÅÍ 3.show database;·Î mysql DB°¡ º¸¿©¾ß root±ÇÇÑÀ» ¹ÞÀº °ÍÀÌ´Ù. 4. user mysql;¿£ÅÍ(mysql DB»ç¿ë ¼±¾ð) 5. update user set password = password('newÆнº¿öµå') where user = 'root';¿£ÅÍ 6. winmysqladmin.exe ½ÇÇàÇϸé mysql DB managerâÀÌ ¶á´Ù. 7. ÀúÀåµÇ´Â DB ÆÄÀÏÀÇ °æ·Î´Â my.ini¿¡ ¼³Á¤µÇ´Âµ¥ c:\windows¿¡ Àְųª mysql¼³Ä¡ °æ·Î¿¡ ÀÖ´Ù. 8. create database DBÀ̸§; À¸·Î DB »ý¼º 9. »ç¿ëÀÚ »ý¼º/µî·Ï ¹× µ¥ÀÌÅÍ º£À̽º¿¡ ´ëÇÑ ±ÇÇÑ ¼³Á¤Çϱâ zbAdmin»ç¿ëÀÚ¿¡°Ô zb µ¥ÀÌÅÍ º£À̽ºÀÇ select,insert,update,delete ±ÇÇÑÀ» µî·Ï mysql> grant select,insert,update,delete on zb.* to zbAdmin@localhost identified by 'Æнº¿öµå' with grant option; mysql >flush privileges; ´ÙÀ½ ¸í·ÉÀ¸·Î È®Àνà µÎ±ºµ¥ Å×ÀÌºí¿¡ aaa»ç¿ëÀÚ¿¡ °üÇÑ Á¤º¸°¡ ¸ðµÎ µî·ÏµÊ. mysql >select * from user; mysql >select * from db; scdcAdmin¿¡°Ô ¸ðµç db¿¡ °üÇÑ ¸ðµç ±ÇÇÑÀ» ÁÖ°íÀÚ Çϸé mysql >grant all privileges on *.* to scdcAdmin@localhost identified by 'Æнº¿öµå' with grant option; mysql >flush privileges; ################################################################################################################ ######################################################## mysql ¼³Ä¡ ÈÄ binµð·ºÅ丮¿¡¼­ mysqld-nt --installÀ» ½ÇÇà net start mysql·Î mysql¼­¹ö¸¦ µ¿ÀÛ ½ÃÅ°¸ç net stop mysql·Î mysql¼­¹ö¸¦ ÁßÁö ½Ãų¼ö ÀÖ´Ù. ######################################################## ################################################################################################################ mysql µ¥ÀÌÅͺ£À̽º¿¡ ÇÑ±Û µ¥ÀÌÅÍ ÀúÀåÇϱâ À§ÇÑ ¼³Á¤ mysql Á¢¼Ó Çϼż­... show variables like 'character_set'; À§¿Í °°ÀÌ ÇϼÌÀ» °æ¿ì...¾Æ·¡¿Í °°Àº ³»¿ëÀÌ ³ª¿Í¾ß ÇÕ´Ï´Ù. +---------------+--------+ | Variable_name | Value | +---------------+--------+ | character_set | euc_kr | +---------------+--------+ Value ºÎºÐ¿¡ euc_kr ÀÌ ¾Æ´Ò°æ¿ì ÇѱÛÁö¿øÀÌ Á¦´ë·Î µÇÁö ¾Ê½À´Ï´Ù. MySQL ¼³Ä¡½Ã --with-charset=euc_kr À» ²À ³Ö¾îÁÖ¼Å¾ß Çϱ¸¿ä. ¸¸¾à OS°¡ À©µµ¿ì¶ó¸é À©µµ¿ì¼³Ä¡ Æú´õ(¿¹:C:\windows)¿¡ my.ini ÆÄÀÏÀ» ¸¸µå½Å ÈÄ ¾Æ·¡ ³»¿ëÀ» Ãß°¡Çϼ¼¿ä. [mysqld] language=C:/mysql/share/korean/ default-character-set=euc_kr [client] default-character-set=euc_kr [mysqldump] default-character-set=euc_kr ±×·± ÈÄ mysql À» Àç½ÃÀÛ Âü°í·Î mysql >show variables like 'character_sets';¸í·ÉÀ¸·Î mysql¿¡¼­ Áö¿øÇÏ´Â ¹®ÀÚ¼ÂÀ» È®ÀÎÇÒ¼ö ÀÖ´Ù. ¶ÇÇÑ php.iniÆÄÀÏ¿¡¼­ default_charset = "euc_kr"¸¦ ÇØÁÖ¾î¾ß¸¸ÀÌ php Äõ¸®·Î ÇÑ±Û µ¥ÀÌÅÍ ÀԷ½à ÇѱÛÀÌ ±úÁöÁö ¾Ê´Â´Ù. ±×¸®°í httpd.confÆÄÀÏ¿¡¼­ DefaultLanguage ko LanguagePriority ko en ca cs da de el eo es et fr he hr it ja ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW AddDefaultCharset EUC-KR·Î º¯°æ mysql Á¢¼ÓÇϽÅÈÄ show variables like 'c%' ÇϽøé ÇöÀç character set ¼³Á¤µéÀÌ ÁÖ¿í ³ª¿É´Ï´Ù.. ±×Áß¿¡ character set system À» Á¦¿ÜÇÑ ³ª¸ÓÁö´Â ¸ðµÎ euc_kr ·Î µÇ¾îÀÖ¾î¾ß ÇÕ´Ï´Ù. ij¸¯ÅͼÂÀÌ ¸ÂÁö ¾ÊÀ¸¸é ¼­¹ö¿Í Ŭ¶óÀ̾ðÆ®°¡ ¼­·Î ´Ù¸¥¸»·Î Åë½ÅÀ» ÇÏ°Ô µÇ¹Ç·Î ¸¶±¸ ±úÁø ¸ð½ÀÀ¸·Î º¸ÀÌ°Ô µË´Ï´Ù. ¶ÇÇÑ ÀÌÁ¦¾ß ij¸¯ÅͼÂÀ» ¸ÂÃç ³õ¾Ò´õ¶óµµ ¸ÂÃß±â ÀÌÀü¿¡ db ¸¦ ÀÔ·ÂÇÏ¼Ì´Ù¸é µÇµ¹¸± ¹æ¹ýÀÌ ¾ø½À´Ï´Ù.. db »ý¼º½Ã ij¸¯Åͼ ÁöÁ¤¾øÀÌ »ý¼ºÇÏ°Ô µÇ¸é column < table < database < server ÀÇ ¼øÀ¸·Î ij¸¯Åͼ ÁöÁ¤À» Ž»öÇØ ¼³Á¤ÇÕ´Ï´Ù. mysql > ALTER DATABASE db_name DEFAULT CHARACTER SET charset; ¸í·ÉÀ¸·Î ÇØ´ç DBÀÇ ±âº» ¹®ÀÚ¼ÂÀ» º¯°æÇÒ ¼ö ÀÖ´Ù.(4.1 ¹öÁ¯ ÀÌÈÄ) ################################################################################################################ mysql»ç¿ëµµÁß DBÆÄÀÏ ÀúÀå°æ·Î À̵¿½ÃÅ°´Â ¹æ¹ý 1.mysqlµ¥¸óÀ» ÁßÁö½ÃŲ´Ù(net stop mysql) mysqladmin tool ÇÁ·Î±×·¥µµ ÁßÁö ½ÃÄѾßÇÑ´Ù. 2.¿ø·¡ DBÆÄÀÏ ÀúÀå °æ·Î(c:\mysql\data)¿¡ ÀÖ´Â ¸ðµç ÆÄÀÏ ¹× Æú´õ¸¦ À̵¿½ÃÅ°°íÀÚ ÇÏ´Â Æú´õ¿¡ ¸ðµÎ º¹»çÇÑ´Ù.(D:\DB) 3.my.iniÆÄÀÏÀ» ¿­¾î¼­ datadir=C:/mysql/data -> datadir=D:/DB·Î º¯°æÇÑ ÈÄ ÀúÀåÇÑ´Ù. 4.mysqlµ¥¸óÀ» Àç½ÃÀÛÇÑ´Ù.(net start mysql) 1. Å×À̺í insert ½Ã charater set ¼³Á¤À¸·Î ÀÎÇØ ÇѱÛÀÌ ±úÁö´Â °æ¿ì. -> show variables like "c%" À¸·Î È®ÀÎ ÇÏ¿© ¼³Á¤°ªÀ» È®ÀÎÇØ º»´Ù. mysql> show variables like "c%"; +--------------------------+-------------------------------+ | Variable_name | Value | +--------------------------+-------------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | \share\charsets\ | | collation_connection | utf8_general_ci | | collation_database | utf8_general_ci | | collation_server | utf8_general_ci | | completion_type | 0 | | concurrent_insert | 1 | | connect_timeout | 5 | +--------------------------+-------------------------------+ 14 rows in set (0.00 sec) ÇöÀç´Â ¼³Á¤À» º¯°æÇÑ ÈÄÀÇ °æ¿ìÀÌÁö¸¸ Ãʱ⠼³Á¤Àº character_set_databaseÀÇ Ç׸ñÀÌ Latin1·Î ÀâÈ÷°Ô µÇ¾îÀÖ´Ù. ÀÌ °æ¿ì ÇѱÛÀÌ ±úÁö¹Ç·Î ±âº»°ªÀ» º¯°æÀ» ÇؾßÇÑ´Ù. 2. my.ini ÆÄÀÏ ¾È¿¡ [mysql] default-character-set [mysqld] default-character-set Ç׸ñÀ» º¯°æÀ» ÇØÁØ´Ù. ¶Ç´Â MySQL Instance Config manager¸¦ ÀÌ¿ëÇÏ¿© ±âº» charset ¼ÂÆÃÀ» º¯°æÇÑ´Ù. ÇÏÁö¸¸ º¯°æÈÄ¿¡µµ °è¼Ó ¿¡·¯°¡ ¹ß»ýÇÏ¿´´Ù.. ÀÌÀ¯´Â ÀÌÀüÀÇ ±âº»°ªÀ» »ç¿ëÇÏ¿© »ý¼ºÇÑ DB¿Í Å×ÀÌºí¿¡´Â ¼³Á¤°ªÀÌ ±×´ë·Î ÀÖ´Ù´Â °Í. 3. ALTER DATABASE db_name DEFAULT CHARACTER SET euckr; ALTER TABLE table_name DEFAULT CHARACTER SET euckr; show variables like "c%"; ALTER DATABASE scdc DEFAULT CHARACTER SET utf8; use scdc; ALTER TABLE driver_list DEFAULT CHARACTER SET utf8; show variables like "c%"; º¯°æÈÄ¿¡´Â ¿¡·¯¾øÀÌ Àß µÇ¾ú´Ù. charsetÀº euckrÀ̳ª utf8 µÑÁß »ç¿ëÇÏ¸é ¹®Á¦¾øÀÌ ÇØ°áµÇ¾ú´Ù. ¡Ø Âü°í DATABASE¿Í TABLE »ý¼º½Ã CHARACTER SET ºÎºÐÀ» ¾È ½áÁÖ°Ô µÇ¸é ±âº»°ªÀ» °¡Á®°¡°Ô µÇ´Âµ¥, DATABASE´Â my.iniÀÇ ¼³Á¤°ªÀ» ±âº»°ªÀ¸·Î °®°í, TABLEÀº DATABASEÀÇ ¼³Á¤°ªÀ» ±âº»°ªÀ¸·Î °®°Ô µÈ´Ù.