Servers

Review: Turn Windows into a test webserver with XAMPP

XAMPP lets you host a quick and dirty test server from Windows without investing in an expensive license.

These days, Linux tends to be the go-to platform for setting up and deploying an Apache-powered server. But if you prefer the Microsoft way and want to host a quick and dirty test server from Windows without investing in an expensive license for Windows Server or messing around with Linux, the open source community has you covered.

XAMPP, by Apache Friends, is known as an installable Apache distribution, containing everything you need to get a server up and running on your own PC. Essentially, this package includes several applications and services all bundled together for fast and easy configuration, such as Apache, MySQL, PHP, OpenSSL, FileZilla FTP server, and more. This web server kit has recently reached version 1.8 and comes loaded with various improvements and fixes as well as preliminary support for Mac OS X and Solaris.

Get started

It's easy to get started. Simply download XAMPP for Windows from the Apache Friends website, launch the installer, and set your system services for Apache and MySQL. Presto, you're online and ready to go.

XAMPP provides a convenient and easy to use control panel, which allows you to turn services like Apache or MySQL on and off, view process IDs and port numbers, edit configuration files, read activity logs and use Netstat. When the server starts up, you are given a local IP address which points to your page for testing purposes. Typing either http://127.0.0.1/ or http://localhost/ in your web browser will open the "XAMPP installed successfully" page.

From here, you can load all of your site content under what XAMPP calls the DocumentRoot area, which is similar in concept to the public_html folder found on most servers. Under Windows, the default location is C:\xampp\htdocs\.

Once you are finished copying in all the content, replace the index.php and/or index.html file to finish the process and replace the demo page provided by XAMPP. Since there is far more than I can properly cover here in this post, you can find out more about the web server setup and configuration procedure at the XAMPP Windows FAQ page. There are also various guides on the Web which give a series of steps from start to finish, including this one from New Net Enterprises.

Bottom line

In summary, XAMPP is designed with the web developer in mind, giving one the power and flexibility of a test web server without all the hassle of setting up a dedicated box running a special server operating system, just for site testing. When it comes to throwing a server out into the wild however, proper hardened security is a must and operating systems designed specifically for servers should be used for public-facing production sites instead of XAMPP. My advice for anyone wanting to give XAMPP a spin: Stay within the confines of an internal LAN, and you should have no problems.

Also read:

About

An avid technology writer and an IT guru, Matthew is here to help bring the best in software, hardware and the web to the collective consciousness of TechRepublic's readership. In addition to writing for TechRepublic, Matthew currently works as a Cus...

5 comments
mattiaz
mattiaz

You don't say some people are slow to notice some programs

Mark W. Kaelin
Mark W. Kaelin

How do you test a web server? What applications do you use?

Realvdude
Realvdude

I discovered Server2Go when I wanted to have a inhouse "copy" of our hosted website, for testing site changes prior to deploying. Being a Windows environment, I was looking for something less complicated than setting up a Linux box or installing Apache and MySQL in a Windows OS. Other than a couple of small config file tweaks, I was able to get the site up, including a authenticated users area. http://www.server2go-web.de

PJfromOttawa
PJfromOttawa

Install and run this XAMPP program (which will start a bunch of sub-services/programs that are common -- explained in the article) and then, while it's running, browse to either http://localhost or http://127.0.0.1 ("localhost" is synonymous with that IP address) which will show you the XAMPP default page. It's then up to you to replace their supplied default web content with yours, make changes, refresh your browser, and thus "test" the web server. All you need after XAMPP is setup and running is any web browser on the local machine (or LAN) where XAMPP is installed. Try it. You might be impressed how cool (and in some ways "simple"?) this all is.

ed
ed

Xampp is surprisingly easy to get running successfully--and it'll run on a USB thumb drive. I use it for a database project I'm working on and can carry it wherever I go. It includes PHP, MySQL, and Perl, among other features. They warn you not to expose it to the world, since it's wide open and has almost zero security. A start toward limiting access is when Windows firewall pops up and asks for permission, don't give it. It still works fine. And, of course, shut it down when you're not using it. When you need a "real" web server, there are numerous options, particularly if you can dedicate an old computer to the task. I like ClearOS and find it relatively easy to set up and run.