Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Thinkup + AWS Hands-On

brennan
March 22, 2012

Thinkup + AWS Hands-On

@ Hackerspace Singapore, 22 March 2012

brennan

March 22, 2012
Tweet

More Decks by brennan

Other Decks in Technology

Transcript

  1. 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!
  2. STEPS 1. Login to AWS Management Console. 2. Start a

    Debian (x86) micro instance. 3. Access your instance via SSH.
  3. 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 -
  4. 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
  5. 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
  6. 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; } }
  7. 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.
  8. EXTRAS • TRON CRON! • Gimme’ some alarms! • Setup

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