July 12, 2021
How-to-host-a-website-locally

How to host a website locally – in 5 minutes

There are so many websites in the world. Day by day it’s increasing. Before go live host If we have chance to check our web site in our local machine, that is better. In this article, I’ll guide you how to host a website in your local machine.

What is web hosting and why need web hosting?

Web hosting is just a service that helps to live your website on the internet. This web hosting call as hosting provider and it provides tools for live your website’s files. Web server is the main software tools and we can use this software windows and Linux platforms.

The web servers contains website’s files and response to the client according to their request through the web browsers. In short, web browsers communicate with web servers and web hosting is the key feature of the website alive.

Step 1 : Download web server software for your local machine

Web server required Apache,PHP,MYSQL software. When we install these software individually, we need configure them work together. Using XAMPP / WAMP software package that make your local server within few clicks.

In this article, I’ll guide you how to host a website locally using XAMPP software.

If you like to read more about XAMPP vs WAMP please click here.

For download XAMPP Server click here and select your OS where windows or Linux.

XAMPP Download page
XAMPP Download page

Then, save the file in your local machine hard disk.

SAVE_XAMPP_DOWNLOAD
SAVE XAMPP FILE

Step 2 : Install XAMPP Server on your local machine

Simply double-click on the downloaded file(.exe file) automatically appear(If you have already deactivate antivirus running ) and go through the below instructions.

then,

Step 3 : Start Your services and test your server is working?

After install the software, you can reach the individual component through the XAMPP Control panel.By this panel you can start/stop individual module services and maintain configurations and logs.

XAMPP control Panel

Using above panel you can start/stop individual modules.

Start/Stop modules

In XAMPP control panel, there are corresponding buttons under the “Actions”. When click these buttons you can stop and start related modules.Furthermore, you can Identify witch modules have been started because specific module names are highlighted with green under the “module” title.

  • Config: configure the XAMPP with individual components
  • Netstat: All running processes on the local machine
  • Shell: opens a UNIX shell
  • Explorer: opens the XAMPP folder in Windows Explorer
  • Services: shows all services currently running in the background
  • Help: links to user forums
  • Quit: closes the XAMPP Control Panel
XAMPP_control_panel -highlited

For every module in XAMPP there is an admin option located.When you click specific admin buttons you will get your XAMPP localhost dashboard and your database manege dashboard through your default web browser.

Alternatively, you can reach your localhost dashboard by typing “localhost/dashboard/” in browser address bar.Furthermore, you will reach MySql database admin panel via “localhost/phpmyadmin/”.

Step 4 : Locate web site/application files in server root directory and Test the web Server

For check whether your local host server is installed and configured correctly,there is an option to create a test PHP/HTML file, store it inside root folder and check via web browser.

  • After finish the above installation process, you can see the “xampp” folder inside your “C” drive.There is folder named “htdocs”. This is a root folder in your local web server(C:\xampp\htdocs for standard installations). You can keep your file in side “htdocs” folder.
  • Create new folder named “test” inside the “htdocs” folder and create a new test.php file inside test folder (C:\xampp\htdocs\test).
<html>
 <head>
  <title>PHP-Test-Page</title>
 </head>
 <body>
  <?php echo '<p>Hello World</p>'; ?>
 </body>
</html>
  • Finally, open your web browser and check via localhost/test/test.php. If you can see the word you written “Hello World”, Your local server is correctly configured and working successfully.

I hope you will get clear idea about, how to make local server in your computer.Is there any unclear step or any things to clarify please put a comment in comment section.Always I’m glad to reply.

Is this helpful please be kind enough to share with your friends.