Thinkup + AWS Hands-On

91cc81246b16f87c69524bfe157f40c9?s=47 brennan
March 22, 2012

Thinkup + AWS Hands-On

@ Hackerspace Singapore, 22 March 2012

91cc81246b16f87c69524bfe157f40c9?s=128

brennan

March 22, 2012
Tweet

Transcript

  1. ThinkUp Hands-On Brennan Neoh @bren http://brennan.sg

  2. AGENDA • Easy: – Set-up a ThinkUp instance from a

    ready-baked public AMI (Amazon Machine Image). • Hard: – Set-up an EC2 micro instance from scratch. – Leverage on CloudWatch to do custom metrics + alarms. – Rock it like it’s 1999!
  3. FRESHLY-BAKED! (or, let me do it for you)

  4. START FROM SCRATCH!!! (or, the long-winded method) WARNING Terminal Interaction

    Ahead https://gist.github.com/2157420
  5. STEPS 1. Login to AWS Management Console. 2. Start a

    Debian (x86) micro instance. 3. Access your instance via SSH.
  6. STEPS (dotdeb) 3. Edit sources: nano /etc/apt/sources.list 4. Copy: deb

    http://packages.dotdeb.org squeeze all deb-src http://packages.dotdeb.org squeeze all 5. Exit, then: wget http://www.dotdeb.org/dotdeb.gpg cat dotdeb.gpg | sudo apt-key add -
  7. STEPS (getting them packages, sources) 7. Update apt sources: apt-get

    update 8. Install packages: apt-get install nginx mysql-server php5-fpm php5-mysql php5-gd php5-curl git 9. Get ThinkUp straight from the source: git clone https://github.com/ginatrapani/ThinkUp.git /usr/share/thinkup
  8. STEPS (database setup) 10. Login to MySQL: mysql –u root

    –p 11. Create the Database: CREATE DATABASE thinkup; 12. Grant connection privilege: GRANT USAGE ON *.* TO thinkup@localhost IDENTIFIED BY ‘thinkuppassword’; 13. Grant database privilege: GRANT ALL PRIVILEGES ON thinkup.* to thinkup@localhost ; 14. Give it a spin: mysql –u thinkup –p‘thinkuppassword’ thinkup
  9. STEPS (nginx) 15. Create a new site config: touch /etc/nginx/sites-enabled/thinkup

    nano /etc/nginx/sites-enabled/thinkup 16. Add some configurations: server { listen 80; root /usr/share/thinkup; index index.php; server_name your-hostname; location ~ ^/(.+\.php)$ { try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } location ~ /\.ht { deny all; } }
  10. STEPS (fin) 17. Test the config! nginx –s test 18.

    Start the servers! service nginx start service php5-fpm start 19. Configure thinkup! http://your-host/install 20. Heart yourself.
  11. EXTRAS • TRON CRON! • Gimme’ some alarms! • Setup

    a memory utilization custom metric! • LET’S PHP-APC THIS S**T YO! • IAM your AWS account!
  12. Q&A