I had been idly wondering how you’d go about running Apache (or some other webserver) from a USB stick when I came across this site that makes doing it so ridiculously simple that I nearly fell off my chair!
Just start the “Mowes Mixer” mentioned in the last line of that home page and then select the ‘I do not have…’ option. You can then complete the software selection screen like so:
I’ve gone for the “Small Edition” Apache, MySQL and PHP5 -which is a 9MB download and yields as much functionality as you’ll need for the purposes of serving a Kickstart configuration file (for example). From the list of application software, you could add something like WordPress or Drupal: that will give you a portable website in which you could document Oracle-related tips or ideas (or anything else for that matter!) Add WordPress, for example, and your download goes up to 11MB, which is no big deal.
Once you download, you’ll end up with a zip-file sitting on your Desktop (or wherever you downloaded to, obviously). Unzip it, and copy the uncompressed folder to a USB drive that’s got around 100MB of free space.
Now double-click the mowes.exe file in that folder and an “installation” process takes place. The name’s a bit misleading, I think, because absolutely nothing gets installed on your PC to which the USB drive is attached. Instead, all that happens is that some directories and configuration files are created on the USB drive itself, once you’ve picked a language and agreed to the GNU GPL license. Your host PC’s firewall will probably also throw a fit when MySQL starts (allow it access, basically) and there’ll be a similar alert when Apache gets going (again, allow it access). Otherwise, that’s it!
You end up with this ‘control panel’ running on your host PC:
…which allows you to stop and start the web server. When you click End, the software quits completely, leaving nothing behind on the host PC. To get to the web server in your host PC’s browser, simply type the address http://localhost. If you’re trying to get to it from another PC (as you would if trying to Kickstart a Linux install on a virtual machine, for example), you refer to it by your host PC’s IP address -so, in my case, http://192.168.0.42.
The first time I tried this from a different PC (i.e., trying to access the server remotely), I obtained a 403 – You don’t have permission to access / on this server error. This is simply because the default Apache installation is very restrictive. To ease things up a bit (i.e., a lot!), click the Options menu in the MoWeS control panel and make the Security Options bit look like this:
Essentially, that means switch off the ‘only allow access to this server’ option; also switch off the one about ‘do not change the file .htaccess’; and then add an IP address of ‘ALL’ to the ‘allow access from…’ dialog. Stop and re-start the server and you should find remote PCs can now get to the web server’s home page OK.
Just note that WordPress (and, I’m guessing, quite a lot of the other applications) has its own configuration which, by default, expects all pages to be living on “http://localhost”. This means that accessing WordPress remotely won’t work properly (because ‘localhost’ on that remote PC means something very different than on the PC running the web server). The configuration option to change in WordPress is this one:
That’s found under the Settings option: just change the URLs to the IP address of the machine hosting the USB stick, and you’re good to go.
I wasn’t looking forward to getting Apache working from a USB device… but this makes it trivially easy to do and you get practically a complete “LAMP stack” thrown in for nothing… though without the “L”, obviously!
Should you need it, here’s my already-configured version as a zip file: just download, unzip, done. It doesn’t get much easier, I think!