How to host a website?

1.Install Apache

To install Apache run this command

sudo apt update sudo apt install apache2

After you have installed input your Ip into a browser

127.0.0.1:80

Or

{ip}:80

MAKE SURE YOU ARE NOT USING HTTPS!

You should see something like this

2.Create your own site

Here you have two opitons
1. Edit the default site code that apache comes with (you can find it at /var/www/html)
2. Create seperate file
In this tutorial I will walk you through point 2 since it's the slightly more complicated one

Create a new folder at /var/www/

sudo mkdir /var/www/test/

replace (test) with any name you want

Create index.html file

nano /var/www/test/index.html

Put your website into the file!

Example

Hello World!

Save file (you might need to restart apache using)

sudo service apache2 restart

Test it out!

127.0.0.1/test/

Or

{ip}/test/

HAVE FUN CREATING!