Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 1.19 KB

1 .hosting site with Aws.md

File metadata and controls

43 lines (31 loc) · 1.19 KB

Hosting a personal website on ec2

Create Ec2 instance

In security group allow http,https from anywhere as we will be accsessing the site from our browser

launch ec2

We will be hosting the site on http server Httpd is the Apache HyperText Transfer Protocol (HTTP) server program. It lets us to host our webpage on apache server

commands

sudo su

changing to root user

systemctl install httpd

Systemctl is a command-line tool that allows for the management and monitoring of the systemd system and service manager get httpd to install httpd service on the server

cd /var/www/html

changing the directory to html , all the files for hosting will be stored here

nano index.html

editing the index file for hosting the page and saving it

<html>
<body>
hi this is rishi visting my page on ec2 
</body>
</html>

systemctl enable httpd

to enable the httpd service

systemctl start httpd

to start the httpd service

systemctl status httpd

checking the status active or inactive

now we can access the site by copying and pasting the public IPv4 in our browser

note: by directly opening the site via redirect option the site may not load so open it via copy and pasting !!