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

Azure NUS ACM talk 1 - Meeting your VM

laurenceputra
September 22, 2012

Azure NUS ACM talk 1 - Meeting your VM

By Ruiwen and myself.

laurenceputra

September 22, 2012
Tweet

More Decks by laurenceputra

Other Decks in Technology

Transcript

  1. WINDOWS AZURE
    MEET YOUR VM
    HOW TO GET STARTED, AND WHAT YOU NEED TO GET GOING
    by
    &
    Laurence Putra
    Ruiwen Chua

    View full-size 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 full-size 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 full-size slide

  4. PREFLIGHT
    Laptops?
    Linux?
    Azure?

    View full-size slide

  5. AZURE
    Go to
    Free 3 month trial on a small instance
    1 dedicated core
    1.75 GB RAM
    Free phone support
    In Singapore: 1800 622 1283
    Go on, sign up, and spin up a server
    Let's use Ubuntu 12.04
    bit.ly/azureSG

    View full-size slide

  6. THE CLOUD
    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., a sweet spot

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  9. LINUX
    INITIAL SETUP
    After you ssh into your server
    Copy your public key into the a
    u
    t
    h
    o
    r
    i
    z
    e
    d
    _
    k
    e
    y
    s
    file
    Allows you to login to your server with better security than a simple
    password
    But recommended that you password protect your private key
    m
    k
    d
    i
    r ~
    /
    .
    s
    s
    h
    v
    i
    m ~
    /
    .
    s
    s
    h
    /
    a
    u
    t
    h
    o
    r
    i
    z
    e
    d
    _
    k
    e
    y
    s
    c
    h
    m
    o
    d g
    o
    -
    w ~
    /
    .
    s
    s
    h
    c
    h
    m
    o
    d 6
    0
    0 ~
    /
    .
    s
    s
    h
    /
    a
    u
    t
    h
    o
    r
    i
    z
    e
    d
    _
    k
    e
    y
    s

    View full-size slide

  10. COMMANDS YOU'LL USE VERY OFTEN
    l
    s .
    /
    c
    d .
    .
    /
    p
    u
    s
    h
    d
    , p
    o
    p
    d
    m
    k
    d
    i
    r
    t
    o
    u
    c
    h
    n
    a
    n
    o

    View full-size slide

  11. COMMANDS YOU'LL USE VERY OFTEN
    g
    r
    e
    p b
    l
    a
    h
    m
    a
    n
    f
    i
    l
    e
    r
    m
    c
    a
    t
    l
    n

    View full-size slide

  12. OTHER UNIX-Y STUFF YOU SHOULD KNOW
    |
    >
    >
    >
    l
    s | g
    r
    e
    p N
    U
    S
    l
    s > f
    i
    l
    e
    l
    i
    s
    t
    l
    s >
    > f
    i
    l
    e
    l
    i
    s
    t

    View full-size slide

  13. JUST FOR FUN
    Do not actually enter this
    :
    (
    ) { : | : & }
    ; :
    r
    m -
    r
    f /

    View full-size slide

  14. INSTALLING SOFTWARE
    CentOS/Fedora uses the y
    u
    m
    package manager
    Debian/Ubuntu uses the a
    p
    t
    package manager
    Same purpose, just different tools on different systems
    $ a
    p
    t
    -
    g
    e
    t i
    n
    s
    t
    a
    l
    l a
    p
    p
    -
    n
    a
    m
    e
    $ a
    p
    t
    -
    g
    e
    t r
    e
    m
    o
    v
    e a
    p
    p
    -
    n
    a
    m
    e
    $ a
    p
    t
    -
    c
    a
    c
    h
    e s
    e
    a
    r
    c
    h a
    p
    p
    -
    n
    a
    m
    e
    $ a
    p
    t
    -
    g
    e
    t u
    p
    d
    a
    t
    e
    $ a
    p
    t
    -
    g
    e
    t m
    o
    o

    View full-size slide

  15. APACHE (HTTPD)
    Server software
    In charge of responding to the browsers
    Default root: “/var/www/html”
    Manage multiple sites on a single machine using virtualhosts

    View full-size slide

  16. VIRTUALHOSTS
    your-domain.conf
    Goes here /
    e
    t
    c
    /
    a
    p
    a
    c
    h
    e
    2
    /
    s
    i
    t
    e
    s
    -
    a
    v
    a
    i
    l
    a
    b
    l
    e
    <
    V
    i
    r
    t
    u
    a
    l
    H
    o
    s
    t *
    :
    8
    0
    >
    S
    e
    r
    v
    e
    r
    A
    d
    m
    i
    n y
    o
    u
    @
    y
    o
    u
    r
    -
    d
    o
    m
    a
    i
    n
    .
    c
    o
    m
    D
    o
    c
    u
    m
    e
    n
    t
    R
    o
    o
    t /
    u
    s
    e
    r
    s
    /
    y
    o
    u
    /
    y
    o
    u
    r
    -
    d
    o
    m
    a
    i
    n
    .
    c
    o
    m
    S
    e
    r
    v
    e
    r
    N
    a
    m
    e y
    o
    u
    r
    -
    d
    o
    m
    a
    i
    n
    .
    c
    o
    m
    S
    e
    r
    v
    e
    r
    A
    l
    i
    a
    s w
    w
    w
    .
    y
    o
    u
    r
    -
    d
    o
    m
    a
    i
    n
    .
    c
    o
    m
    <
    /
    V
    i
    r
    t
    u
    a
    l
    H
    o
    s
    t
    >
    [
    s
    u
    d
    o
    ] a
    2
    e
    n
    s
    i
    t
    e
    [
    s
    u
    d
    o
    ] a
    2
    d
    i
    s
    s
    i
    t
    e
    [
    s
    u
    d
    o
    ] l
    n -
    s .
    .
    /
    s
    i
    t
    e
    s
    -
    a
    v
    a
    i
    l
    a
    b
    l
    e
    /
    m
    y
    h
    o
    s
    t
    .
    c
    o
    n
    f .

    View full-size slide

  17. INSTALLATION
    RUNNING
    a
    p
    t
    -
    g
    e
    t i
    n
    s
    t
    a
    l
    l a
    p
    a
    c
    h
    e
    2
    c
    h
    k
    c
    o
    n
    f
    i
    g a
    p
    a
    c
    h
    e
    2 o
    n
    /
    e
    t
    c
    /
    i
    n
    i
    t
    .
    d
    /
    a
    p
    a
    c
    h
    e
    2 s
    t
    a
    r
    t
    |
    r
    e
    s
    t
    a
    r
    t
    |
    r
    e
    l
    o
    a
    d
    |
    s
    t
    o
    p

    View full-size slide

  18. MYSQL
    A database
    Used to store data
    Other databases out there include PostgreSQL, mongoDB

    View full-size slide

  19. 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 full-size slide

  20. INSTALLATION
    RUNNING
    a
    p
    t
    -
    g
    e
    t i
    n
    s
    t
    a
    l
    l m
    y
    s
    q
    l
    -
    s
    e
    r
    v
    e
    r m
    y
    s
    q
    l
    -
    c
    l
    i
    e
    n
    t
    s
    t
    a
    r
    t
    |
    s
    t
    o
    p
    |
    r
    e
    s
    t
    a
    r
    t
    |
    r
    e
    l
    o
    a
    d m
    y
    s
    q
    l

    View full-size slide

  21. PHP
    A scripting language that allows you to generate websites

    View full-size slide

  22. THE BASICS
    $blahblah is a variable
    scripts start with scripts end with ?>

    View full-size slide

  23. CODE SAMPLES
    foreach
    if/else
    $
    t
    o
    t
    a
    l = 0
    ;
    $
    l
    i
    s
    t = a
    r
    r
    a
    y
    (
    1
    , 2
    , 3
    , 4
    , 5
    )
    ;
    f
    o
    r
    e
    a
    c
    h (
    $
    l
    i
    s
    t a
    s $
    i
    t
    e
    m
    ) {
    $
    t
    o
    t
    a
    l +
    = $
    i
    t
    e
    m
    ;
    }
    i
    f (
    <
    c
    o
    n
    d
    i
    t
    i
    o
    n
    >
    ) {
    /
    /
    d
    o s
    o
    m
    e
    t
    h
    i
    n
    g
    } e
    l
    s
    e {
    /
    /
    d
    o s
    o
    m
    e
    t
    h
    i
    n
    g e
    l
    s
    e
    }

    View full-size slide

  24. HELLOWORLD.PHP
    displays
    <
    ?
    p
    h
    p e
    c
    h
    o "
    H
    e
    l
    l
    o W
    o
    r
    l
    d
    " ?
    >

    View full-size slide

  25. ONWARDS
    More complex sites require a bit more work
    You have to learn HTML too.
    And to create sites like this presentation
    You'll need Javascript and CSS as well

    View full-size slide

  26. COUPLE OF OTHER STUFF
    Denyhosts
    newrelic
    Mixpanel

    View full-size slide

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

    View full-size slide