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
  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.
  3. BUT RATHER A BUNCH OF STUFF you would need to

    do to get started with your own Linux servers to host your webapp
  4. 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
  5. 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
  6. 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
  7. INTRODUCING LAMP Linux Apache MySQL Php A stack, that's moderately

    easy to set up, for you to start working on something right away
  8. 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
  9. 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
  10. 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
  11. 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
  12. JUST FOR FUN Do not actually enter this : (

    ) { : | : & } ; : r m - r f /
  13. 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
  14. 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
  15. 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 .
  16. 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
  17. 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
  18. 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
  19. 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 }
  20. HELLOWORLD.PHP displays < ? p h p e c h

    o " H e l l o W o r l d " ? >
  21. 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
  22. Q&A