Wednesday, March 28, 2007

Portable server environments

USB Pen drives truly are a god-send!  I carry 3 around with me.  One I originally bought for my PS2, it's a 'Max Drive' 16MB drive.  It's faar too small for anything so it rarely get's used.  It does, however, have my CV on it, so I carry that everywhere with me.

My second USB Drive is my 'stuff drive' and is 2GB in size.  Colcoo kindly donated it to me, which is very nice of him.  I think it's a USB1.1 drive though as it's very slow.  Regardless though, 2GB is a hefty amount of data to carry around.

The third drive is now my 'web' drive.  All my current projects are stored on here, along with several portable app's via the U3 interface.  So I can code anywhere using Notepad++ and upload using my portable FileZilla.  As nice as it is, I've always got to upload something to my server to check if everything's ok!  Which is no good if your uploading to a live site to check things are ok!

Surely, if your updating a live site, you should have a test-server or somewhere where you can test the data before sending it live?

And it's that reason alone that I've just installed XAMPP on my 1GB 'web' drive.  It's got Apache, MySQL, PHP + Perl all bundled into a nice little 100mb install.

True, it takes up a 1/10th of my pen drive, but it shouldn't be a problem.  I try and code as lightly as possible, and I don't have that many projects on the go!  So I shouldn't fill up 900mb with a bunch of CSS & HTML files...

Preparations

I jumped on Google and searched for "localhost USB" and clicked on the first link I found (here).  It told me to go to the XAMPP website, and download XAMPPlite.   Now it's a pretty large file weighing in at 44mb (iirc).  But that didn't bother me, we've got broadband here, and it was pretty quick to download.

Installation

Once I downloaded XAMPPlite, I had to unzip it.  That created an 110mb directory, which I transferred to the root of my Pen Drive.  And believe it or not, that was installation done.

Running it

Running XAMPP is easy.  Navigate to the directory you copied it to on your pen drive.  Look for xampp-control.exe, and double-click it!  This will open up a GUI for XAMPP.  It will list 4 items (Apache / MySql / FileZilla & Mercury).  Hit the start button next to each item to start it and within seconds, you've got a working localhost.

In your browser, navigate to http://localhost and this should take you to the xampp start page, and if does, congrats!  You've got your own portable web-server just like me!

Notes

Note: As mentioned, I've just installed this and not really had a chance to give it a go!  I will post details at a later date on how to set things up!  I'm intrigued and wouldn't mind setting up a portable copy of Textpattern to test stuff!   If your running XAMPP or XAMPPlite, let us know about it!

No comments: