Sunday, September 09, 2007

Drupal Site on a USB Stick

The church I go to has an annual Ministry Fair where in each ministry is showcased to the general membership. It is a opportunity to educate others on the value of each ministry, and to recruit interested parishioners.

Being a member of the Website Team, we are to have a spot in the fair, and wanted to demo our brand new drupal based website. However, the fair is being held at the church narthex, and there is no wi-fi signal from that location.

So would it be possible to run our entire website from a USB stick, or at the least, just copy the entire directory into several laptops?

Luckily, the answer is YES. I was able to rather quickly put together our entire site, interactively running, on a USB. I've been in IT for a while, and I'm still continue to get amazed at how things can 'just work', as they should. It must have taken me an hour to get our website running from a USB.

The general steps include:
  1. Download and extract a copy of xampp. This is a very easy distribution that contains Apache, MySql, PHP, and Perl. I put mine into c:\xampp. In my experience, it was literally extract and run the exe. If you have a firewall running, you get prompted for permissions. You have these services running in 15 minutes.
  2. Restore the website files from our backup to the c:\xampp\htdocs directory. In my case, it was c:\xampp\htdocs\smv\prod to preserve the file structure of the production website.
  3. Import the MySQL database for drupal from our backup. Since I've recently practiced our backup procedures in the last month, this helped shorten my work. If this is the first time you are importing the sql backup into your xampp MySQL, you may have to create your database and user, as the backup sql script usually does not have this.
  4. Start the xampp-control.exe
  5. Point your browser to http://localhost/smv/prod and test.
  6. Once it was all working, I copied this to my USB drive, g:\. I guess you could do this straight to your USB drive, but I found my USB was not as fast as my local disk.
Let me know if this works as well with you.

No comments: