Normally I use this space for extended diatribes on everything from how much I hate Jim Carrey to how awesome I think Wendy’s comically unhealthy sandwiches are. While that’s all well and good, today I want to do something a little bit more useful by talking about how to setup a personal web server that you can take with you wherever you go. It might not seem terribly useful, but if you’re like me and carry your work around on a thumb drive, it can be tremendously useful.

I’m sure a lot of you are asking, “Dave, what the hell am I going to use a web server for anyway?” Well, using your own web server, you can build and test pages with server-side elements and databases without having to go through the trouble of uploading them to the internet. I’ve been trying to teach myself PHP for the last month or so, and using a personal web server has saved me a hell of a lot of time and frustration.

Well, this web server isn’t going to set itself up, so let’s have at it. The only thing you’re going to need for this tutorial is a computer, a thumb drive, an internet connection, and a little spare time. This should be quick and relatively painless.

Now we could do things the difficult way by setting up a bunch of different programs (Apache, PHP, MySQL, etc) separately, but that could take years and cost thousands of lives. We’re not going to do that, though. We’re going to take the easy way out and use an all-in-one solution called Xampp.

Xampp has versions for Linux, Windows, OS X, and Solaris. I’m using Windows, so that’s the path I’m going to take. If you’re using something else, you should still be able to follow along with this tutorial. Just make sure you select the appropriate operating system.

From Xampp’s homepage (http://www.apachefriends.org/), click on the “Xampp for Windows” link. Scroll down to the download section, and click the link to download the Zip file to your desktop. It’s a fairly large file, at 78 MB, so allow it some time to download. Alternatively, you could download the smaller version, called Xampp Lite, which is only 47 MB, but doesn’t have all the bells and whistles.

Once Xampp is downloaded, we can install it. The program comes with an installer, but it’s not necessary. We will simply copy the contents of the Zip over to our thumb drive. Again, this is a fairly large file, so allow a couple of minutes.

Once everything has been copied over, browse to the newly created Xampp folder on your thumb drive. Since we didn’t install this in the default directory, we’ll need to update a few paths. To do so, run setup_xampp.bat. It will take a couple of seconds to run, and then give you the following confirmation message:

Now everything is configured, and we can start our server. Double click the file called xampp-control.exe, which will launch the Xampp Control Panel. From here you can load the different programs (Apache, MySQL, FileZilla, and Mercury Mail) by clicking on the “Start” button next to their name. Once the service starts running, “Start” becomes “Stop”, and clicking that button will turn it off. Pretty easy, right?

You’ll want to start, at very least, Apache, as that is the web server program. If you’re working with databases, you’re going to need to run MySQL as well. Once Apache has been started, you can browse to http://localhost to see your web server’s splash page. Clicking your language will bring you into the control panel. From here you can make a variety of changes, from updating security to setting up new databases in MySQL.

To get your own files hosted, simply copy them over to the “htdocs” directory in the Xampp folder. To see them in your browser, simply append that file’s path to the end of http://localhost (e.g. http://localhost/test.htm, http://localhost/forum/index.php).

That’s about it, you’re ready to enjoy your new portable server. Keep in mind that, by default, there isn’t much in the way of security measures, so you may want to setup some passwords. Also, don’t forget to stop the services before disconnecting your thumb drive.

This has been Dave sayin’: “I used to dream about being an astronaut. I just never had the grades. Or the physical endurance. Plus I threw up a lot and nobody liked spending a week with me.”