You don’t have to lease server space or keep your home computer always on to access a personal web server—you can run a web, FTP, and database server straight from a USB drive. A slim web server package called XAMPP fits on a USB stick and can run database-driven webapps like the software that powers Wikipedia, MediaWiki. Almost two years ago you learned how to set up your “personal Wikipedia” on your home web server to capture ideas and track document revisions in a central knowledge repository. Today we’ll set up MediaWiki on your flash drive for access on any Windows PC on the go.
A word on security: The XAMPP web server package is intended for web developers to use while building web sites, so by default, the passwords are blank and configuration is not secure. Running server software opens up a port on your computer, which in and of itself is a security risk. Getting this set up requires getting your hands dirty editing configuration files. If you’re not comfortable with the risks and implications of this solution but still want your own wiki, I highly recommend the free, hosted, PBWiki. Also check out the nifty TiddlyWiki for a less setup-intensive wiki-on-a-thumb-drive alternative.
Still with me? Let’s get your personal wiki running on a thumb drive.
What You’ll Need
In order to get your personal Wikipedia running on your thumb drive, you’ll need:
- A Windows XP PC with Service Pack 2 or Windows Vista Ultimate
- A thumb drive with at least 150MB free. The bigger your drive, the more data you can store on it so go as big as you can here.
Install and Start XAMPP
Download the XAMPP Lite .EXE installer from here. Double-click on the file to extract it, and choose your flash drive’s drive letter as the destination (not a subfolder.) A folder called
xampplite will be created on your thumb drive.
(Note: I chose XAMPP Lite because it offers everything we need to run MediaWiki, and it’s smaller in size than XAMPP. But XAMPP is updated more often than XAMPP Lite, and you can install add-ons with full-on XAMPP, so it may be a consideration if you want to do more than just run MediaWiki on your thumb drive.)
Once XAMPPLite is saved to your flash drive, to start it up, double-click on the
xampp-control.exe file in the
xampplite directory. That will launch XAMPP’s Control Panel, which lets you start all the services you need.
To run MediaWiki, you need two services: Apache web server, and the MySql database server. Click the Start button next to each of those in the XAMPP Control Panel, as shown.
When you hit the Start button, your system’s firewall may ask whether or not it should allow incoming and outgoing connections to the software. Allow it.
Now your portable web server is up and running. To see it in action, in your web browser, visit http://localhost/. Click on your language of choice—by default, XAMPP Lite’s English homepage looks like this.
The first thing we want to do is set up a few passwords to secure your servers. Click on the “Security” link on the sidebar (by default, located at http://localhost/security/. You’ll see that by default, all of XAMPP’s settings are marked as insecure. Click on the link below the security table to “fix” the problems (by default, http://localhost/security/xamppsecurity.php.) On this next page, set your MySql database password for the root user. If you choose, you can set a password for visiting any web page as well, as shown.
To enable the new MySQL password, switch to the XAMPP Control Panel, stop MySql, and start it again.
Install and Configure MediaWiki
Now that your web and database server is up and running, it’s time to install the MediaWiki wiki software. Download the latest version of MediaWiki from here (as of this writing, the file name is
mediawiki-1.11.1.tar.gz.) Extract the files (first gunzip, then tar, the free 7-Zip utility can do this for you), and by default they’ll be stored in a folder called
mediawiki-1.11.1. Rename this folder simply
wiki and move it to your thumb drive in XAMPP’s
xampplite\htdocs\ folder. When you’re done, if your thumb drive’s letter is G:\, the full path to the MediaWiki files would be
To configure MediaWiki, visit http://localhost/wiki/. Click on the link to configure your wiki. There you can keep all the default settings except:
- You must enter the name of your wiki. Mine is “GinaWiki.”
- You must enter a wiki administrator name (by default, WikiSysop) and password.
- Enter your database information. The database name can stay wikidb, but change the DB username to root and enter the password you set up above.
Scroll to the bottom of the page and click on the “Install MediaWiki!” button to save your settings. When the installation is complete, MediaWiki will prompt you to move the
LocalSettings.config.php file up a directory on your thumb drive. Go ahead and do that. You’re moving the file from
Finally, visit http://localhost/wiki/ to see your fresh new MediaWiki installation in action, as shown below. Congratulations!
From here you can start editing and adding pages, creating user accounts and even uploading files to your new wiki.
But first, two helpful customizations will make your new wiki easier to use.
- Make your wiki the default start page. When you visit your local server, you might want your wiki’s home page to appear first instead of XAMPP’s homepage. To do that, open the
index.phpfile in XAMPP’s
htdocsdirectory in a text editor. Change the line that reads:
header('Location: '.$uri.'/wiki/');and save it. Now, when you visit http://localhost/, you’ll go directly to your wiki.
- Add a custom wiki logo. To add your own logo to the upper left hand side of your wiki install, create a 135×135 pixel image, name it
mywikilogo.png, and save it to
H:\xampplite\htdocs\wiki\skins\common\imageswhere H: is your thumb drive’s letter. Then, open the
H:\xampplite\htdocs\wiki\LocalSettings.phpfile in a text editor and add the following line:
$wgLogo = "/wiki/skins/common/images/mywikilogo.png";Save the file, and refresh your wiki in the browser. You should now see your custom logo. (Note: the logo doesn’t have to be a PNG file; substitute your image’s extension, like JPG or GIF.)
Stopping and Starting Your Wiki
When you’re finished using your wiki, invoke the XAMPP Control Panel running in your system tray. Click the Stop button next to Apache, then click the Stop button next to MySql. Once the servers have stopped, click the Exit button. You can now eject your thumb drive as usual. Remember: don’t try to eject your thumb drive before stopping the services; doing so can blue screen your PC and possibly screw up your wiki and server installation.
To start up your wiki at a new computer, plug in your thumb drive, and double-click on the
xampp-control.exe file to start the Control Panel. From there, start the Apache and MySql servers, then visit http://localhost/ to edit your wiki.
Why a personal Wikipedia?
A wiki is an incredible collaborative tool for groups of people, but it’s also a great one-stop shop for your own personal “stuff I want to remember”—like ideas, drafts, lists, and bookmarks. If you haven’t edited Wikipedia or just want to see what MediaWiki can do, here’s a quick demonstration of what writing a novel draft would be like using the software and its special Wikitext markup.
More Portable Web Servers
XAMPP isn’t the only portable web server on the block. Another free portable server package called Server2Go includes Perl 5.8. Thanks, Vijay!
What do you do with your key chain web server? Let us know in the comments.
Gina Trapani, the editor of Lifehacker, likes her web servers tiny and portable. Her weekly feature, Geek to Live, appears every Tuesday on Lifehacker AU.