How to create a free server and host websites in Linux.

Hello guys, in this post I'll teach you how you can create your own free server and host websites in it.

Hosting a free server:

First of all, you will have to create an account on this website. It's free.

Then you will have to download and extract the ngrok file. You can download it here. Extract this file in a new folder.

After creating an account on this website, you find a authtoken in the dashboard. The authtoken will look something like this:

$./ngrok authtoken <some random letters,special characters and numbers>

Copy this authtoken and open a terminal window in the folder where you extracted the ngrok file. Now paste the authtoken in the terminal window.

Now type: ./ngrok http 8080 in the terminal window. If a new type of black screen has appeared in your terminal window, your server in online.



Hosting websites in the free server:

To host websites in the server, you will need to have php installed. You can install it by typing following command in the terminal window:

sudo apt-get install php

Now go to the folder where you have stored your website's HTML file. Open the folder in terminal and type:

php -S localhost:8080




Now your website in active in your server. 

The link to your website will be present in the previous terminal screen that has a black background. You will get your link at the last two lines of the screen which says "Forwarding".




Thank You!


Comments

Popular Posts