SlideShare a Scribd company logo
1 of 55
Download to read offline
UPLOADING MIRROR API PROJECT ON 
AMAZON WEB SERVICES
WHY WOULD YOU USE AWS?
AWS 
• … allows you to use a free-tier for a year 
(micro instance) 
• … comes with a public IP and a unique DNS name for 
each instance running. 
• … offers more OS images to boot from than GCE.
YOU NEED A VALID CREDIT CARD 
BUT WON’T BE CHARGED IF YOU 
ONLY RUN ONE FREE TIER 
INSTANCE AT A TIME FOR A YEAR.
Setting up
Tutorial for Macintosh and PC
THINGS YOU NEED TO HAVE DONE 
BEFORE STARTING 
• Install JDK & Maven and set up environment variables 
• Download the quick start project from Github 
• Prep the quick start project and package it as a war file 
to ready to upload 
• Set up a Google Developers Console project (we will 
modify this)
STEP 1 
GET AN AWS ACCOUNT 
Go to https://console.aws.amazon.com 
and create an account. 
! 
If you have an amazon account, you still have to 
go through the process. They are separate services. 
Submit payment information.
STEP 2 
LOGIN TO YOUR NEW AWS ACCOUNT 
https://console.aws.amazon.com
YOU WILL BE GREETED BY: 
Click on EC2 (Elastic Computing Cloud)
On the dashboard at the left, 
1 
Click either of the 
“Launch Instance” 
buttons. 
2 
2
The first thing you’ll be asked to do, is to define the OS image you 
want for your instance. Make sure the image you are working with says 
“FREE TIER ELEGIBLE”. If it doesn’t say, select it and you should see 
a micro-option that says “Free tier elegible”
We will be working with an Ubuntu Image on this tutorial, but you are more than 
welcome to try the other “free tier elegible” images. Just make sure you know 
how to configure everything. 
1 
Search for “AMI-864d84ee” and select it 
2
1 
2 
Pick the “General Purpose Free Tier Elegible” micro 
instance 
Click “Next”. Don’t click review and Launch, we have more 
settings to go over.
All settings are fine, but check the “Protect Against Accidental Termination” 
box, so you don’t delete the instance by accident. 
1 
Click “Next” 2
Since it’s a micro-instance, your hard drive will only be 8GB. I’m not 
sure if you add more, you will be charged. 8GB is enough for now. 
Click “Next” 1
Give a name to your instance. 
If you need to add more tag value pairs, click create; 
for now, we will only add Name. 
1 
Click “Next”. 2
1 Select “Create a new 
2 
security group” 
and Change Name & 
Description 
Add the following network rules: 
SSH will let us connect to our server through a terminal 
or command prompt. 
Custom TCP rule will let the server have HTTP traffic.
1 
Check all the settings and click Launch. 
2
What is a key pair? 
A key pair is a small (.pem) file that allows you to SSH 
to EC2 servers. This connects you securely to your 
instance from your machine. 
A PEM KEY CAN ONLY BE DOWNLOADED ONCE. 
So, make a copy and keep it safe.
1 
2 
3 
1. Select “Create a new key pair” 
2. Give the key a name 
3. Click download key pair 
Once downloaded, click “Launch Instances” 
4
SUCCESS 
1 
Click 
“View Instances”
Once your instance is running, you’ll see it reflected in your instance view in 
the EC2 Console. If you select the instance and click “Actions” on top, you can 
start/stop/reboot/terminate your instance.
If you try to terminate your instance, you’ll get an error that you can’t 
terminate it unless you allow it. This is good to not delete it accidentally. 
We will cover how to delete an instance later.
If you select the instance name, you can see all of the info of the instance. 
What’s important right now, is that you copy the Public DNS of the instance.
MACINTOSH 
CONNECTING TO THE SERVER 
**Make sure Mac didn’t change 
the extension of your .pem key to .txt** 
Open a terminal and CD to where your pem key is stored 
and apply the following command: 
chmod 400 <keyname>.pem 
Example:
MACINTOSH 
Once the chmod is done, use the following command to SSH to your server 
ssh -i <keyname>.pem ubuntu@<public-dns> 
If you get a prompt to continue connecting, answer “yes”. 
Example:
WINDOWS 
1. Find your putty suite 
and open PuttyGen.exe 
1 
2 
2. Click Load and browse for 
the pem key we got from Amazon
1 Click “OK” 
Make sure 3 
SSH-2 RSA 
is checked 
2 
Save private 
key with new 
extension 
(.ppk)
Click “Yes” 1 
2
Open Putty.exe 
Change the host name for the 
public dns of your instance. 
Change port to 22 
and mark connection type as 
SSH.
Go to Connection/SSH/Auth and browse for the new .ppk key, then 
click Open 
1 
2 
3
If you get this alert, click yes.
When prompted what user to login as, type “ubuntu” and 
hit enter. You will then be connected to the server. 
1
INSTALL ON THE SERVER 
//Run the following 
commands on the SSH 
terminal: 
sudo su 
apt-get update 
apt-get install openjdk-7-jdk 
apt-get install tomcat7 
apt-get install tomcat7-admin
In order to upload your project to the server, you will 
need to setup credentials so that only you have 
permission to upload the war file. 
In the next slide replace the “user” and “admin” for a 
username and password to can remember and use later.
nano /etc/tomcat7/tomcat-users.xml 
<user username=“user” password=“admin” roles=“manager-gui,admin-gui”/> 
when done, “ctrl+O” to write and “ctrl+X” to quit. 
MAC USERS: 
don’t use ⌘, 
use control key
RESTART TOMCAT SERVER 
Commands to handle tomcat 
server: 
• START: 
/etc/init.d/tomcat7 start 
• STOP: 
/etc/init.d/tomcat7 stop 
• RESTART: 
/etc/init.d/tomcat7 restart
Get your public dns from the aws console and go to a browser and enter 
the following address: 
http://<public dns>:8080 
Example:
You should see the Apache Tomcat welcome page: 
* 
* If you click on the 
“manager-webapp” link, 
you’ll be prompted for 
username/password. 
It’s the same usr/pwd we 
set in the nano editor 
before. Don’t get used to 
clicking this link because 
we will delete this page 
from our server.
Go back to the SSH terminal and CD to /var/lib/tomcat7/webapps 
then run the following command to delete the ROOT application: 
! 
sudo rm -rf ROOT 
! 
Example:
Go to the Google Developers Console and open your project. 
1 
2
Add the public dns of your AWS instance to the Authorized 
JavaScript Origins and Authorized Redirect URI
UPLOADING TO AWS 
Open a local terminal/command prompt and CD to where 
the pom.xml file in your project is. Then run: 
! 
mvn clean install 
! 
mvn war:war 
! 
Search for the “target” folder inside your project and find the 
war file that was generated. Rename it to “ROOT.war” 
(case-sensitive)
Head over to the tomcat manager in your server. The address is 
<public-dns>:8080/manager/html 
! 
Example: 
Use the credentials 
we set on the server 
a few slides ago 
using the nano editor 
remember?
Choose the ROOT.war 
file and click Deploy 
Click the 
“/“ in the Path 
Column to be 
Redirected to 
your application.
TERMINATING AN INSTANCE
Select the instance to be deleted and Click on Actions. 
2 
1
1 
2 
3 
4 
5
OK, WHAT NOW?
TO GIVE THE 
APPLICATION TO 
YOUR USERS 
You simply have to give them 
the URL of your project, and 
have them login with their 
credentials and configure the 
settings on the browser, not 
glass! 
It’s that easy!
USEFUL LINKS/BOOKS 
• https://developers.google.com/glass/design/ui 
• https://developers.google.com/glass/develop/overview 
DESIGN 
CODE
And so we’ve come to the end of the presentation! 
My contact information: 
Diana Melara 
dm22510n@pace.edu

