DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
What's in store for DevOps in 2023? Hear from the experts in our "DZone 2023 Preview: DevOps Edition" on Fri, Jan 27!
Save your seat
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Working with Amazon Web Services (EC2)

Working with Amazon Web Services (EC2)

$$anonymous$$ user avatar by
$$anonymous$$
·
Jan. 17, 13 · Interview
Like (0)
Save
Tweet
Share
6.44K Views

Join the DZone community and get the full member experience.

Join For Free

as posted before i attended to a technical handson aws training last week. the subjects during these days were of course the standard ec2 and s3 services which i have used before. added to that we worked with rds , elastic load balancing , sns and vpc , elastic beanstalk and discussed a lot of terminology and business cases.


in this post i setup a new ec2 server and connect to it with your macos although it will work similar in case of linux. i have an account at aws in place. before you start make sure you have selected the correct region (for a simple demo it isn’t very big thing but when you are going to setup a real server it can make a big difference in the costs (network traffic) and latency although there are solutions for that).


by the way, there are two approaches to setup your ec2 server, you can choose a “s3 backed” ami ( amazon machine image ) or a “ebs-bakced” ami. there are a lot of good articles available about the differences and when to use which one.


in this demo i will install a “pre-baked” ami with a complete wordpress setup installed. there are thousands of these ami’s available in the aws community. for this one launch the aws management console at http://aws.amazon.com and choose the ec2 tab. in the aws console make certain you selected the correct region and select ‘images-amis’ in the left menu and search for “bitnami-wordpress”:


screen shot 2012-12-09 at 08.05.04


select the ami of your choice (i have 64-bit ubuntu running wordpress 3.4.2.1) and click ‘launch’. now simply follow the steps of the wizard (although there is a lot to tell about almost every option in the wizard i simply go for the most default installation). at the instance details step make sure you select a micro instance (to cut down the cost of having this demo running):


screen shot 2012-12-09 at 08.15.57


in the next two steps simply accept all defaults:


screen shot 2012-12-09 at 08.16.47
screen shot 2012-12-09 at 08.17.12


at the create key pair step create a key pair if you haven’t already done so:

screen shot 2012-12-09 at 08.19.19


the next step configure firewall create a security group so we are able to access our linux instance from the outside world by http and ssh:


screen shot 2012-12-09 at 08.21.36


finally review all your settings and if it is okay then launch the instance:


screen shot 2012-12-09 at 08.22.31


after a few seconds you should be able to see your new instance in the instances overview in the aws management console:


screen shot 2012-12-09 at 08.29.57


please pay specific attention to the public dns that is assigned to the instance. as you might be aware this dns will change after you stopped and started this instance. so i use it now to show how to connect to the instance via ssh but you should not use this dns as if it was a fixed ip/dns. to work around this issue amazon supplies elastic ip which i show in another post.
to connect with ssh to this instance open up a terminal on your mac and type the following commands.


first i had to narrow the permissions on the downloaded pem file for which i used:

 chmod u=r,go= 4synergy_palma.pem

then i was able to connect to the bitnami instance via ssh with:

ssh -i 4synergy_palma.pem bitnami@ec2-54-246-78-211.eu-west-1.compute.amazonaws.com as you can see here:
screen shot 2012-12-09 at 09.08.39


and of course we can enter our wordpress by opening the home url in a web browser:


screen shot 2012-12-09 at 09.15.20


in the next posts i will extend this example to make it a more robust and scalable solution.



Amazon Web Services Web Service

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Comparing Flutter vs. React Native
  • Simulating and Troubleshooting StackOverflowError in Kotlin
  • A ChatGPT Job Interview for a Scrum Master Position
  • (Deep) Cloning Objects in JavaScript

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: