Today I was asked to put together a fully-roamable version of a demo website on a laptop with Vista basic. This way, you can demo your site with a working db to a client while you’re out on a yacht with no wifi, for example. It’s fairly simple, but there are a few stupid things you need to do to get it working in Vista.
Objective: To create an instance of an existing website with Apache and MySQL that runs completely off localhost, so demonstrations can be conducted without a network connection.
For this project, I chose to use the very-awesome Apache2Triad. Apache2Triad takes care of PHP and MySQL with remarkable ease in XP, but we’re not using XP today.
Download and install the “Edge” release, 1.5.4 from http://sourceforge.net/project/showfiles.php?group_id=93507 . This will take care of MySQL, but the Apache services won’t start properly in Vista. To fix that, you’ll have to install Apache 2.2.4 over top.
Get the MSI installer of Apache 2.2.4 from http://httpd.apache.org/download.cgi , and do a ‘custom’ install into the same path as your Apache2Triad installation. UAC will ask you for allowance, and a blank message box with nothing but an OK button came up (a cmd window came up to tell me that the Apache service was already installed, and that I could press esc to quit, but I just ignored it). Click to allow the UAC, and OK on the mystery window. When prompted, put in localhost for the host and server names. You can leave the email address blank if you want. The latter installation will add a shortcut to the Startup folder in your start menu, you can remove that.
After a reboot, Apache and MySQL should both start automatically.
Try navigating to localhost in your browser. The second time you installed Apache should have a message telling you that “It works!”. Navigate to your site root, (C:\apache2triad\htdocs by default) and paste in a copy of your demo site.
Check out http://localhost/phpmyadmin , and use the Import feature to recreate your database(s) from SQL dump files. (Oh, by the way, go make SQL dump files out of your database with Phpmyadmin’s “Export” if you haven’t already.) Click the Privileges tab in Phpmyadmin and create the accounts you need.
Navigate to http://localhost/ again and try out your site. If all went well, you should now have a working copy of your website that you can take with you and demo for clients anywhere.