More Related Content

Recently uploaded

Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Niamh verma
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRnishacall1
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceanilsa9823
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPsychicRuben LoveSpells
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Pooja Nehwal
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7Pooja Nehwal
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...wyqazy
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceanilsa9823
 

Recently uploaded (9)

Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
Chandigarh Call Girls Service ❤️🍑 9115573837 👄🫦Independent Escort Service Cha...
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
哪里有卖的《俄亥俄大学学历证书+俄亥俄大学文凭证书+俄亥俄大学学位证书》Q微信741003700《俄亥俄大学学位证书复制》办理俄亥俄大学毕业证成绩单|购买...
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 

Featured

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Google Glass GDK on Amazon Web Services

  • 1. UPLOADING MIRROR API PROJECT ON AMAZON WEB SERVICES
  • 2. WHY WOULD YOU USE AWS?
  • 3. AWS • … allows you to use a free-tier for a year (micro instance) • … comes with a public IP and a unique DNS name for each instance running. • … offers more OS images to boot from than GCE.
  • 4. YOU NEED A VALID CREDIT CARD BUT WON’T BE CHARGED IF YOU ONLY RUN ONE FREE TIER INSTANCE AT A TIME FOR A YEAR.
  • 7. THINGS YOU NEED TO HAVE DONE BEFORE STARTING • Install JDK & Maven and set up environment variables • Download the quick start project from Github • Prep the quick start project and package it as a war file to ready to upload • Set up a Google Developers Console project (we will modify this)
  • 8. STEP 1 GET AN AWS ACCOUNT Go to https://console.aws.amazon.com and create an account. ! If you have an amazon account, you still have to go through the process. They are separate services. Submit payment information.
  • 9. STEP 2 LOGIN TO YOUR NEW AWS ACCOUNT https://console.aws.amazon.com
  • 10. YOU WILL BE GREETED BY: Click on EC2 (Elastic Computing Cloud)
  • 11. On the dashboard at the left, 1 Click either of the “Launch Instance” buttons. 2 2
  • 12. The first thing you’ll be asked to do, is to define the OS image you want for your instance. Make sure the image you are working with says “FREE TIER ELEGIBLE”. If it doesn’t say, select it and you should see a micro-option that says “Free tier elegible”
  • 13. We will be working with an Ubuntu Image on this tutorial, but you are more than welcome to try the other “free tier elegible” images. Just make sure you know how to configure everything. 1 Search for “AMI-864d84ee” and select it 2
  • 14. 1 2 Pick the “General Purpose Free Tier Elegible” micro instance Click “Next”. Don’t click review and Launch, we have more settings to go over.
  • 15. All settings are fine, but check the “Protect Against Accidental Termination” box, so you don’t delete the instance by accident. 1 Click “Next” 2
  • 16. Since it’s a micro-instance, your hard drive will only be 8GB. I’m not sure if you add more, you will be charged. 8GB is enough for now. Click “Next” 1
  • 17. Give a name to your instance. If you need to add more tag value pairs, click create; for now, we will only add Name. 1 Click “Next”. 2
  • 18. 1 Select “Create a new 2 security group” and Change Name & Description Add the following network rules: SSH will let us connect to our server through a terminal or command prompt. Custom TCP rule will let the server have HTTP traffic.
  • 19. 1 Check all the settings and click Launch. 2
  • 20. What is a key pair? A key pair is a small (.pem) file that allows you to SSH to EC2 servers. This connects you securely to your instance from your machine. A PEM KEY CAN ONLY BE DOWNLOADED ONCE. So, make a copy and keep it safe.
  • 21. 1 2 3 1. Select “Create a new key pair” 2. Give the key a name 3. Click download key pair Once downloaded, click “Launch Instances” 4
  • 22. SUCCESS 1 Click “View Instances”
  • 23. Once your instance is running, you’ll see it reflected in your instance view in the EC2 Console. If you select the instance and click “Actions” on top, you can start/stop/reboot/terminate your instance.
  • 24. If you try to terminate your instance, you’ll get an error that you can’t terminate it unless you allow it. This is good to not delete it accidentally. We will cover how to delete an instance later.
  • 25. If you select the instance name, you can see all of the info of the instance. What’s important right now, is that you copy the Public DNS of the instance.
  • 26. MACINTOSH CONNECTING TO THE SERVER **Make sure Mac didn’t change the extension of your .pem key to .txt** Open a terminal and CD to where your pem key is stored and apply the following command: chmod 400 <keyname>.pem Example:
  • 27. MACINTOSH Once the chmod is done, use the following command to SSH to your server ssh -i <keyname>.pem ubuntu@<public-dns> If you get a prompt to continue connecting, answer “yes”. Example:
  • 28. WINDOWS 1. Find your putty suite and open PuttyGen.exe 1 2 2. Click Load and browse for the pem key we got from Amazon
  • 29. 1 Click “OK” Make sure 3 SSH-2 RSA is checked 2 Save private key with new extension (.ppk)
  • 31. Open Putty.exe Change the host name for the public dns of your instance. Change port to 22 and mark connection type as SSH.
  • 32. Go to Connection/SSH/Auth and browse for the new .ppk key, then click Open 1 2 3
  • 33. If you get this alert, click yes.
  • 34. When prompted what user to login as, type “ubuntu” and hit enter. You will then be connected to the server. 1
  • 35. INSTALL ON THE SERVER //Run the following commands on the SSH terminal: sudo su apt-get update apt-get install openjdk-7-jdk apt-get install tomcat7 apt-get install tomcat7-admin
  • 36. In order to upload your project to the server, you will need to setup credentials so that only you have permission to upload the war file. In the next slide replace the “user” and “admin” for a username and password to can remember and use later.
  • 37. nano /etc/tomcat7/tomcat-users.xml <user username=“user” password=“admin” roles=“manager-gui,admin-gui”/> when done, “ctrl+O” to write and “ctrl+X” to quit. MAC USERS: don’t use ⌘, use control key
  • 38. RESTART TOMCAT SERVER Commands to handle tomcat server: • START: /etc/init.d/tomcat7 start • STOP: /etc/init.d/tomcat7 stop • RESTART: /etc/init.d/tomcat7 restart
  • 39. Get your public dns from the aws console and go to a browser and enter the following address: http://<public dns>:8080 Example:
  • 40. You should see the Apache Tomcat welcome page: * * If you click on the “manager-webapp” link, you’ll be prompted for username/password. It’s the same usr/pwd we set in the nano editor before. Don’t get used to clicking this link because we will delete this page from our server.
  • 41. Go back to the SSH terminal and CD to /var/lib/tomcat7/webapps then run the following command to delete the ROOT application: ! sudo rm -rf ROOT ! Example:
  • 42. Go to the Google Developers Console and open your project. 1 2
  • 43. Add the public dns of your AWS instance to the Authorized JavaScript Origins and Authorized Redirect URI
  • 44. UPLOADING TO AWS Open a local terminal/command prompt and CD to where the pom.xml file in your project is. Then run: ! mvn clean install ! mvn war:war ! Search for the “target” folder inside your project and find the war file that was generated. Rename it to “ROOT.war” (case-sensitive)
  • 45. Head over to the tomcat manager in your server. The address is <public-dns>:8080/manager/html ! Example: Use the credentials we set on the server a few slides ago using the nano editor remember?
  • 46. Choose the ROOT.war file and click Deploy Click the “/“ in the Path Column to be Redirected to your application.
  • 47.
  • 48.
  • 50. Select the instance to be deleted and Click on Actions. 2 1
  • 51. 1 2 3 4 5
  • 53. TO GIVE THE APPLICATION TO YOUR USERS You simply have to give them the URL of your project, and have them login with their credentials and configure the settings on the browser, not glass! It’s that easy!
  • 54. USEFUL LINKS/BOOKS • https://developers.google.com/glass/design/ui • https://developers.google.com/glass/develop/overview DESIGN CODE
  • 55. And so we’ve come to the end of the presentation! My contact information: Diana Melara dm22510n@pace.edu