Why India is not suitable for self driving cars.

LOCALHOST TO ONLINE

Have you ever built a website which needs a server for its full usage. I built a website for uploading and storing files. This website was developed using HTML, CSS, PHP AND JAVASCRIPT. When you bring php into the field then you will definitely need a server to keep the website live 24/7. The website which i developed was ready to use but the problem i faced is that, i was not able to keep the server live for the whole day.

At the basic, i first downloaded XAMPP server. Xampp makes your system the localhost. The website you have developed should be connected with the xampp server so that this server can act as the localhost.

CONNECTION

Download Xampp server, then you can see lot of files in the server. These are files which make the server run from start to  end. Then enter into xampp control, this opens a new tab which displays a list of servers like apache, sql, etc. You have to select the server which you want to initiate, this begins the severs process.I created a html website which contains php code and this php code needed a server to be live.

I'll tell you  what i did,....
   As i said i downloaded xampp, i saved my php code inside the htdocs folder. 
Then i entered into the xampp control folder and initiated the sql and apache servers. This initiates the server and our php code can be accessed through the localhost. After initiating the servers, enter into chrome and type localhost, this displays your php file.

But what happens when you turn off the server?

  • It does not work.
  • But don't worry i will tell you how to make it live.

How to make it live?

There are two ways to make it live.

One:- Create a virtual server through your router configuration.
(or)
Two:- Upload the code in hosing website.


Creating virtual server

Creating a virtual server is not an easy task.
Enter into the cofiguration area of your router and select virtual server option in the advanced settings area.
While creating a virtual server you connect your public ip with your router ip, this makes your code accessible by the public.
After creating the virtual server the code can be accessed just by entering the public ip address.

Disadvantage:-
Router has to live all the time.

You can purchase a raspberrypi and connect with your router using ethernet  cable. In this case the raspberry pi acts as the server, but the raspberry pi should also be running without a break.

Hosting in website 

Upload your code in a hosting website. 000webhost is a hosting website where you can upload and host your website for free.

Comments