é·ãOSã»ããã¢ããããµã€ãããã¹ãããããã®ãœãããŠã§ã¢ã®ã€ã³ã¹ããŒã«ãå¿ èŠãšããã«ãã¯ã©ãŠãã®ãã¹ãŠã®æ©èœã䜿çšã§ããŸãã ã¯ã©ã·ãã¯VPSã䜿çšããå Žåã ãã®ãµãŒãã¹ã§ãã³ãã¬ãŒããå©çšã§ããããã«ããŸãã ã
Ubuntu 14.04ã©ã³ããã³ãã¬ãŒãå ã«ã¯ã次ã®ãœãããŠã§ã¢ãããªã€ã³ã¹ããŒã«ããã³æ§æãããŠããŸãã
- NGINX 1.4ïŒãªããŒã¹ãããã·ãšããŠïŒ
- Apache 2.4
- PHP 5.5
- MySQL 5.5
- ProFTPD 1.3
- PHPMyAdmin 4.0
è¿œå èšå®ãªãã§ãããã«ãµã€ããå±éããFTPãšPHPMyAdminã䜿çšã§ããŸãã
ãã®èšäºã§ã¯ããã®ãã³ãã¬ãŒãã詳ããèŠãŠããµã€ããInfobox ã¯ã©ãŠãVPSã«ç°¡åã«ç§»è¡ã§ããããšã瀺ããŸãã
ã¯ã©ãŠãVPSãäœæãã
ã¯ã©ãŠãVPSããŸã ãªãå Žåã¯ã eeã泚æããŠãã ãã ã 泚æåŸãã³ã³ãããŒã«ããã«ã«ç§»åã㊠ã¯ã©ãŠããµãŒããŒãäœæããŸã ã
å¿ èŠãªãµãŒããŒãã©ã¡ãŒã¿ãèšå®ããŸãã [OSã«ãŒãã«ç®¡çãèš±å¯ãã]ãã§ãã¯ããã¯ã¹ããªã³ã«ããªãã§ãã ããã ãµãŒããŒãã€ã³ã¿ãŒãããããã¢ã¯ã»ã¹ã§ããããã«ããµãŒããŒã«1ã€ã®ãããªãã¯IPã¢ãã¬ã¹ãå²ãåœãŠãŸãã å¿ èŠãªãããã¯ãŒã¯é床ãèšå®ããã次ãžããã¯ãªãã¯ããããšãå¿ããªãã§ãã ããã
以äžã®ã¹ã¯ãªãŒã³ã·ã§ããã«ç€ºãããã«ããUbuntu 14.04ã©ã³ãããã³ãã¬ãŒããéžæãããµãŒããŒã®äœæãå®äºããŸãã äœæåŸããµãŒããŒã«ã¢ã¯ã»ã¹ããããã®ããŒã¿ãé»åã¡ãŒã«ã§åãåããŸãã
SSHçµç±ã§ãµãŒããŒã«æ¥ç¶ããŸãã
ãã¹ãŠæºåå®äºã§ãã
ãµãŒããŒã«æ¥ç¶ãããšãMySQLããã³FTPããŒã¿ããŒã¹ã«ã¢ã¯ã»ã¹ããããã®ããŒã¿ã衚瀺ãããŸãã ããããä¿åããŸãã
ãŸããçŸåšèŠã€ãã£ãŠãããã¹ãŠã®åé¡ã解決ãããµãŒããŒã®ä¿¡é Œæ§ãé«ããã®ã«åœ¹ç«ã€OSã¢ããããŒããã€ã³ã¹ããŒã«ããŸãã ãããè¡ãã«ã¯ã次ã®ã³ãã³ããå ¥åããŸãã
apt-key update && apt-get update && apt-get -y upgrade
FTPãä»ããŠã¯ã©ãŠããµãŒããŒã«ãã¡ã€ã«ãã¢ããããŒããã
FTPçµç±ã§ãµãŒããŒã«æ¥ç¶ãããµã€ããã¡ã€ã«ããµãŒããŒã«é 眮ããŸãããã Filezillaã¯ã©ã€ã¢ã³ãã䜿çšããŠæ¥ç¶ã§ããŸãã ããŠã³ããŒãããŠã€ã³ã¹ããŒã«ããŸãã
èµ·ååŸããµãŒããŒã®å€éšIPã¢ãã¬ã¹ïŒSSHçµç±ã§æ¥ç¶ãããšãã«äœ¿çšãããã®ãšåãïŒããã°ã€ã³ãããã³ãã¹ã¯ãŒããå ¥åããŸãã æ¥ç¶ããã«ã¯ãQuickConnectãã¯ãªãã¯ããŸãã
æ¥ç¶ãæ£åžžã«ç¢ºç«ãããŸãã ãµã€ããã¡ã€ã«ããµãŒããŒã«è»¢éããŸãã
ããšãã°ã MogutaCMS-ç¡æã®ããŒãžã§ã³ããããªã³ã©ã€ã³ã¹ãã¢ç®¡çã·ã¹ãã ãã€ã³ã¹ããŒã«ããŸãã ãããããŠã³ããŒãã ãã¢ãŒã«ã€ãã解åããFilezillaãä»ããŠãµãŒããŒã«ãµã€ããã¡ã€ã«ãé 眮ããŸãã
Filezillaã䜿çšããããã«ãå°æ¥ãµãŒããŒã«ã¢ã¯ã»ã¹ããããã«ããŒã¿ãä¿åã§ããŸãã ãããè¡ãã«ã¯ã以äžã®ã¹ã¯ãªãŒã³ã·ã§ããã«ç€ºãããã«ãFilezillaã§Site ManagerãéããŸãã
[æ°ãããµã€ã]ãã¯ãªãã¯ããŠããµã€ãã®ååãå ¥åããŸãã
ip-addressãå ¥åãããã°ã€ã³ã¿ã€ããéåžžããéžæããŸãã 次ã«ããµã€ãã®ãã°ã€ã³ãšãã¹ã¯ãŒããå ¥åããŠã[æ¥ç¶]ãã¯ãªãã¯ããŸãã
ãã®å Žåãæ¯åãµãŒããŒã«FTPã¢ã¯ã»ã¹ããããã®ããŒã¿ãå ¥åããå¿ èŠã¯ãããŸããã
ããã©ã«ãã§index.phpã®å®è¡ãèš±å¯ãã
ããã©ã«ãã§ã¯ããµãŒããŒã¯index.htmlãéãããã«èšå®ãããŠããŸããéããŠããªãå Žåã¯ãindex.phpãéããŸãã ç§ãã¡ã®ãµã€ãã¯phpã§éçºãããŠããŸãã æãç°¡åãªãªãã·ã§ã³ã¯ãFilezillaãä»ããŠãµãŒããŒäžã®index.htmlãåé€ããã ãã§ããµã€ããéããŸãã ãã ããCMSã«index.phpã«å ããŠindex.htmlãããå Žåãindex.phpããindex.htmlãžã®åŠçãæå¹ã«ããå¿ èŠããããŸãã
ããã¯éåžžã«ç°¡åã§ãã SSHæ¥ç¶ãŠã£ã³ããŠã§ãã³ãã³ããå®è¡ããŠnanoãšãã£ã¿ãŒãã€ã³ã¹ããŒã«ããŸãã
apt-get -y install nano
次ã«ãã³ãã³ããå®è¡ããŠæ§æãã¡ã€ã«ãç·šéããŸãã
nano /etc/apache2/sites-enabled/000-default.conf
è¡ãè¿œå ããŸãã
DirectoryIndex index.php index.html
以äžã®ã¹ã¯ãªãŒã³ã·ã§ããã«ç€ºãããã«ïŒ
å€æŽãä¿åããã«ã¯ããCtrl + XãããYããEnterã®é ã«æŒããŸãã
次ã®ã³ãã³ãã§Apacheãåèµ·åããŸãã
service apache2 restart
ãã©ãŠã¶ã§ãããªãã¯IP âãµãŒããŒã®ã¢ãã¬ã¹ãéããŸãã MogutaCMSã®ã€ã³ã¹ããŒã«ãŠã£ã³ããŠã衚瀺ãããŸãã
MogutaCMSãã€ã³ã¹ããŒã«ãã
CMSããšã«ãã³ã³ããŒãã³ãã®ãã¹ãããã£ãã·ã¥ãªã©ã®èŠä»¶ãç°ãªãå ŽåããããŸãã ããã§ããä»®æ³ãµãŒããŒã§ã¯ãåŸæ¥ã®ãã¹ãã£ã³ã°ãšã¯ç°ãªããå¿ èŠãªãã®ããã¹ãŠåã€ã³ã¹ããŒã«ã§ããŸãã
ã€ã³ã¹ããŒã«æã«MogutaCMSã䜿çšããã«ã¯ãlibcurlã©ã€ãã©ãªãå¿ èŠã§ãã ã€ã³ã¹ããŒã«ããŸãããïŒ
apt-get install -y php5-curl
service apache2 restart
ãã®åŸãMogutaCMSã®ã€ã³ã¹ããŒã«ã¯æ£åžžã«å®äºããŸãã
ãã段éã§ã¯ãããŒã¿ããŒã¹ã«ã¢ã¯ã»ã¹ããããã«ããŒã¿ãå ¥åããå¿ èŠããããŸãã ãµãŒããŒãšããŠãlocalhostããæå®ãããã°ã€ã³ããã³ãã¹ã¯ãŒããšããŠãSSHçµç±ã§æ¥ç¶ãããšãã«çºè¡ãããïŒä»¥åã«ä¿åããããã«èŠæ±ããïŒãŠã§ã«ã«ã ã¡ãã»ãŒãžã®ããŒã¿ãæå®ããŸãã
äžéšã®CMSã¯ãããŒã¿ããŒã¹ããŸã äœæããŠããªãå Žåã«äœæã§ããŸãã MogutaCMSã¯ãã®æ¹æ³ãç¥ãããããªãã¯åœŒå¥³ãå°ãå©ããå¿ èŠããããŸãã 以äžã§PHPMyAdminãéããŸãã
_ip_/phpmyadmin
ïŒSSHãŠã§ã«ã«ã ã¡ãã»ãŒãžããïŒããŒã¿ããŒã¹ã®ãã¹ã¯ãŒããå ¥åãã[OK]ãã¯ãªãã¯ããŸãã
ãããŒã¿ããŒã¹ãã»ã¯ã·ã§ã³ã«ç§»åããããŒã¿ããŒã¹ã®ååãè±èªã§å ¥åãããšã³ã³ãŒããéžæãïŒCMSéçºè ããã®æ瀺ããªãéããutf8_general_ciïŒã[äœæ]ãã¯ãªãã¯ããŸãã
ããã§ãäœæããããŒã¿ããŒã¹ãæå®ãããšãMogutaCMSã®ã€ã³ã¹ããŒã«ãæ£åžžã«ç¶è¡ãããŸãã
ãµã€ãã®ååãã¡ãŒã«ã¢ãã¬ã¹ããã¹ã¯ãŒããå ¥åããŠãã ããã ã€ã³ã¹ããŒã«ãã¯ãªãã¯ããŸãã
[ãµã€ãã«ç§»å]ãã¯ãªãã¯ããŸãã
ãµã€ããæ£åžžã«ã€ã³ã¹ããŒã«ãããŸããã
ãããã質å
ãã®ã»ã¯ã·ã§ã³ã§ã¯ã ã¯ã©ãŠãVPS㧠Ubuntu 14.04ã©ã³ããã³ãã¬ãŒãã䜿çšããéã®è³ªåã«ãçãããŸãã ã€ã³ã¹ããŒã«ããã»ã¹äžã«è³ªåãããå Žåã¯ã åœç€ŸãŸã§ãé£çµ¡ãã ãã ããã®ã»ã¯ã·ã§ã³ã«åçãè¿œå ããŸãã ã¯ã©ãŠããµãŒããŒã«CMSãç°¡åã«ã€ã³ã¹ããŒã«ã§ããŸãããã®èšäºã§ã¯ãç解ã§ããªãç¬éããã¹ãŠèª¬æããããšããŸãã
æ¢åã®ãµã€ãã®ããŒã¿ããŒã¹ã転éããæ¹æ³ã¯ïŒ
æ¢åã®ãã¹ãã£ã³ã°ãŸãã¯ãµãŒããŒããããŒã¿ããŒã¹ããšã¯ã¹ããŒãããŸãã ãµã€ããçŸåšããPHPMyAdminã«ã¢ã¯ã»ã¹ã§ããå Žåããšã¯ã¹ããŒãã¯æ¬¡ã®ããã«å®è¡ã§ããŸãã
1.å€ããã¹ãã£ã³ã°ãŸãã¯ãµãŒããŒã§PHPMyAdminã«ãã°ã€ã³ããŸãã
2.ããŒã¿ããŒã¹ãéžæããŸãã ããšã¯ã¹ããŒããã»ã¯ã·ã§ã³ã«ç§»åãããå®è¡ããã¯ãªãã¯ããŸãã
ãã©ãŠã¶ã¯ããŒã¿ããŒã¹ãã³ããããŠã³ããŒãããŸãã
次ã«ãInfoboxã®ã¯ã©ãŠããµãŒããŒã§PHPMyAdminã«ãã°ã€ã³ããŸãã [ããŒã¿ããŒã¹]ã»ã¯ã·ã§ã³ã«ç§»åããŠã空ã®ããŒã¿ããŒã¹ãäœæããŸãã
äœæåŸããããéžæãããã€ã³ããŒããã»ã¯ã·ã§ã³ã«é²ã¿ãŸãã [ãã¡ã€ã«ãéžæ]ãã¯ãªãã¯ããŠãã³ã³ãã¥ãŒã¿ãŒããããŒã¿ããŒã¹ãã³ããéžæããŸãã ãšã¯ã¹ããŒããšã³ã³ãŒãã£ã³ã°ã«å¯Ÿå¿ãããšã³ã³ãŒãã£ã³ã°ãæå®ãããŠããããšã確èªããŠãã ããã [Go]ãã¯ãªãã¯ããŠã€ã³ããŒããå®äºããŸãã
ããŒã¿ããŒã¹ã¯æ£åžžã«ã€ã³ããŒããããŸãã
ããŒã¿ããŒã¹ã®ãµã€ãºã倧ããããŠãããŒã¿ããŒã¹ãphpmyadminã«ããŒããããªãå Žåã¯ã©ããªããŸããïŒ
20MBãè¶ ã200MBæªæºã®ããŒã¿ããŒã¹ãããŒãããããã®NGINXãªããŒã¹ãããã·èšå®
.sqlããŒã¿ããŒã¹ãã³ããzipãgzipããŸãã¯bzip2ã¢ãŒã«ã€ãã«ããã±ãŒãžåãããŠããããšã確èªããŠãã ããã ããã«ãããããŒããããããŒã¿ããŒã¹ã®ãµã€ãºãå€§å¹ ã«åæžã§ããŸãã
ããã¯ãããããŒã¿ããŒã¹ããŸã 20ã¡ã¬ãã€ããè¶ ããå Žåã¯ã以äžã«ç€ºãããã«ãnginxã§ã¢ããããŒãã®æ倧蚱容ãã¡ã€ã«ãµã€ãºãå¢ãããŸãã
ãããè¡ãã«ã¯ã / etc / nginx / nginx.confãã¡ã€ã«ãç·šéããŠãhttp {}ãããã¯å ã«ãã©ã¡ãŒã¿ãŒãè¿œå ããŸã ïŒäŸïŒïŒserver_tokens off;ïŒã
client_max_body_size 200m;
ãã®å Žåãnginxã¯200ã¡ã¬ãã€ãæªæºã®ãã¡ã€ã«ã®ããŠã³ããŒããèš±å¯ããŸãã
nanoãšãã£ã¿ãŒã䜿çšããŠãã¡ã€ã«ãç·šéã§ããŸãã ãŸã ã€ã³ã¹ããŒã«ãããŠããªãå Žåã¯ã次ã®ã³ãã³ãã§ã€ã³ã¹ããŒã«ããŸãã
apt-key update && apt-get update && apt-get install -y nano
次ã®ã³ãã³ãã䜿çšããŠãã¡ã€ã«ãç·šéããŸãã
nano /etc/nginx/nginx.conf
空ã®å€client_max_body_sizeãè¿œå ããŸãã
ä¿åããã«ã¯ãctrl + xãYãEnterãæŒããŸãã
å€æŽãé©çšããã«ã¯ã次ã®ã³ãã³ãã§nginxãåèµ·åããŸãïŒ
service nginx restart
mysqlã§éãããŒã¿ããŒã¹ãããŒããã
mysqlããŒã¿ããŒã¹ãã¢ãŒã«ã€ãã§200ã¡ã¬ãã€ã以äžãããå ŽåããŸãã¯ããŒãåŸã«mysqlã§ããŒã¿ããŒã¹ãã³ããå埩ããããã»ã¹ã«1å以äžãããå Žåãphpmyadminã䜿çšããŠãã³ããã€ã³ããŒãããããšã¯ãå§ãã§ããŸããã ãã¹ã¯ãªããã®ã¿ã€ã ã¢ãŠããçµéããŸãããã€ã³ããŒããçµäºããå Žåã¯ãåããã¡ã€ã«ãåéä¿¡ããŠã€ã³ããŒããåéããŠãã ããããšãã圢åŒã®ãšã©ãŒãåãåãå ŽåããããŸãã é·ãæäœããµããŒãããnginxãapacheãããã³phpã®èªã¿èŸŒã¿å¶éãå¢ããããã«phpmyadminããã³nginxã®ã¿ã€ã ã¢ãŠããæ§æã§ããŸããããã€ãã£ãmysqlããŒã«ã䜿çšããŠãã®ãããªããŒã¿ããŒã¹ãèªã¿èŸŒãããšããå§ãããŸãã
1.ããŒã¿ããŒã¹ãã³ãããªã¢ãŒããµãŒããŒïŒããšãã°ã/ã«ãŒããã£ã¬ã¯ããªïŒã«ã³ããŒããŸãã ããã¯ãFilezillaã䜿çšããŠå®è¡ã§ããŸãã
æ°ããSFTPæ¥ç¶ãäœæããŸãã ãµãŒããŒã«SSHã¢ã¯ã»ã¹ããããã®IPã¢ãã¬ã¹ããŠãŒã¶ãŒåããã¹ã¯ãŒããå ¥åãããæ¥ç¶ããã¯ãªãã¯ããŸãã
ãã®ãµãŒããŒãä¿¡é Œããããšã«åæããŠããã¯ã¹ããªã³ã«ãã[OK]ãã¯ãªãã¯ããŸãã
æ¥ç¶ã確ç«ãããŸãã
filezillaã®å·Šãã€ã³ã§ã³ã³ãã¥ãŒã¿ãŒã®ããŒã¹ãã³ããéžæããå³ã«ç§»åããŸãã ãã¡ã€ã«ã¯ããµãŒããŒã®/ã«ãŒããã£ã¬ã¯ããªã«ã³ããŒãããŸãã
2. sshãä»ããŠãµãŒããŒã«æ¥ç¶ããŸãã
æ°ããããŒã¿ããŒã¹ãäœæããŸãã 以äžã®äŸã§ã¯ã my_dbã¯äœæããããŒã¿ããŒã¹ã®ååã§ãã
mysql -u root -p -e 'CREATE DATABASE `my_db`;'
SSHã°ãªãŒãã£ã³ã°ã¡ãã»ãŒãžã§æå®ãããããŒã¿ããŒã¹ã®ãã¹ã¯ãŒããå ¥åããå¿ èŠããããŸãã
ããŒã¿ããŒã¹ãäœæãããšãã«ããšã³ã³ãŒããæå®ã§ããŸãã
mysql -u root -p -e 'CREATE DATABASE `my_db` CHARACTER SET utf8 COLLATE utf8_general_ci;'
次ã«ãããŒã¹ãã³ããã€ã³ããŒãããŸãã
mysql -u root -p my_db < database.sql
ããã§ãdatabase.sqlã¯åŸ©å ããããŒã¿ããŒã¹ãã³ãã®ååã§ãã
ããŒã¿ããŒã¹ã¯æ£åžžã«åŸ©å ãããŸãã
ãããã«
Infoboxã¯ã©ãŠãVPS㧠Ubuntu 14.04ã©ã³ããã³ãã¬ãŒãã䜿çšãããšããµã€ããã¯ã©ãŠãã«ãã°ããå±éãããµã€ããå®å šã«å¶åŸ¡ããããã«ãµãŒããŒã管çããæ¹æ³ã段éçã«åŠç¿ã§ããŸãã ãã®ã€ã¡ãŒãžã«äœããã€ã³ã¹ããŒã«ãŸãã¯æ§æããæ¹æ³ãæ確ã§ãªãå Žåã¯ããã€ã§ããæ°è»œã«ãåãåãããã ããã
é 匵ã£ãŠïŒ