Portable Web Sandbox: How to set up a WAMP environment on a USB device

Saturday, March 1 2008

A quick how to on setting up your own portable sandbox to text your web projects, or text your site on a test zone, either you are on the move, or safe at home. This post is about setting up a WAMP scenario on a USB pen, or an external storage device more in general.

Let's say you are frequently travelling, or maybe you are a freelance web developer and have a lot of meeting with clients and want your work with you without the need to bring your laptop together. Or you want a simple test zone to play with your blog, or web site, but you are running on Windows and your web pages need a MySQL database and an Apache server to run. Whatever the case, this quick step-by-step guide will help you to run you own WAMP scenario on a portable device like a USB pen.

What you need to build a WAMP scenario on a USB pen

In this post we are presuming you'll have a USB storage device to work with, nevertheless it should be quite easy to replicate the process no matter the device you would use. The main goal of this guide is to have a portable WAMP system, if you prefer this same scenario could be set up on your pc hard disk quite easily.

USB Device

Choose the device you want to use, it could be a USB pen, an iPod, or an external disk. In chosing your device you'll probably have to think of the three main factors conditioning your choice:

  1. Portability
  2. Storage Capacity
  3. Price

Portability

This will affect how light and unosserved you'll be when moving with your WAMP sandbox with you. If you consider using this forgotten external hard disk you bought a couple of years ago, then you'll probably have to take car of a brick of around half a kilo, complete with two cables (power supply/usb connector). If you are using this at home, or at your office desk, then it's ok; if you were looking for something to bring with you when moving to your summer vacation cottage, then consider that you'll need some space for this to come with you.

Storage Capacity

Extreme portability could be achieved using a USB pen or, if you have one and do not mind sacrifying some room for your mp3s, an iPod. In this case you should consider how much storage capacity the device will give you (consider that if you are writing data, as when using a database powered web site, you should have enough space to grow). A 512M device will easily fit your WAMP sandbox, if you won't write data on a database, and your web site is quite small (how many images and how big those files are?), it could just fit your needs.

My personal choice is a 160GB Western Digital My Passport™ Essential™, at 0.590x4.967x3.130 inches for 0.231 pounds (15x126,15x79,5 mm for 0,1048 kg) is quite confortable to bring along.

My Passport Essential My Passport Essential - sizes comparison

Price

Finding the best choice for you could cost you some money, the most storage capacity in the smallest device is the most expensive solution. Also consider you'll probably pay more for the latest release of this toys, or the ones with the cool design, or with the bran plus. My tip here is to stick to a reasonable budget, given your needs, and focus on brands with a consolidate experience in storage devices. As for any other storage device, affidability is a not-to-be forget variable.

Software

Now that you have made your mind on what device is the best option for you, let's have a look at the software part of this project. As mentioned above, we are talking here to somebody working on a Windows system looking for a simple, and portable way to have her web site up and running the same way it's running on her host service on a LAMP system. What we need is something that could replicate this, on a Windows machine instead than a Linux one (this is why this is why the W took the place of the L in that acronym). More on WAMPs on Wikipedia.

Select your package, and start your journey

Even if you never set up a LAMP system, that is you barely understand what's the difference between MySQL and Apache, it's quite simple to set up a WAMP scenario thanks to various built-in packages offering the whole pack ready to install in a couple of clicks.

WAMP Packages

There are a few WAMP packages available on the web, some of them are more famous than others, quite all of them do provide a cost-free solution for individuals. To play things easy, will consider only three of those packages: XAMPP, WOS, and WampServer. Let's have a look at those packages in detail:

XAMPP. Details, setup, and launch.

XAMPP is a WAMP package containing the following software (applies to version 1.6.6a, 2008/02/22):

  • Apache HTTPD 2.2.8
  • MySQL 5.0.51a
  • PHP 5.2.5 + 4.4.8 + PEAR + Switch
  • Openssl 0.9.8g
  • PHPMyAdmin 2.11.4
  • XAMPP Control Panel 2.5
  • Webalizer 2.01-10
  • Mercury Mail Transport System v4.52
  • FileZilla FTP Server 0.9.25
  • SQLite 2.8.15
  • ADODB 4.96
  • Zend Optimizer 3.3.0a
  • XAMPP Security
  • Ming. For Windows 98, 2000, XP.

