SlideShare a Scribd company logo
Web 3
You know what?
That course name
isn’t good enough.
Web 3000


Let’s do some damage.
Today’s Agenda!


• WTF: Syllabus reviewed and expectations set.
• LOL: Chat it up. Ask me anything.
• OMG: Do something you [probably] don’t know how to do.
WTF
LOL
OMG
Today’s Impossible Thing
     Build your own server from scratch.
            No GoDaddy allowed.
Amazon Web Services
AWS vocab!

• EC2 = Elastic Cloud Computing. Basically a computer in
  the cloud.

• S3 = Simple Storage Service. Basically a hard drive in the
  cloud.

• Everything Else = We’ll deal with it on a case by case basis.
Step 1
Sign up for Amazon and log into the portal.
Step 2: Click EC2
Step 3: Security Groups
(wait, wtf is a
security group)
Step 4: Make a group like this
Make sure to click
“Apply Rule Changes”
Step 6
Click Instances. I’m not giving you a screenshot for this one. C’mon.
Step...
 wait what step are we on?
• Launch an instance by clicking the “Launch Instance”
  button

 • Name your instance.
 • Create a new “Key Pair”. Name it whatever and download
   it.

 • Set the server to “Ubuntu Server 12.04 LTS”, 64-bit (my
   preference)
Steps 37 through 152

• Click “Edit Details” on the next screen.
• Click “Security Groups”
 • Remember when we made that security group? Yeah,
   click that.

• Save, Launch.
Copy your whatever.amazonaws.com
Connect to your server
        We need to open Terminal.app for this.
Windows users - Putty and WinSCP - http://bit.ly/1YXodh
Fix your key pair.
chmod 0600 ~/Downloads/yourKey.pem
Log into the box
ssh ubuntu@whatever.amazonaws.com -i ~/Downloads/yourKey.pem
Breaking that down
• ssh = log into the server but on the command line. Think
  FTP.

• ubuntu@whatever.amazonaws.com =
  username@address.com

 • ubuntu is automatic default username for a new EC2
   Ubuntu server.

• -i ~/Downloads/yourKey.pem = identity file argument
You are now remotely in.
  Your command line is connected to your EC2 server.
 Until you disconnect (Ctrl+D) you are on that machine.
Pro Tip: Update!
               sudo apt-get update
              sudo apt-get upgrade

Always do this whenever you launch a new instance.
apt-get
An Ubuntu “package manager”. Install stuff on your server super fast.
Let’s install Apache.
                      Apache is web server software.
It’s like Finder for the WWW. It’s the engine behind > 100 million web
                                   sites.
Type this
   sudo apt-get install apache2
(then click Enter when prompted)
(that’s it)
What you just did:
• sudo = super user “do”. sudo means that the computer is
  your bitch.

 • You need permission to sudo. In this case Amazon pre-
   configured it.

• apt-get = the command line program to run, our package
  manager

• install = what we want the program to do. Bet you can
  guess this one.
Install some more stuff
• sudo apt-get install mysql-server mysql-client
• sudo apt-get install mongodb
• sudo apt-get install php5 php5-dev libapache2-mod-
  php5 php5-curl php5-gd php5-idn php-pear php5-
  imagick php5-imap php5-mcrypt php5-memcache php5-
  ps php5-pspell php5-recode php5-snmp php5-tidy
  php5-xmlrpc php5-xsl php5-common

