EC2 means Elastic compute cloud.
AWS provides secure and resizable compute capacity in cloud.
Step 1.
First we will search EC2 Dashboard. There is not a single Instance here at the moment.
Here we see a button called Launch Instance, Click on the button.
Step 2
After Clicking on the launch button we will see a number of operating system. Aws is offering free service for one year. But we can take some of these in the selected operating system(Free tier eligible).
We will select Ubuntu 20.04
Ubuntu Server 20.04 LTS (HVM), SSD Volume Type - ami-0851b76e8b1bce90b (64-bit x86) / ami-0491e5015eb6e7a9b (64-bit Arm)
Ubuntu Server 20.04 LTS (HVM), EBS General Purpose (SSD) Volume Type. Support is available from Canonical (http://www.ubuntu.com/cloud/services).
Select Free tier eligible
Step 3
Choose an Instance Type. T2.micro (Free tier eligible 1 Gb Ram)
Next, Click (Next Configure Details)
Step 4
Configure Instance Details. There is nothing to do here. Just click Add Storage
Click Next Storage
Step 5.
You write down how much space you need here. You get a maximum of 30 GB for Free. I put 8 GB here. If you like more, you can do more.
Free tier eligible customers can get up to 30 GB of EBS General Purpose (SSD)
After That Click Add Tag
Step 6
We don’t have to do anything here --
Next, Click Configure Security Group
The most important part of this section...
Step 7
Configure Security Group
Add a new Rule, by clicking Add Rule
Next, Click Review Abd Launch
Step 8
here just click launch
Step 9
Create New Key ---
1. Enter the New key
2. Type Your Key Name Like as (myfirstserver)
3. Download the Key File
Then Launch
Your Instance is ready .
Back To EC2 Dashboard
Step 10.
Next Goto Menu Option Select Elastic IP
You Need an Elastic IP Address for Your Instance. This address is a static IPv4 address designed for dynamic cloud computing, it does not change over time.
Step 11.
Normally you can see No Elastic IP addresses found in this Region
Click Allocate Elastic IP Address
Step 12.
Just Click Allocate
Our Elastic IP Address is created.
Step 12.1.
1. Now Select Your Elastic IP
2. Goto Action Menu
3. Select – Associate Elastic IP Address
Here you have to select the elastic Ip Address and Then click Associate Elastic IP Address
Step 13.
Here Instance and Private IP Addresses are given.You just have to select...
Next
1. Choose an Instance
2. Choose Elastic IP
Then Click Associate
Now go to the folder where you downloaded the key file.
Step 14.
I am using Ubuntu so I will access the server with dipunewserver.pem File
If you use Windows then you have to use putty. Below is a link to how it works.
https://www.youtube.com/watch?v=bi7ow5NGC-U
My Key file name is dipunewserver.pem
Open Terminal on Ubuntu
You need to change the permissions of the file that you have downloaded.
Set Permission 400 for your key file
chmod 400 dipunewserver.pem
Step 15..
Back to the ec2 dashboard and copy
Public IPv4 DNS
In my case Public IPv4 DNS is ec2-3-111-2-237.ap-south-1.compute.amazonaws.com
Next
ssh -i "dipunewserver.pem" ubuntu@ec2-3-111-2-237.ap-south-1.compute.amazonaws.com
Now we are in ubuntu@ip-172-31-46-175:~$
Install Apache
Let’s begin by updating the local package index to reflect the latest upstream changes:
sudo apt update
Then, install the apache2 package:
sudo apt install apache2
Let’s See Ip ... Connect or not
Its Workin here... Good sign.
Step 16.
Now we will access the server from FileZilla.
Open Filezilla
Connected With FileZilla. By default, this is the folder location. We will use this location. We will see if we upload any html files here. Permission must be given from the HTML folder before uploading the file.
PHP will not support it here because it has not yet been installed.
goto var/www/html folder
Set Folder permission
sudo chmod -R 777 /var/www/html
Step 17.
Install MySQL
sudo apt upgrade
sudo apt install mysql-server
Step 18.
Set Database Password
sudo mysql_secure_installation
Press Y
Next
There are three levels of password validation policy:
LOW Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG:
Type 2 for Strong
Then
1. New Password
2. Confirm Password (STRONG Length >= 8, numeric, mixed case, special characters and dictionary file)
Your Pass word Like Atd!9876@
Next
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) :
Type – Y
Remove anonymous users? (Press y|Y for Yes, any other key for No) :
Type --> Y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) :
Type --> Y
Remove the test database and access to it? (Press y|Y for Yes, any other key for No) :
Type – Y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) :
Type -->Y
All Done..
Step 20.
Install PHP
sudo apt install php libapache2-mod-php php-mysql
Check php Version
php --version
Step 21.
install phpmyadmin
sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl
Select Apache2 and enter
Yes And enter
Set phpmyadmin Password
Set Confirm Password
Press Ok
In my case, I will abort it now
abort and enter
Step 22.
If Need password For Mysql
mysql -u root -p
And Give Your Password
sudo mysql
Next Type
UNINSTALL COMPONENT "file://component_validate_password";
Then
Exit
Step 23.
sudo apt install phpmyadmin
yes and enter
Step 24.
sudo mysql
INSTALL COMPONENT "file://component_validate_password";
Exit
Step .25
sudo phpenmod mbstring
sudo systemctl restart apache2
Step 26.
Create a Shortcart Phpmyamin folder
sudo ln -s /usr/share/phpmyadmin /var/www/html/
Your Server is ready
For full permission the database...
sudo mysql
use mysql;
CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'Arise!001@2';
SET PASSWORD FOR 'phpmyadmin'@'localhost' = PASSWORD('Arise!001@2');
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit
Thanks
AWS S3 bucket policy for upload and download Goto AWS Account -> S3 -> Select Bucket&..
If you are unable to connect to port 22 on your Amazon EC2 instance, it could be due to several reas..
Solved Amazon ec2 not working when accessing through public IP Check your security group.. ..
EC2 means Elastic compute cloud.AWS provides secure and resizable compute capacity in cloud. ..
Aws Ec2 Single Instance Multiple domains. First, we go to the sites-available folder. Where there ar..
Get the latest news and updates by signing up to our daily newsletter.We won't sell your email or spam you !