For XAMPP as for the other packages discussed here, you really don't have to install everything, just select the software you need (Apache, MySQL and PHP are ideally part of the base installation in most of the cases).

Download and Extract. Download the latest XAMPP version on apachefriends.org (XAMPP for Windows download) selecting among the available versions and installers (.zip, .exe, 7-zip). For this example will chose the .zip version.

Extract the content of the zip file in a empty directory, I'm used to creat a new directory on My Documents and name it TMP, you can chose your name and location as it best fit your usual pc environment. Extracting the XAMPP zip will results in a xampp directory with the following content (applies to v. 1.6.6a, 2008/02/22):

  • anonymous -file folder
  • apache -file folder
  • cgi-bin -file folder
  • FileZillaFTP -file folder
  • htdocs -file folder
  • install -file folder
  • licenses -file folder
  • MercuryMail -file folder
  • mysql -file folder
  • perl -file folder
  • php -file folder
  • phpMyAdmin -file folder
  • security -file folder
  • sendmail -file folder
  • tmp -file folder
  • webalizer -file folder
  • webdav -file folder
  • apache_start.bat
  • apache_stop.bat
  • filezilla_setup.bat
  • filezilla_start.bat
  • filezilla_stop.bat
  • mercury_start.bat
  • mercury_stop.bat
  • mysql_start.bat
  • mysql_stop.bat
  • php-switch.bat
  • readme_de.txt
  • readme_en.txt
  • service.exe
  • setup_xampp.bat
  • xampp_restart.exe
  • xampp_start.exe
  • xampp_stop.exe
  • xampp-changes.txt
  • xampp-control.exe
  • xampp-portcheck.exe

Installation. Now, depending on your needs, you may install the XAMPP package in your USB device or your pc. If you install XAMPP in a directory in the root of your device, you just need to copy the content of the directory there, or moving xampp in the root of your device. Assuming your USB device has the F device assigned, move the xampp directory in F:\ (resulting in F:\xampp) or move the content of the xampp directory in a directory of your choice in the device root (as, for example, F:\PortableSandbox). In the latter case copy all the files in your PortableSandbox directory, without the xampp folder (ie: Correct: F:\PortableSandbox, Wrong: F:\PortableSandbox\xampp).

If you chose the above option, you don't have to install the package, just double click on xampp-control.exe and the XAMPP control panel will pop up. If you prefer to install the package in a directory not in your USB root, let's pretend is something like \MY Projects\PortableSanbox\xampp, then you'll have to launch an installation script: setup_xampp.bat, in this case the only thing you have to do is to click a key to exit when asked to at the end of the installation process.

Launch. Either option you chose above, to launch the XAMPP package, you have to double click on xampp-control.exe this will launch the XAMPP control panel (see image below). To launch Apache (the web server) and MySQL (the database server), just click the corresponding start button. If everything went well a green running label will appear.

XAMPP, Apache server running

To really check if everything went smooth, open your web browser and enter the following URL: http://localhost (or, if you are an IP maniac, 127.0.0.1). After a splash screen, where you can select your language of choice, the following screenshot is the default localhost index page for your XAMPP package.

Integrate XAMPP with PortableApps

If you use the PorableAps suite you can integrate the XAMPP package in the PortableApps menu. The following is the link to the relevant application on PortableApps web site: http://portableapps.com/apps/development/xampp

WOS. Details, setup, and launch.