• (steal that last one: http://www.giantflyingsaucer.com/
Having fun yet?
Don’t know the
      name of a package?
Google “apt-get install [name of thing you’re trying to install]”
                   That’s about all I know.
Let’s test out your server.
Go to
http://whatever.amazonaws.com
Yaaaaaaaaaayyyyy!
Now let’s set up SFTP.
First we need credentials.
                 sudo useradd -m [username]
                   sudo passwd [username]

           -m creates a home directory for that user.
You’ll need to enter the password twice. It won’t show up on the
                             screen.
Give yourself sudo access.
          sudo visudo
vi
A Command Line Text Editor
Add your username under root
Save and Quit
     Ctrl+O
     Ctrl+X
Test it out
     su yourName
   (enter password)
        sudo ls
(enter password again)
Edit SSHD settings
• sudo vi /etc/ssh/sshd_config
 • Type “i” to begin editing. (i as in insert)
 • Set port from 22 to 30000. This is for security.
  • PermitRootLogin should be no
  • PasswordAuthentication should be yes
 • Hit ESC.
 • Type “:wq” to save and quit.
Restart SSH
sudo /etc/init.d/ssh restart
(aside)
          You can restart lots of services with this.
Whenever you change a config file you probably need a restart.

                       For example:
One last thing...
Set up the WWW directory so we can edit it.
Create a group
        sudo groupadd webadmin
sudo usermod -a -G webadmin [yourname]
   sudo usermod -a -G webadmin root
Edit the WWW directory
   sudo chown -R root:webadmin /var/www
        sudo chmod -R 775 /var/www
Log In!
Holy Wow
You did it. You built a server from scratch.
       (Specifically a LAMP stack.)
Linux Commands
•   ls = list files

•   ls -la = list files a little bit more organized

•   cd /path/to/directory = change directory

    •   Use tab to autocomplete.

•   mkdir dir = make a directory

•   chmod permissions dirOrFile = change the read/write permissions. complicated.

•   chown user:group dirOrFile = change the owner of a file. also complicated

•   Ctrl+D or Ctrl+C usually quits something. I always forget which is which.

•   Apple+T creates new tabs. Useful for having one remote connection and one local.
Common vi Commands
• i = insert. once in insert mode type as normal.
 • (aside: Larry Tessler invented Word Processing because
   he hated vi)

• ESC = done inserting
• :q! = quit without saving
• :wq = save and quit
Advanced Tinkerings
• Ruby is a very popular platform these days. Perhaps install
  that?

• Or perhaps you want an all JavaScript solution. NodeJS +
  MongoDB.

• I know some of you are Django and Python nuts. Go on...
  Google it. You know you want to.

• Linux geek and hate Ubuntu? That’s fine. Use another
  flavor. You won’t hurt my feelings.
For next week
• Terminate your server and rebuild it from scratch. Practice
  makes perfect.

 • If you screw up you can always terminate and restart. If
   that even costs you a penny I’d be shocked.

• Build and deploy a small web site that takes some part of
  this deck and translates it into HTML, CSS and JavaScript.
  Hit me with your best shot.
Questions?

More Related Content

What's hot (20)

PPT
Ansible presentation
John Lynch
 
PPT
Tips for a Faster Website
Rayed Alrashed
 
PDF
Virtual Infrastructure
Bryan McLellan
 
PDF
Cialug August 2021
Andrew Denner
 
PDF
Create your very own Development Environment with Vagrant and Packer
frastel
 
PPTX
Ansible: How to Get More Sleep and Require Less Coffee
Sarah Z
 
PDF
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
LumoSpark
 
PPTX
Dockerizing WordPress
dotCloud
 
PDF
#OktoCampus - Workshop : An introduction to Ansible
Cédric Delgehier
 
PDF
A Introduction of Packer
Freyr Lin
 
PDF
Deploying your rails application to a clean ubuntu 10
Maurício Linhares
 
PPT
Hadoop on ec2
Mark Kerzner
 
KEY
Introduction to NodeJS with LOLCats
Derek Anderson
 
PDF
Start using vagrant now!
Andrii Podanenko
 
PDF
IT Automation with Ansible
Rayed Alrashed
 
PDF
Test driven infrastructure
Skills Matter Talks
 
KEY
A language for the Internet: Why JavaScript and Node.js is right for Internet...
Tom Croucher
 
PDF
OpenSource ToolChain for the Hybrid Cloud
Isaac Christoffersen
 
PDF
CFML Sessions For Dummies
ColdFusionConference
 
Ansible presentation
John Lynch
 
Tips for a Faster Website
Rayed Alrashed
 
Virtual Infrastructure
Bryan McLellan
 
Cialug August 2021
Andrew Denner
 
Create your very own Development Environment with Vagrant and Packer
frastel
 
Ansible: How to Get More Sleep and Require Less Coffee
Sarah Z
 
How to turn any dynamic website into a static site | 24.01.2018 | Artem Danil...
LumoSpark
 
Dockerizing WordPress
dotCloud
 
#OktoCampus - Workshop : An introduction to Ansible
Cédric Delgehier
 
A Introduction of Packer
Freyr Lin
 
Deploying your rails application to a clean ubuntu 10
Maurício Linhares
 
Hadoop on ec2
Mark Kerzner
 
Introduction to NodeJS with LOLCats
Derek Anderson
 
Start using vagrant now!
Andrii Podanenko
 
IT Automation with Ansible
Rayed Alrashed
 
Test driven infrastructure
Skills Matter Talks
 
A language for the Internet: Why JavaScript and Node.js is right for Internet...
Tom Croucher
 
OpenSource ToolChain for the Hybrid Cloud
Isaac Christoffersen
 
CFML Sessions For Dummies
ColdFusionConference
 

Similar to Web 3, Week 1: Amazon Web Services for Beginners (20)

PDF
Pilot Tech Talk #10 — Practical automation by Kamil Cholewiński
Pilot
 
PPT
Improving your shell usage - 2010
Chris Sinjakli
 
PDF
DevOps(3) : Ansible - (MOSG)
Soshi Nemoto
 
PPT
Hosting a Rails App
Josh Schramm
 
PPTX
WordPress CLI in-depth
Sanjay Willie
 
PDF
Setting Up a Cloud Server - Part 1 - Transcript.pdf
ShaiAlmog1
 
PDF
Deploying to Ubuntu on Linode
WO Community
 
PDF
Tutorial CentOS 5 untuk Webhosting
Beni Krisbiantoro
 
PDF
Sun raysetup
Portal Oliveira
 
PPTX
A Docker-based Development Environment Even I Can Understand
Jeremy Gimbel
 
PDF
Ubuntu Practice and Configuration
Manoj Sahu
 
PDF
How to deploy node to production
Sean Hess
 
PDF
Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)
Japheth Thomson
 
PDF
Automating the Cloud with Terraform, and Ansible
Brian Hogan
 
PDF
DevOps(4) : Ansible(2) - (MOSG)
Soshi Nemoto
 
PPTX
PowerShell - Be A Cool Blue Kid
Matthew Johnson
 
PPT
How To Deploy A Cloud Based Webserver in 5 minutes - LAMP
Matt Dunlap
 
PDF
Word press, the automated way
Michaël Perrin
 
PDF
Installing Lamp Stack on Ubuntu Instance
kamarul kawnayeen
 
PDF
instaling
tutorialsruby
 
Pilot Tech Talk #10 — Practical automation by Kamil Cholewiński
Pilot
 
Improving your shell usage - 2010
Chris Sinjakli
 
DevOps(3) : Ansible - (MOSG)
Soshi Nemoto
 
Hosting a Rails App
Josh Schramm
 
WordPress CLI in-depth
Sanjay Willie
 
Setting Up a Cloud Server - Part 1 - Transcript.pdf
ShaiAlmog1
 
Deploying to Ubuntu on Linode
WO Community
 
Tutorial CentOS 5 untuk Webhosting
Beni Krisbiantoro
 
Sun raysetup
Portal Oliveira
 
A Docker-based Development Environment Even I Can Understand
Jeremy Gimbel
 
Ubuntu Practice and Configuration
Manoj Sahu
 
How to deploy node to production
Sean Hess
 
Migrating a Site Quickly with SSH and WP-CLI (It's not as scary as you think!)
Japheth Thomson
 
Automating the Cloud with Terraform, and Ansible
Brian Hogan
 
DevOps(4) : Ansible(2) - (MOSG)
Soshi Nemoto
 
PowerShell - Be A Cool Blue Kid
Matthew Johnson
 
How To Deploy A Cloud Based Webserver in 5 minutes - LAMP
Matt Dunlap
 
Word press, the automated way
Michaël Perrin
 
Installing Lamp Stack on Ubuntu Instance
kamarul kawnayeen
 
instaling
tutorialsruby
 
Ad

Recently uploaded (20)

PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Ad

Web 3, Week 1: Amazon Web Services for Beginners

  • 4. Web 3000 Let’s do some damage.
  • 5. Today’s Agenda! • WTF: Syllabus reviewed and expectations set. • LOL: Chat it up. Ask me anything. • OMG: Do something you [probably] don’t know how to do.
  • 6. WTF
  • 7. LOL
  • 8. OMG
  • 9. Today’s Impossible Thing Build your own server from scratch. No GoDaddy allowed.
  • 11. AWS vocab! • EC2 = Elastic Cloud Computing. Basically a computer in the cloud. • S3 = Simple Storage Service. Basically a hard drive in the cloud. • Everything Else = We’ll deal with it on a case by case basis.
  • 12. Step 1 Sign up for Amazon and log into the portal.
  • 15. (wait, wtf is a security group)
  • 16. Step 4: Make a group like this
  • 17. Make sure to click “Apply Rule Changes”
  • 18. Step 6 Click Instances. I’m not giving you a screenshot for this one. C’mon.
  • 19. Step... wait what step are we on? • Launch an instance by clicking the “Launch Instance” button • Name your instance. • Create a new “Key Pair”. Name it whatever and download it. • Set the server to “Ubuntu Server 12.04 LTS”, 64-bit (my preference)
  • 20. Steps 37 through 152 • Click “Edit Details” on the next screen. • Click “Security Groups” • Remember when we made that security group? Yeah, click that. • Save, Launch.
  • 22. Connect to your server We need to open Terminal.app for this. Windows users - Putty and WinSCP - http://bit.ly/1YXodh
  • 23. Fix your key pair. chmod 0600 ~/Downloads/yourKey.pem
  • 24. Log into the box ssh [email protected] -i ~/Downloads/yourKey.pem
  • 25. Breaking that down • ssh = log into the server but on the command line. Think FTP. • [email protected] = [email protected] • ubuntu is automatic default username for a new EC2 Ubuntu server. • -i ~/Downloads/yourKey.pem = identity file argument
  • 26. You are now remotely in. Your command line is connected to your EC2 server. Until you disconnect (Ctrl+D) you are on that machine.
  • 27. Pro Tip: Update! sudo apt-get update sudo apt-get upgrade Always do this whenever you launch a new instance.
  • 28. apt-get An Ubuntu “package manager”. Install stuff on your server super fast.
  • 29. Let’s install Apache. Apache is web server software. It’s like Finder for the WWW. It’s the engine behind > 100 million web sites.
  • 30. Type this sudo apt-get install apache2 (then click Enter when prompted)
  • 32. What you just did: • sudo = super user “do”. sudo means that the computer is your bitch. • You need permission to sudo. In this case Amazon pre- configured it. • apt-get = the command line program to run, our package manager • install = what we want the program to do. Bet you can guess this one.
  • 33. Install some more stuff • sudo apt-get install mysql-server mysql-client • sudo apt-get install mongodb • sudo apt-get install php5 php5-dev libapache2-mod- php5 php5-curl php5-gd php5-idn php-pear php5- imagick php5-imap php5-mcrypt php5-memcache php5- ps php5-pspell php5-recode php5-snmp php5-tidy php5-xmlrpc php5-xsl php5-common • (steal that last one: http://www.giantflyingsaucer.com/
  • 35. Don’t know the name of a package? Google “apt-get install [name of thing you’re trying to install]” That’s about all I know.
  • 36. Let’s test out your server.
  • 39. Now let’s set up SFTP.
  • 40. First we need credentials. sudo useradd -m [username] sudo passwd [username] -m creates a home directory for that user. You’ll need to enter the password twice. It won’t show up on the screen.
  • 41. Give yourself sudo access. sudo visudo
  • 42. vi A Command Line Text Editor
  • 43. Add your username under root
  • 44. Save and Quit Ctrl+O Ctrl+X
  • 45. Test it out su yourName (enter password) sudo ls (enter password again)
  • 46. Edit SSHD settings • sudo vi /etc/ssh/sshd_config • Type “i” to begin editing. (i as in insert) • Set port from 22 to 30000. This is for security. • PermitRootLogin should be no • PasswordAuthentication should be yes • Hit ESC. • Type “:wq” to save and quit.
  • 48. (aside) You can restart lots of services with this. Whenever you change a config file you probably need a restart. For example:
  • 49. One last thing... Set up the WWW directory so we can edit it.
  • 50. Create a group sudo groupadd webadmin sudo usermod -a -G webadmin [yourname] sudo usermod -a -G webadmin root
  • 51. Edit the WWW directory sudo chown -R root:webadmin /var/www sudo chmod -R 775 /var/www
  • 53. Holy Wow You did it. You built a server from scratch. (Specifically a LAMP stack.)
  • 54. Linux Commands • ls = list files • ls -la = list files a little bit more organized • cd /path/to/directory = change directory • Use tab to autocomplete. • mkdir dir = make a directory • chmod permissions dirOrFile = change the read/write permissions. complicated. • chown user:group dirOrFile = change the owner of a file. also complicated • Ctrl+D or Ctrl+C usually quits something. I always forget which is which. • Apple+T creates new tabs. Useful for having one remote connection and one local.
  • 55. Common vi Commands • i = insert. once in insert mode type as normal. • (aside: Larry Tessler invented Word Processing because he hated vi) • ESC = done inserting • :q! = quit without saving • :wq = save and quit
  • 56. Advanced Tinkerings • Ruby is a very popular platform these days. Perhaps install that? • Or perhaps you want an all JavaScript solution. NodeJS + MongoDB. • I know some of you are Django and Python nuts. Go on... Google it. You know you want to. • Linux geek and hate Ubuntu? That’s fine. Use another flavor. You won’t hurt my feelings.
  • 57. For next week • Terminate your server and rebuild it from scratch. Practice makes perfect. • If you screw up you can always terminate and restart. If that even costs you a penny I’d be shocked. • Build and deploy a small web site that takes some part of this deck and translates it into HTML, CSS and JavaScript. Hit me with your best shot.

Editor's Notes