AWS summit tokyo_2015_WordPress_on_AWS

123
HANDS-ON AWS Summit Tokyo 2015 - Developers Conference

Transcript of AWS summit tokyo_2015_WordPress_on_AWS

1. HANDS-ON AWS SummitTokyo 2015 - Developers Conference 2. CEO + HBT DigitalCube Co. Ltd. AWS SAMURAI 2013 3. Amazon Web Services Advanced Consulting Partner 4. Were in love with Community. 5. Sapporo Aomori Akita Yamagata Sendai Nagaoka Fukui Tokyo Wakayama Kobe Osaka Kochi Tokushima Kagawa Ehime Fukuoka Kumamoto Oita Kagoshima Okinawa Bangkok HiroshimaSingaporePhilippines San Francisco Hands-ON-Training 26 8Co-Organizer JAWS-UG 2013,2014 JAWS-UG JAWS FESTA 2013,2014 JAWS DAYS 2013,2014,2015 JAWS-UG 6. AMIMOTO User Group 7. ? 8. 9. What is HHVM? 10. HHVM is an open-source virtual machine designed for executing programs written in Hack and PHP. HHVM uses a just-in-time (JIT) compilation approach to achieve superior performance while maintaining the development exibility that PHP provides. HHVMPHP HHVMPHP JIT 11. ? 12. 13. ? 14. eCommerce Media 15. Enterprise Multilingual 16. heptagon inc. 17. ? 18. HHVM vs php-fpm Cache: OFF : Loader.io : c3.large Duration: 1 Type: 0- 300(Maintain client load) http://ja.amimoto-ami.com/2015/05/07/amimoto-hhvm/ 19. HHVM vs php-fpm (TOP) hhvm 20. HHVM vs php-fpm (TOP) 21. HHVM vs php-fpm (admin) php-fpm150-200 50x HHVM 22. PHP7 vs HHVM http://talks.php.net/uent15#/wpbench 23. ? 24. ! 25. .. 26. Cache / Memory PHP 5.6 Plugin 27. 28. PHP 29. $ sudo git -C /opt/local/chef-repo/cookbooks/amimoto/ pull origin master $ sudo vi /opt/local/amimoto.json # { "hhvm" : { "enabled": true }, "run_list" : [ "recipe[amimoto]" ] } # hhvm php-fpm { "phpfpm" : { "enabled": true }, "run_list" : [ "recipe[amimoto]" ] } $ sudo /opt/local/provision Command 30. Great performance! 31. FreeTrial 32. Price https://aws.amazon.com/marketplace/pp/B00V5JYXTO $0.025*720/h=$18/mon $0.02*8640/h+$40=$215.2/yr RI(1/yr)$126+8640/h+$40=$166/yr 33. ! 34. ! 35. 36. HANDS-ON 37. Login to AWS 38. EC2: Elastic Cloud Compute Provides the exibility you need Scales up on high trafc Scales down on low trafc 39. Amimoto EC2 Instance 40. Associate IP Address 41. Paste to your browser. 42. You can now enjoy posting! 43. Scale Up of Instances The Elastic nature allows you to instantly scale up to meet spikes in trafc or demand. 44. Before you scale up your instance, you must rst STOP the current one. Currently, you have t2.micro instance. 45. Change the Instance Type: 46. Scale up from t2.micro to t2.small 47. Scale Down of Instances 48. Before you scale down your instance, you must rst STOP the current one. Currently, you have t2.small instance. 49. Scale down from t2.small to t2.micro 50. SFTP 51. to access & manage les on remote le systems to transfer les between hosts SFTP clients are programs using SSH (Secure File Transfer Protocol) encrypts commands & data (unlike FTP) preventing passwords & sensitive info transmission functionally similar to SSH, but uses different protocols you cannot use standard FTP to connect to SFTP servers you cannot use clients that only support SFTP to connect to FTP servers 52. FTP (FileTransfer Protocol) SFTP (SSH Secure FileTransfer) Cyberduck Transfer anything Distribute your contents in the cloud Open Source Multilingual https://cyberduck.io/ 53. $ chmod 600 /Users/XXXXXXXX/Downloads/XXXXXXXXXX.pem $ ssh -i /Users/XXXXXXXX/Downloads/XXXXXXXXXX.pem [email protected] Log in with SSH 54. $ sudo /usr/sbin/usermod -s /bin/bash nginx $ sudo passwd nginx Changing password for user nginx. New password: Retype new password: passwd: all authentication tokens updated successfully. $ sudo /sbin/service monit stop $ sudo /sbin/service nginx stop $ sudo /sbin/service php-fpm stop $ sudo /usr/sbin/usermod -d /var/www/vhosts nginx $ sudo /sbin/service php-fpm start $ sudo /sbin/service nginx start $ sudo /sbin/service monit start $ sudo mkdir /var/www/vhosts/.ssh $ sudo cp /home/ec2-user/.ssh/authorized_keys /var/www/vhosts/.ssh/ $ sudo chown -R nginx:nginx /var/www/vhosts/.ssh/ Set NGINX SFTP Login User 55. amimoto-ami.com (BLOG or FAQ) How to SSH as an Nginx User: http://amimoto-ami.com/2015/05/26/how-to-run-nginx-php-fpm-as-ec2-user/ How to connect Amimoto Instance to (S)FTP Client Software: http://amimoto-ami.com/faq/connect-amimoto-instance-sftp-client-software/ For more details: 56. Terminating the Instance You stop getting billed Instance shutdown 57. And thats it, youve terminated the instance! 58. Release EIP Address *After releasing an Elastic IP address: you cannot get it back stopped getting charged 59. Create an AMIMOTO instance Associate EIP Address Launch AMIMOTO RECAP Build a powerful website Scale up Scale down Terminate an Instance Release EIP Address 60. WordPress on AWS WordPress Sites Powered by What makes clients happy RECAP High Performance sites Business impact and Global impact of Powerful sites 61. @Amimoto_Ami http://amimoto-ami.com/ Thank you!