WOS is another WAMP Portable package, one of few softwares offered by CH Software. As of february 2008, the packages offered with WOS II are the following:

  • Apache2 (Version 2.2.8)
  • Apache2_SE (Version 2.2.8)
  • ImageMagick (Version 4.2.9)
  • MySQL5 (Version 5.0.45)
  • MySQL5_SE (Version 5.0.45)
  • PHP4 (Version 4.4.7)
  • PHP4_SE (Version 4.4.7)
  • PHP5 (Version 5.2.5)
  • PHP5_SE (Version 5.2.5)
  • Drupal (Version 5.6)
  • GTD-PHP (Version 0.7.1)
  • Joomla (Version 1.5)
  • Knowledgeroot (Version 0.9.8.5)
  • Mambo (Version 4.6)
  • MediaWiki (Version 1.11.0)
  • Moodle (Version 1.8.4)
  • OS_Commerce (Version 2.2)
  • OpenDB (Version 1.0.5)
  • PHPMyAdmin (Version 2.11.4)
  • PunBB (Version 1.2.16)
  • TYPO3 (Version 4.1.5)
  • TYPO3_Beta (Version 4.2beta)
  • Taskfreak (Version 0.6.1)
  • Textpattern (Version 4.0.5)
  • Wordpress (Version 2.3.2)
  • phpBB3 (Version 3.0)
  • xoops (Version 2.0.18)

Download and Extract. Download the latest WOS package, chose among the offered package the ones you want to be part of the package. Extract the zip content into a empty folder (see the above XAMPP process), the following is a list of the extracted files:

  • wos
  • www
  • Apache2.wos
  • GPL.txt
  • Licence.txt
  • MySQL5.wos
  • PHP5.wos
  • PHPMyAdmin.wos
  • wos.exe

Install and Launch. Create a folder in your device root, let's say (supposing your device is under the F letter) F:\\PortableSandBox, and copy all the content of the previously extracted zip. Double click on wos.exe and follow the installer instructions. At the end of the process you will be automatically redirected to the default welcome page on your localhost, click on the back link on the top right part of the page to enter the default localhost index page (following image).

WampServer 2. Details, setup, and launch.

WampServer 2 is the lightest of the packages presented, with an installation file of only 20M. The software included in WampServer 2 as of february 2008 are:

  • Apache 2.2.6
  • PHP 5.2.5 + PECL
  • SQLitemanager
  • MySQL 5.0.45
  • Phpmyadmin

Install and Launch. Launch the installer and follow the instructions. Select the folder where to install the package, the application's default path is C:\\wamp, change this to your device and directory of choice. At the end of the installation you can select to launch the WAMP Server

Pointing your web browser to http://localhost will redirect you to the default index page for your WAMP Server localhost (following image).

Hopefully this will be the first of few post dedicated to urban nomads and Location Indipendent people.

Is this going to give me a portable WAMP out of the box?

YES

huh?

OK, maybe I missed something, but it seems like the title said "How to set up a WAMP environment on a USB device"... You outline how to decide on a USB device, weigh up pro's and cons, then go on to talk about every other server app in existence other than WAMP and then finally go on to explain how to install WAMP (without explaining any steps required to ensure it's portable) Is this going to give me a portable WAMP out of the box? can you elaborate on this or send me an email explaining how to get WAMP running on my USB drive so that whether I'm at my laptop or my desktop I can continue to edit my site, databases and all?

Post new comment

The content of this field is kept private and will not be shown publicly.

Subscribe to the feed!

What is this RSS thing? For help on subscribing and more options, or to subscribe to a particular category, please have a look at: RSS feed how to.

My del.icio.us tags

Journal of Contemporary Street Art

The Journal of Contemporary Street Art is printed on demand with lulu (lulu.com) and it mix street art photography with toponomy research.

Buy the Journal of Contemporary Street Art - JoCSA00

Support independent publishing: buy this book on Lulu - Buy the Journal of Contemporary Street Art (JoCSA00)

Aggregate Me!

My Google shared stuff

browse my shared stuff on Google

My friendfeed page

me on friendfeed.

Support Civil Liberties and Human Rights

Support EFF and Amnesty International, visit their web sites and find out how you can help.

Beijing 2008