Setting Up Local Web Server (aka Localhost) To Develop Websites
When a web developer undertakes a web development job from a client, the client/requestor might NOT yet have a domain name and a web hosting account. Or the client might NOT be technically savvy and is clueless on how to point/update his/her domain’s nameservers or how to access the cPanel.
As such, and in order not to delay the development, it is common for web developers to set up local web server (aka localhost) on his/her (the web developer’s) own computer or machine.
The advantages for web developers to set up local web server for their web development are :
- Economical – There is no need to have a domain name nor web hosting to start web development.
- Efficient – Web developer can start to develop the website without the technical hassle (usually on client’s side) of domain administration and control panel login.
- Fast – Web developer do rely on Internet access speed for the development since localhost simulate a web server on local machine; web development can be entirely offline.
- Offline – Web developer can showcase the web development/design project to the client before deploying it “live” on the Internet. Client will not be able to see the “live” status of the site which indirectly enhance your professionalism as a web developer.
- Backup – The completed website on the localhost can serve as a backup during the interim/initial period when web developer officially hand over the site to the client.
- Control – Since the web developer set up his/her own localhost environment he/she is in full control of the configurations and Shell access of the local sandbox web server environment.
The best tool/software to create local web server is none other than XAMPP at ApacheFriend. Here’s the exact steps to create local web server :
Go to https://www.apachefriends.org/download.html and download the latest version of XAMPP (~100MB) ie. xampp-win32-x.x.xx-x-xxx-installer.exe :
Click/run the XAMPP installer to install it at ie. C:\xampp.
After XAMPP is installed, you can start its control panel by running the xampp-control.exe application in the XAMPP folder.
“Start” the Apache and MySQL modules. Make sure they are running with Apache and MySQL highlighted in green.
Congratulations! Your local web server is now set up! Just fire up your browser and go to https://127.0.0.1 or https://localhost and you can see your front page.
Common Errors (and how to resolve them)
- One of the most common fault is that more than one instance of XAMPP are started. When double-click on xampp-control.exe to start XAMPP, give the PC a little time to response.
- Go to Task Manager (Ctrl+Alt+Del) and close all apps ie. http_ and mysql. Then start ONE instance of XAMPP.
- The Apache and/or MySQL module(s) is/are not able to start. The usual error is because port 80 is occupied. Common software that uses port 80 is Skype. So if you have Skype, remember to close the application before using XAMPP. Extra tips : XAMPP allows you to edit the “Config” to use other port/settings but this could be confusing for many. Hence, to avoid headaches, don’t change the Config.