Summary: How to place a standalone wiki on a USB stick
Prerequisites: MS-Windows system
Maintainer: Eh.. no-one :-)
Questions answered by this recipe
How can I run a complete standalone PmWiki installation on a USB drive
without having to install on the computer on which I wish to use PmWiki?
There are several ways to run PmWiki standalone.
This page describes a few methods:
- Using XAMPP - XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl.
- Using the Abyss Web Server. Abyss Web Server is a compact web server. It is about 1/10 the size of XAMPP.
- Using Web On Key by Dfaure. No instructions here - go to the linked site for info.
- Using usbwebserver - usbwebserver is a tiny webserver that is around 80mb and comes preinstalled with PHP, PhpMyAdmin, MySQL and Apache. Place pmwiki in the root folder to make it work. (You need to remove the existing files first. They just show some PHP information.)
The following instructions originally came from a PmWiki-users post by Neil Herber.
"I wanted to be able to demonstrate PmWiki, Simple Machines Forum, and WordPress to some clients showing them a live demo - not just a bunch of PowerPoint screenshots. This is what I did."
- Download XAMPP for Windows. I used xampplite-win32-1.5.4a.zip, but there are later versions now available. The full XAMPP includes a bunch of stuff I did not need, like the Mercury mail server. Use the zip file and not the installer to avoid any issues with registry entries.
- Unzip XAMPP lite into a top-level folder on your memory stick. For example, if the memory stick is drive F:, unzip into F:xampplite/. See warnings below about drive letters.
- Launch xampp-portcheck.exe to make sure the needed ports are not in use.
- Launch xampp-control.exe to get a very nice GUI control panel that lets you start and stop various components.
- Start Apache from the GUI. Start MySQL if you plan to run SMF or WordPress. PmWiki only needs to have Apache started.
- Browse to http://localhost/ or http://127.0.0.1/ and be amazed. You might want to read the warnings and notes.
- The document root defaults to htdocs/ - put the serveable bits there. So carrying on with the example above, you could have F:xampplite/htdocs/wiki/ containing PmWiki. In my case, I created additional htdocs/ subfolders called blog/ for WordPress and smf/ for SMF (duh!) and unzipped the relevant apps there.
- Not to steal the authors thunder, but I wanted to add one last bit to this. When I first read these instructions, I kept getting stuck at one spot (everything else works perfect as described). After completing every step up until now, remember that your site will be located at http://localhost/wiki/pmwiki.php or whatever you called your wiki folder (I'm sticking with the directions that specify your folder as wiki). If you want more websites, you would put http://localhost/othersite/index.php or index.html, etc. Just remember that whatever name you give your folder is exactly what name will come after localhost. Have fun! Real Chris October 22, 2008, at 10:45 AM
- One more important point. XAMPP does not work with Skype or most instant messengers. I believe its because it uses port 80 (or 8080). Anyway, before starting XAMPP, make sure that you turn off all instant messaging systems (Skype, YIM, AOL, MSN, etc.). If you don't do this, then you won't be able to start the Apache part. Anyway, after turning all of these off and clicking on Apache, you get a confirmation that its started. After its started you can turn on Skype, AOL, etc. and they'll work fine together. Just remember this step, its very important! Thanks, Real Chris October 22, 2008, at 10:51 AM
This works amazingly well on a fast stick - one with at least 8 Mbit/s read and write transfers. Most sticks do not indicate their speed and neither brand name nor price are a reliable indicator. You do not need a U3 USB stick.
Note that as shipped, XAMPP is not intended as a production server. You will need to lock it down if you intend to use it on the internet. Otherwise, it is pretty safe, because for someone to even see it on a LAN, they would need to know your IP.
Under XP (not tried under Vista) the Windows firewall traps the start up of the various servers. Just approve them when the dialog appears and all is fine. You can remove the approvals from the firewall later if you want to leave no traces behind.
The newer version(s) of XAMPP are advertised as working under Vista, which suggests the older versions may not. Read the precautions about Vista installs at the XAMPP site.
Some Apache configuration items under the Windows OS require hard-coded paths. For example, Directory commands require a path like "C:/Apache/htdocs/wiki/uploads". If you need to use these, make sure to assign the memory stick a drive letter that will not change from system to system. Force it to something like P:.
Extra Crunchy Goodness (TM)
As a bonus, XAMPP Apache comes with SSL installed. The Windows binaries from apache.org do not.
I have run this stick on laptops and desktop Windows machines and even on an Intel Mac under Parallels. Note that you do not need to reboot, install, or de-install any software on the host PC.
Because XAMPP is Apache with PHP installed, it is dead easy to set up, and PmWiki should behave more or less the same way as an install on a full-fledged server.
If you don't need a fully featured Apache install, use Abyss Web Server. Abyss is a fast, reliable and compact webserver on Windows (and other platforms) with a FastCGI PHP setup. It installs in little over 0.5Mb (just delete the redundant docs folder) and can be run without installation, directly from a pendrive. To install Abyss with PHP on a memory-stick, do as follows:
Note: If you just want to install a good webserver with PHP you can download a complete Abyss+PHP installer package from Aprelium.com
- Download the Abyss Webserver and install it. You'll uninstall it later on.
- Download the windows installer for PHP and install it. You'll uninstall it later on. Select "Other CGI" when prompted to configure a web-server.
- Make a folder in the root of the pendrive, named
-->Note: If you put the
Web directory somewhere other than root, then update line 5 of abyss.conf to reflect the full path to the Abyss directory (i.e.,
C:\MyDirectory\Abyss Web Server).
- Locate the
Abyss Web Server and
PHP folders in
Program Files. Copy both to your
Web folder. Within
Web rename the PHP-folder as
PHP. You now have 2 folders inside
Abyss Web Server and
- Download abyss.conf.txtΔ (browsing will be limited to the contents of the
Web folder) or abyss.root.conf.txtΔ (which allows all of the stick to be browsed) and copy it as
abyss.conf in the
Web/Abyss Web Server folder. Save.
- Copy your install of pmwiki into
- Clean-up: uninstall Abyss and PHP.
Now go to a computer, plug in the pendrive, locate the
abyssws.exe webserver in
Web/Abyss Web Server and execute it (or create a shortcut in the rootfolder of the pendrive). A blue icon appears in the taskbar. Now browse to http://localhost/ or http://127.0.0.1 and enjoy.
Note: the logon used to configure the webserver is
-- with password
Note: Abyss runs on many platforms, so a similar procedure will probably work for all of them.
Added by Kriss: I had to tweak php.ini this way: session.save_path = "..\pmWiki\tmp\sessions" (folder should be inside Abyss' <path>...</path> variable) otherwise I wasn't able to log in.
Excuse me for intervention, hope you'll be able to understand what I wrote. :)
Added by aless: (for Windows) There is no need to install either PHP or Abyss. PHP is distributed also as a .zip archive, download the zip package from the "Windows binaries" section at the php.net website here. The Abyss installer can be extracted directly with 7zip (download it from here), or rename the abwsx1.exe to abwsx1.zip and extract in a folder of your choice. Before starting the server it is necessary to create the directory "log" inside the newly created folder.
Added by behappyex: It is better to configure the Abyss Web Server using relative paths, becouse a memory stick will get a different drive letter every time used on different computers. For example, we have in directory
Web on the memory stick the following structure:
- Abyss Web Server
This configuration file contains the correct abyss configuration file for the directory structure described above, plus the
required configuration for the PHP script engine.
Using this procedure you can put the files in any directory you want, it does not need to have the name
Web or be in the root of the memory stick.
End added by behappyex
Apple OS X
- Download and install the MAMP server from [http://mamp.info].
- (It's big, ~60MB compressed, ~180MB installed.)
- Unzip and put the PmWiki files in the folder MAMP/htdocs/
- Open a web browser to
Mac OS X comes with Apache web-server (version 1.3) and PHP (version 4.?) pre-installed.
No need to download anything.
- Unzip the PmWiki files and install them:
- On root level in Library/
Web-serverWebserver/Documents (admin rights needed to do this). Open a web browser to http://localhost/
- In your user account in the folder Sites (Users/YourUserName/Sites). No admin rights needed for this. Open a web browser to http://localhost/~YourUserName/
Further correction: I bought a macbook pro recently, and it came without PHP installed. So I downloaded it from Apple's OS X download pages
. Also, in my system it's Library/WebServer/Documents. Everything else worked as above. - JonHaupt
January 17, 2007, at 09:30 PM
Correction to the correction: enough PHP is installed on even the client versions of Mac OS X to run PmWiki, but the php module is disabled by default in
. You have to uncomment the
of the php module, as well as the
line. Restarting Apache after this will have php enabled. You will need admin rights to both edit
and restart Apache. — Greg Lo
One further correction: for this to work for me with OS X version 10.5.7 that had not previously had Apache enabled, I had to uncomment the
LoadModule line as above, but my file was
/private/etc/apache2/httpd.conf and there was no
AddModule line (and it wasn't needed). I had to copy the file
/private/etc/php.ini, and then start Apache (System Preferences->Sharing->Web Sharing). — KAJ
Correction to MAMP instructions: For the final step, open your browser to
http://localhost:8888/pmwiki/pmwiki.php. (Instead of
localhost you can use your IP address.) — Don Johnson December 5, 2007 2:50 PM Pacific
- When you use the Finder to install PmWiki, correct the Read & Write permissions of the PmWiki folders if necessary. Mac OS X has its own ideas here.
- For all PmWiki folders except two, the Group "www" need Read access rights. The exceptions are the folders: wiki.d and uploads. For these the Group "www" needs Read & Write access.
- On the folders wiki.d and uploads, use "Get Info". Look for "Ownership & Permissions - Details." You will be the Owner (with Read & Write access), the Group need to be "www" with Read & Write access. To make the changes admin rights are necessary
january 16 07, by Han
- I haven't tested the instructions above myself yet, but it's easy
according to Neil. Christian
- Another solution would be to install Puppy Linux http://puppylinux.org on the usb flash drive. An XAMMP package for Puppy is available at http://murga-linux.com/puppy/viewtopic.php?t=5126 PL
- If you want to have a completely portable Windows computing environment that includes all of your favorite applications (not just PmWiki!) have a look at mojopac. It will run as a trial for 30 days or 200 boots after which you need to fork out $50 US or so. Works best on a pocket USB drive such as the WD Passport Portable Drive. As of today, the 160 GB version is $129 CDN at Costco. I have not tried this - but I am tempted! Neil Herber May 03, 2007, at 11:48 AM
- Installed XAMPP Lite on a 16GB USB stick and it runs great! Sovvie
See Discussion at WikiOnAStick-Talk
- Standalone -- Allows PmWiki to run in a "standalone" mode, without needing a webserver such as Apache
- Neil Herber
- (Christian Ridderström partially guilty for adding this to cookbook page:-)
- Jan Meijer (Abyss part)
User notes +1: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.