$30 off During Our Annual Pro Sale. View Details »

Azure talk for NUS

Azure talk for NUS

laurenceputra

August 30, 2012
Tweet

More Decks by laurenceputra

Other Decks in Technology

Transcript

  1. WINDOWS AZURE
    HACKING OUT WEBAPPS
    HOW TO GET STARTED, AND WHAT YOU NEED TO GET GOING
    by
    &
    Laurence Putra
    Divyanshu Arora

    View Slide

  2. WHAT THIS TALK IS NOT
    A step by step guide to click buttons on the Azure portal.
    A guide to using x, y, or z web development framework.

    View Slide

  3. BUT RATHER A BUNCH OF STUFF
    you would need to do to get started with your own linux servers to
    host your webapp

    View Slide

  4. LINUX?!?!?!
    Yep, you read it right.
    We'll be using CentOS for this demo.

    View Slide

  5. QUICK POLL
    1. How many of you here have laptops?
    2. Who here knows how to use linux?
    3. Who here has their own website?
    4. Who maintains their own server and hosts sites for themselves
    and/or other people?

    View Slide

  6. FOR THOSE WHO HAVE LAPTOPS
    Go to
    Free 3 month trial on a small instance
    1. 1 dedicated core
    2. 1.75 GB RAM
    3. Free phone support
    4. In Singapore: 1800 622 1283
    Go on, sign up, and spin up a server
    bit.ly/azureSG

    View Slide

  7. WHY A VM ON A CLOUD SERVICE?
    WHY NOT A DEDICATED SERVER? OR A PAAS SERVICE LIKE HEROKU?
    tl;dr-it's a balancing act between advantages of abstraction layers
    Extremely easy setup, trivial scaling, etc.
    Configurability, determinism in performance, etc.
    Services like Azure, EC2, etc., imo, a sweet spot

    View Slide

  8. WHY AZURE
    Because they have some really good features
    Bunch of *easily usable* stuff like
    georeplication
    high availability
    free phone support

    View Slide

  9. INTRODUCING LAMP
    1. Linux
    2. Apache
    3. MySQL
    4. Php
    A stack, that's moderately easy to set up, for you to start working on
    something right away

    View Slide

  10. LINUX
    INITIAL SETUP
    After you ssh into your server
    Copy your public key into the authorized_keys file
    Allows you to login to your server with better security than a simple
    password
    But recommended that you password protect your private key
    mkdir ~/.ssh
    vim ~/.ssh/authorized_keys
    chmod go-w ~/.ssh
    chmod 600 ~/.ssh/authorized_keys

    View Slide

  11. COMMANDS YOU'LL USE VERY OFTEN
    ls ./
    cd ../
    pushd, popd
    rm -rf /
    mkdir
    touch
    vim
    grep blah
    man

    View Slide

  12. OTHER UNIX-Y STUFF YOU SHOULD KNOW
    |
    ls | grep NUS
    >
    ls > filelist
    >>
    ls >> filelist

    View Slide

  13. INSTALLING SOFTWARE
    CentOS/Fedora uses the yum package manager
    Debian/Ubuntu uses apt-get package manager
    Same purpose, just different tools on different systems
    yum install app-name
    yum remove app-name
    yum -C search app-name
    yum update

    View Slide

  14. APPS REQUIRED TO RUN YOUR WEBSITE
    sudo yum install httpd php mysql mysql-server php-mysql

    View Slide

  15. APACHE (HTTPD)
    Server software
    In charge of responding to the browsers
    Default root:
    Manage multiple sites on a single machine using virtualhosts
    chkconfig httpd on
    service httpd start

    View Slide

  16. VIRTUALHOSTS
    your-domain.conf
    Put in in a directory and include that directory in

    ServerAdmin [email protected]
    DocumentRoot /users/you/your-domain.com
    ServerName your-domain.com
    ServerAlias www.your-domain.com

    View Slide

  17. MYSQL
    WHAT IS IT?
    A database
    Used to store data
    Other databases out there include PostgreSQL, mongoDB

    View Slide

  18. WHY USE A DATABASE?
    WHY NOT JUST STORE IN A FILE?
    Database supports indexing
    Allows you to search for records
    Think of the database as a giant excel spreadsheet
    that allows you to retrieve information really quickly

    View Slide

  19. PHP
    A scripting language that allows you to generate websites
    Can do a whole bunch of other stuff, including processing your data,
    and basically works like any other programming language

    View Slide

  20. COUPLE OF STUFF YOU NEED TO KNOW
    $blahblah is a variable
    scripts start with scripts end with ?>

    View Slide

  21. CODE SAMPLES
    foreach
    if/else
    foreach ($variable as $value) {
    $total = $total + $value;
    $count++;
    }
    if ($condition) {
    //do something
    } else {
    //do something else
    }

    View Slide

  22. HELLOWORLD.PHP
    displays

    View Slide

  23. MORE COMPLICATED STUFF
    Stuff like websites you see around
    You have to learn HTML too.
    And to create stuff like this presentation
    You'll need Javascript as well

    View Slide

  24. DEMO

    View Slide

  25. COUPLE OF OTHER STUFF
    Denyhosts
    newrelic
    Mixpanel

    View Slide

  26. Q&A

    View Slide

  27. THE END
    Sign up at bit.ly/azureSG

    View Slide