DevOps

Free AWS EC2 Ubuntu Instance Website setup

Amazon Web Service is a cloud platform which given us to create free AWS EC2 Ubuntu Instance hosting in both platform like Windows and Linux.
Here we are working on Ubuntu setup. Where we will install Apache2, PHP and MySQL.

1. First, you have to create a new account in AWS. If you have an existing account then no need to create.
2. After login you have to select EC2 option then you enter EC2 Dashboard.
3. Click Launch Instance
4. Select Free tier Eligible Ubuntu option.
5. Add New Volume EBS.
6. Add New Tag.
7. Add Security Group.

Type : SSH
Protocol: TCP
Port : 22
Source : Anywhere

Type : HTTP
Protocol : TCP
Port : 80
Source : Anywhere

8. Review and Launch
9. Create a New Pair Key. Download Key.
10. Using Puttygen.exe software create the public and private key.
11. Login SSH using putty.exe

Now we are ready to install Apache2, PHP, MySQL.

Command 1 ( Update Ubuntu server )

sudo apt-get update
sudo apt-get dist-upgrade

Command 2 ( Install apache2 server )

sudo apt-get install apache2

Command 3

sudo a2enmod rewrite

Command 4 ( Install php available version )

sudo apt-get install php

Sometime php7 not executing on Apache server. For that you need to just run following command

sudo apt install php libapache2-mod-php

Command 5 ( Start apache2 server )

sudo service apache2 restart

Command 6 ( Install MySQL server )

sudo apt-get install mysql-server

Command 7 ( Install PHPMyAdmin )

sudo apt-get install phpmyadmin
vim /etc/apache2/apache2.conf

Add the following to the bottom of the file:

# phpMyAdmin Configuration
Include /etc/phpmyadmin/apache.conf

And, restart Apache 2 with the following command:

service apache2 restart

Developer Diary

Share
Published by
Developer Diary
Tags: Ubuntu

Recent Posts

Git Tag Cheat Sheet

Introduction Git tags are an essential feature of version control systems, offering a simple way…

3 months ago

Understanding Web Storage: Cookies, Local Storage

Introduction The methods that browsers employ to store data on a user's device are referred…

4 months ago

Setting up OpenVPN Access Server in Amazon VPC – AWS

Introduction A well-known open-source VPN technology, OpenVPN provides strong protection for both people and businesses.…

4 months ago

Enhance Error Tracking & Monitoring: Integrate Sentry with Node.js & Express.js

Introduction Integrating Sentry into a Node.js, Express.js, and MongoDB backend project significantly enhances error tracking…

4 months ago

Comparing Callbacks, Promises, and Async/Await in JavaScript

Introduction In the world of JavaScript development, efficiently managing asynchronous operations is essential. Asynchronous programming…

6 months ago

How To Secure Nginx with Let’s Encrypt on Ubuntu EC2 Instance

Introduction Let's Encrypt is a Certificate Authority (CA) that makes it simple to obtain and…

8 months ago