Web server in your pocket

April 2007


With USB thumb/jump drive prices as low as they are, it is more and more common for people to have one or more laying around. I had one I wasn’t using very often and wanted to put it to good use. A friend of mind had been telling me how he was able to run Firefox and several other programs off of his drive. I hadn’t tried it yet, but it sounded pretty cool.

I thought about all the time I spend on half a dozen different web projects and how sometimes files get scattered across different computers and laptops that I use. I also don’t have a formal development environment set up because most of my projects aren’t large enough to really rate the time investment in setting one up. So, I usually find myself developing sites on old domains I own or in subfolders, which can get confusing. What I needed was a fully-fledged web server on a usb drive that I could take everywhere I go and use on any computer.

Well… that’s exactly what I found. Without much searching, I came across an amazing project called XAMPP from Apache Friends. XAMPP is an “easy to install Apache distribution containing MySQL, PHP, and Perl. [It’s] very easy to install and use - just download, extract and start.”

It really is as easy as they say. Below are the steps I took to get my own “pocket server” running:

  1. Download XAMPP Lite (the lite version is smaller and doesn’t have as many “extras”).
  2. UnZip the archive to the root of your USB drive.
  3. Open up the xampp folder and run the xampp-control.exe file.

    xampp control

  4. Click the “Start” buttons next to Apache and MySql to get things running. For me, at least, this control panel is a big sluggish, so be patient as the services get started. A “running” label will appear next to each service once they are running. Click the “Admin…” buttons, respectively, to access more information about your new web server (links to PHPMySQL and other tools).

Bam! That’s pretty much it. If you navigate to http://localhost/ you will see your server running. Place your website files inside the xampp/htdocs folder. Use PHPMySQL to create databases. I love using this to create new WordPress themes as I have a full copy of WordPress running on mine.

If you want to be a little slicker, you can create an autorun file like I did to make starting up your webserver even easier. Here’s a quick look at how I have mine set up:

Autorun

So, now when I plug-in my USB drive, this window pops up:

xampp startup

Clicking OK launches the control panel mentioned above. There is a lot more to this than I’ve posted here, but this should get you started. I love this because I can use it to develop themes and plugins for WordPress in a production-like environment and then easily push them to a “real” web server when I’m done.

Share This

tips

2 responses so far ↓

  • name // Apr 25, 2007 at 12:57 pm

    you should try WAMP as well

  • Dan O // Jan 30, 2008 at 9:52 am

    I’m downloading this for my Mac… before reading this article I thought I would have to install a bunch of separate stuff to make MySQL and PHP work on my built-in Apache webserver.

    Thanks,
    Dan O.

Leave a Comment