Many web developers rely on local WAMP servers to develop websites prior to going live, utilizing an installation of Apache, PHP, MySQL and phpMyAdmin as part of a LAMP stack.
The hosts file is a Windows system file that translates website names into IP addresses for web browser requests, instructing Windows to make contact with that IP address to bring up that particular website.
Installation
WAMP, a free web development stack, allows developers to easily set up websites on their computers using WAMP. This enables them to work on the website before it goes live online and catch any errors before publishing it live; additionally it is wise to test on a local host first before uploading.
WAMP makes adding virtual hosts easier by editing the hosts file in Windows, which transforms names to IP addresses that browsers can call up in order to bring up websites. It is located at C:WindowsSystem32DriversEchtosts
Once the file has been edited, restart WAMP to make sure all services are operating normally. When you launch your browser, you should now be able to see the WAMP home page; if it doesn’t show, perhaps your firewall settings require adjustment, or another application could be using ports used by WAMP.
Configuration
WAMP (Windows Apache MySQL PHP) is a server package for hosting websites locally before publishing them live online; as it makes testing simpler and more reliable than testing on live websites.
Once your WAMP server has been installed, the next step should be configuring it. There are two methods available for doing this – either through its User Interface (UI) or in Windows Hosts File.
The hosts file is a Windows text file that stores names with IP addresses for matching purposes. When entering text into a browser window, this IP address will be called up from the hosts file to load up a web page.
Name-based virtual hosting will be discussed in this article and is the most commonly utilized method of hosting multiple websites on one physical server. However, its scalability may limit its use due to each website having a separate ethernet address.
Deleting a Virtual Host
To delete a virtual host, to click its instance node in the left pane and then “Delete.” This removes its web-server instance from your virtual host list; when restarting Apache server this virtual host will no longer be active and its requests will be forwarded onto another server instead.
Virtual hosting enables multiple domain names to be hosted on one server, saving money and improving performance by keeping data and applications separate from each other. It’s also an efficient way of running different website versions on the same physical machine. There are two primary forms of virtual hosting: Name-based and IP-based. Name-based virtual hosting is most prevalent; in this type, domain names are transferred directly to the webserver where it then determines which website it should return back to browser. IP based virtual hosting uses separate IP addresses for every website hosted on that server whereas IP-based virtual hosting uses unique IP addresses for every website hosted on that server.
Troubleshooting
WAMP is a program that installs Apache, MySQL and PHP on your computer as well as including phpMyAdmin’s web server phpMyAdmin to allow accessing databases. WAMP was designed primarily to make website development testing simpler without worrying about uploading files or dealing with live servers.
Possible scenarios could include another program using ports required by WAMPserver and causing it not to start up properly. Check your hosts file for syntax errors – particularly if there’s an extra / or in it.
The hosts file can be found at C:WindowsSystem32driversetchosts and can only be accessed using an Administrator-mode Command Prompt. Attempting to edit this file through Windows Explorer will result in an error; if this occurs it could indicate that your virtual host file contains syntax errors that prevent WAMP Server from starting up properly – if this occurs it is best to revert back to an earlier version of your host file for consideration.