MediaWiki on a stick with WOS (Webserver on Stick)
By
Eric Hartwell - last
updated
April 7, 2006- Published on WikiMedia Meta-Wiki, April 7, 2006: Wiki on a stick with WOS (Webserver on Stick)
You can configure a Windows Wiki on a stick using WOS Portable from CH Software instead of Uniform Server. WOS Portable does not need an extra drive letter and it is ready to run instantly after unzipping; just plug a USB stick in any Windows computer and the wiki webserver starts up in your browser.
WOS packages a complete Apache/PHP/MySQL webserver with a wrapper that automatically configures and starts the servers; the Small Edition takes only 20 Mb. It is published under the GNU GPL.
The complete package with MediaWiki 1.6.1, WOS Portable SE 1.1.1, Apache 2.0.5, PHP 5.1.2 (and 4.4.1), and MySQL 4.1.18-nt - all free, open source software - occupies less than 60Mb with an empty wiki.
Installation
For best results you should always install and run WOS from the root directory of a drive. The first time it's run, WOS configures the paths for the servers based on the current directory. Each time it's started after that, it changes the drive only, so it's a pain to change directories later.
- Start by downloading the latest versions of MediaWiki and WOS Portable or WOS Portable Small Edition.
- Select the drive for installation. If you'd like to
install to your hard disk, you can create a virtual disk
using the subst command:
subst W: "C:\Temp\MyWikiOnAStick" - Switch to your target drive and unzip the distribution
files. Unzip WOS into the root directory, and MediaWiki into
a subdirectory of www. It's convenient to rename the
subdirectory to "wiki". The configuration I'm working with
looks like this:
W:\
W:\apache2
W:\mysql
W:\php4
W:\php5
W:\www
W:\www\wiki - The default for the apache web server is to listen on
port 80 of the host machine. This is likely to cause
problems if there's an existing server on your target
machine. To change the port number, open the file
apache2\conf\httpd.conf in a text editor like notepad.
- Search for the line that says
Listen 80and change it toListen 127.0.0.1:8080. - Search for the line that says
ServerName localhost:80and change it toServerName 127.0.0.1:8080
-
IANA Port Numbers:
- 80: World Wide Web (HTTP)
- 8080: HTTP Alternate
- 443: HTTP protocol over TLS/SSL (HTTPS)
- 49152 through 65535: Dynamic and/or Private Ports
- 1024 through 49151 should not be used on the Internet without IANA registration.
- Search for the line that says
- Run "start.exe" from the root directory.
- Choose your language, then click through the Terms of Use (which is actually small enough to fit on a dialog box without scrolling!)
- WOS starts up and displays the WOS Portable - Status
dialog. You should see:
Apache is running
MySQL is running - WOS will open the welcome page in your web browser.
If you changed the port number as recommended above, you'll get a 404: Not Found error. Don't worry.- Open the WOS Portable Options tab and change the
value for "Use the following URL in the browser"
from
http://localhost/start/tohttp://localhost:8080/start/(or whatever port you assigned above). - You can either shut down and restart WOS or just copy the address to your browser.
- You should now see the WOS startup page.
Apache 2.0.55 is running
PHP 5.1.2 works
MySql 4.1.18-nt is running
Document Root is: W:/www
- Open the WOS Portable Options tab and change the
value for "Use the following URL in the browser"
from
- Review the other WOS options; most of the defaults work
fine for MediaWiki, except:
- You must clear the
Delete InnoDB log and tempfiles after stopping WOScheckbox, or putCleanInnoDB=falsein wos.ini.
- You must clear the
- Shut down and restart WOS:
- Click End, then wait until it closes.
- Run "start.exe" and verify that it starts up properly.
- Run MediaWiki web configuration. Using the directory and
port settings above, the address is
http://localhost:8080/wiki/config.
- If you want to use a Creative Commons license, you should select it first. Scroll down to the Copyright/license section, click on Creative Commons license - choose, and select your license.
- Fill in the site config information
- Name your wiki
- Assign a WikiSysop password
- You can disable all the email options for a tiny wiki
- Assign a wikiuser password for the Database config
- By default, WOS runs with the superuser account root with no password. If you've changed the root password, enter it here; otherwise, clear the Superuser password.
- Click Install MediaWiki! After a short delay you should see the MediaWiki 1.6.1 Installation success screen.
- Move the W:\www\wiki\config\LocalSettings.php file to W:\www\wiki
- Click on "then follow this link to your wiki" and
after a short delay you should see the MediaWiki home
page.
- Open the WOS Portable Options tab and change the
value for "Use the following URL in the browser"
from
http://localhost:8080/start/tohttp://localhost:8080/wiki/(or whatever port and directory you assigned above).
- Open the WOS Portable Options tab and change the
value for "Use the following URL in the browser"
from
-
You're
not quite done yet. If there's any problem with any of the
configuration files (especially if you moved the WOS
directory), MediaWiki will behave normally, but the data may
be lost when you shut the server down.
- Shut down WOS - click End, then wait until it closes.
- Run "start.exe" from the root directory.
- If you see the MediaWiki home page, you're done.
Troubleshooting
WOS Portable is freeware, and there is no official support.
Here's how to deal with some of the ways I've messed up the installation:
- Verify the paths in the configuration files
apache2\conf\httpd.confandmysql\my.ini. If you changed the WOS directory, then some of the paths may be pointing to the old directory. Changing the drive only is OK. - If you see an error message like
A database error has occurred ... Can't open file: 'user.ibd',
make sure you have cleared the WOS Portable OptionsDelete InnoDB log and tempfiles after stopping WOScheckbox. If it isn't cleared, you'll need to rebuild the MediaWiki database:- Shut down WOS
- Delete the W:\mysql\data\wikidb directory and contents
- Delete or rename W:\www\wiki\LocalSettings.php
- Start WOS again, go to http://localhost:8080/wiki/config, and reinstall the wiki.
- MediWiki should work with both PHP4 and PHP5. Any custom extensions you have may not.
If you still have a problem, try the troubleshooting hints on the WOS Wiki.
Hints
A complete WOS installation with an empty MediaWiki takes about 55Mb. If you're really tight for space, you can delete some files:
- Make a backup of the complete installation first!
- PHP4 is about 4.3Mb and PHP5 is about 3.6Mb. You can delete the one you're not using.
- The MediaWiki languages subdirectory is about 4.25Mb. You can get it down to 150Kb by deleting all of the Language??.php and Messages??.php files you're not using (but don't delete LanguageUtf8.php).
You can (and should!) back up your installation by making a complete copy of the WOS directory tree.
References
- Wiki on a stick
- WOS support wiki
- MediaWiki configuration
- MediaWiki, WOS Portable SE, Apache, PHP, MySQL
Revisions
- April 7, 2006 -
Eric Hartwell - MediaWiki 1.6.1, WOS Portable Small
Edition 1.1.1
Hartwell, Eric (April 7, 2006), Wiki on a stick with WOS (Webserver on Stick). Published on WikiMedia Meta-Wiki, April 7, 2006
