Run Apache, Php and MySQL off a USB Stick

From Redbrick Wiki
Revision as of 00:16, 20 May 2007 by Art wolf (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

If you are starting to get into web development you may find it starts to get annoying to build a site on RedBrick while using Dreamweaver and Photoshop etc.

The answer to this problem is to run Apache, PHP and MySQL off a USB stick! Maintaining your site on a USB stick allows you to easily plug it into a lab machine and work away and then bring it home and continue right from where you left off.




You will need to own a USB stick of at least 256MB (or 64MB if you can do without MySQL).


Download the lastest Apache HTTP (windows binary), MySQL Community Server (windows binary) and PHP (windows zip) from their respective sites.

Format your USB Stick.
Create a directory called 'pdrive' in the usb root directory - this is where everything will be run from.
Create a file called 'start.bat' in the usb root directory also, and have it contain the following :-
  /pdrive/php-X.X.X/php.exe -c /pdrive/php.ini -f /pdrive/start.php
Where php-X.X.X refers to the version of PHP you will install (i.e. php-5.2.2). Create a directory sess in pdrive/ for php to save the session data to.
Install Apache to pdrive/apache-X.X.X
Download this httpd.conf to pdrive/apache-X.X.X/conf/ 
Create a directory www in prdive/ - this will be where you develope your site.
Install MySQL to pdrive/mysql
Unzip PHP to pdrive/php-X.X.X
Download this PHP.ini to pdrive/
Finally download start.php to pdrive/ This will be run when you double click start.bat to start up the MySQL and Apache Services as well as open to your USB website, http://localhost:85.

You will need to update the pages to download to reflect your versions of Apache and PHP.