Share
Embed
Transcript
27 slides
-
WINDOWS AZURE HACKING OUT WEBAPPS HOW TO GET STARTED, AND
WHAT YOU NEED TO GET GOING by & Laurence Putra Divyanshu Arora -
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. -
BUT RATHER A BUNCH OF STUFF you would need to
do to get started with your own linux servers to host your webapp -
LINUX?!?!?! Yep, you read it right. We'll be using CentOS
for this demo. -
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? -
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 -
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 -
WHY AZURE Because they have some really good features Bunch
of *easily usable* stuff like georeplication high availability free phone support -
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 -
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 -
COMMANDS YOU'LL USE VERY OFTEN ls ./ cd ../ pushd,
popd rm -rf / mkdir touch vim grep blah man -
OTHER UNIX-Y STUFF YOU SHOULD KNOW | ls | grep
NUS > ls > filelist >> ls >> filelist -
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 -
APPS REQUIRED TO RUN YOUR WEBSITE sudo yum install httpd
php mysql mysql-server php-mysql -
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 -
VIRTUALHOSTS your-domain.conf Put in in a directory and include that
directory in <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /users/you/your-domain.com ServerName your-domain.com ServerAlias www.your-domain.com </VirtualHost> -
MYSQL WHAT IS IT? A database Used to store data
Other databases out there include PostgreSQL, mongoDB -
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 -
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 -
COUPLE OF STUFF YOU NEED TO KNOW $blahblah is a
variable scripts start with <?php scripts end with ?> -
CODE SAMPLES foreach if/else foreach ($variable as $value) { $total
= $total + $value; $count++; } if ($condition) { //do something } else { //do something else } -
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