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
Partner Zones AWS Cloud
by AWS Developer Relations
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
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. A Free Amazon EC2 Cloud Server Based LAMP

A Free Amazon EC2 Cloud Server Based LAMP

Artur Mkrtchyan user avatar by
Artur Mkrtchyan
·
Nov. 14, 11 · Interview
Like (0)
Save
Tweet
Share
26.02K Views

Join the DZone community and get the full member experience.

Join For Free

Introduction

In this article I'm going to show you how to create a free Amazon EC2 cloud based LAMP Server and Point your domain to Amazon EC2 Instance.

There are 4 simple steps to do.

  1. Sign up for a 1 year free account from Amazon.
  2. Create a new server from an existing image.
  3. Install Apache, PHP, MySQL.
  4. Point your domain to EC2 Server.

Sign up for a 1 year free account from Amazon

Amazon offers an one year free account for new customers. 
Sign up for the account at the following link: http://aws.amazon.com/free/

Create a new server from an existing image

The free account only allows you to use a micro server.
1. Log into the amazon console. https://console.aws.amazon.com/s3/home
2. Go to the EC2 tab and click Launch Instance.
3. Select Launch Classic Wizard and go to the Quick Start tab and select the following Image Basic 64-bit Amazon Linux AMI 2011.09 (AMI Id: ami-1b814f72).
4. Select a Micro Instance which is free Micro (t1.micro, 613MB) and click on continue.
5. Advanced Instance Options: leave the defaults and click on continue.
6. Instance Properties: leave the defaults and click on continue.
7. Create Key Pair This key pair is important because it is needed to connect to your server. Click on the Create & Download your key pair.
8. Creating A Security Group: this allows you to define the firewall rules for your server. Select default and click on continue.
9. Click on Launch to start the server.

Connect to your Server

1. Download and install putty and puttygen. http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
2. Converting Your Key: Before you can use putty to login you need to convert the .pem key to a .ppk key.
3. Run puttygen. Select load and choose your downloaded .pem file. Click on Save Private key and save the file.
4. Connecting To Server: Run putty and fill in the server name ->Next click on the SSH -> Auth property. Browse to the new .ppk file and select it.
5. Click open. Type ec2-user and enter.
Congratulations, you are logged in...

Install Apache, PHP, MySQL

Now it's time to install apache, php and mysql on our linux.
sudo su
yum update
yum install mysql mysql-server
yum install php php-mysql php-xml php-mcrypt php-mbstring php-cli php-gd httpd

Configure Linux to start apache and mysql automatically after a reboot
/sbin/chkconfig httpd on
/sbin/chkconfig mysqld on

/sbin/service mysqld start
/sbin/service httpd start

Point your domain to EC2 Server

Each EC2 instance has a dynamic IP. With every server restart your instance will have a new IP address, which is a problem for DNS mapping. To overcome this problem Amazon introduced the notion of Elastic IPs. An Elastic IP is a static IP address that belongs to your Amazon account. To receive a new Elastic IP, simply go to Elastic IPs on the EC2 tab, and click Allocate New Address.
Then select the newly assigned IP and click Associate to assign it to your EC2 instance. The Elastic IP should be mapped to your server. Now your server has a new static IP address.

Now it's time to map your domain to your server: just modify your domain’s A record with your domain name registrar to point to the Elastic IP. If you have your domain registered with GoDaddy, you can go to the GoDaddy DNS Manager, select Edit Zone for your domain, and put the Elastic IP in the box provided for the A record.
In some cases you may need to wait up until 24 hours for old DNS records to expire before the domain name successfully maps to your EC2 instance.

That's all, Enjoy your server...

AWS Cloud

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Top 10 Best Practices for Web Application Testing
  • [DZone Survey] Share Your Expertise and Take our 2023 Web, Mobile, and Low-Code Apps Survey
  • Building a RESTful API With AWS Lambda and Express
  • Comparing Map.of() and New HashMap() in Java

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: