To create Ubuntu EC2 instances, install the necessary web servers, and host websites displaying welcome messages.
- Go to the AWS Management Console.
- Navigate to EC2 and click on Launch Instance.
- Choose Ubuntu Server (e.g., Ubuntu 20.04 LTS).
- Select an instance type (e.g., t2.micro for the free tier).
- Configure security groups to allow:
- HTTP (port 80)
- SSH (port 22)
- Review and launch the instance. Download the
.pem
key file if prompted.
- Open a terminal on your local machine.
- Use SSH to connect to your EC2 instance:
ssh -i "your-key.pem" ubuntu@<public_ip_of_your_instance>
- Update the package manager and install Apache:
sudo apt update
sudo apt install apache2 -y
- Start and enable Apache:
sudo systemctl start apache2
sudo systemctl enable apache2
- Navigate to Apache's default web directory:
cd /var/www/html
- Create an index.html file:
sudo nano index.html
- Add the following HTML code:
<html>
<body>
<h1>Welcome to Cloud computing</h1>
</body>
</html>
- Save and exit the file.
In your browser, go to:
http://<public_ip_of_your_instance>
You should see the message: "Welcome to Cloud computing".
- Open WinSCP on your local machine.
- Set up a New Session:
- File Protocol: Choose SCP.
- Host Name: Enter the public IP or public DNS of your instance.
- Port Number: Set to 22.
- Username: Enter machine name eg. in my case - ubuntu.
- Advanced Settings: Click Advanced.
- Go to SSH > Authentication in the left sidebar.
- Select your .pem key file (downloaded from AWS) as the Private key file.
- Note: If WinSCP requires a .ppk file, convert your .pem file using PuTTYgen (next step).
- Open PuTTYgen (included with WinSCP).
- Click Load and select your .pem file.
- Save the key as a .ppk file by clicking Save private key.
- In WinSCP, return to the New Session window and click Login.
- Accept any security warning to establish a connection.
- The WinSCP interface has two panels:
- Left Panel: Your local machine files.
- Right Panel: EC2 instance files.
👨💻 𝓒𝓻𝓪𝓯𝓽𝓮𝓭 𝓫𝔂: Suraj Kumar Choudhary | 📩 𝓕𝓮𝓮𝓵 𝓯𝓻𝓮𝓮 𝓽𝓸 𝓓𝓜 𝓯𝓸𝓻 𝓪𝓷𝔂 𝓱𝓮𝓵𝓹: [email protected]