Wiki on a stick
- This article will be moved out of user-space in a few days (when I've finished transferring my notes).
- These instructions should now be functional, but they need to be re-tested. See #To be done.
- While some sections will probably be split out to other pages later, #Requirements, #Licensing and #Security considerations should remain on the procedure page, at least in summary.
- Please leave any feedback on this article's talk page [1] for now.
- Goals: 1. One article to provide a quick and easy procedure to install MediaWiki on as many versions of Windows as possible. 2. To allow the installation to be portable on a small and inexpensive device. 3. To allow the optional features of MediaWiki to be enabled later.
A wiki and required web and database servers can be installed, configured and running under various versions of Windows in 10 minutes (with practice and on a good day) after downloading 2 files totalling 7MB in size and following the procedure.
Because the installed and configured software and databases use less than 21MB of storage, everything fits on a 32MB memory card, 32MB USB flash drive, PCMCIA/PC Card/CardBus disk, or other portable media. Having the wiki on a stick is useful for demonstrations, sophisticated note-taking, or super-fast installations using a simple copy. N.B. Always stop the servers and use the system tray "unplug/eject" icon to stop the media before removing it!
Procedure
This procedure installs the main components needed to run MediaWiki on Windows. See #Requirements before starting, and if you have problems see #Troubleshooting & support.
Download
1. | Uniform Server | v3.2 | 3,808,846 bytes | http://prdownloads.sourceforge.net/miniserver/UniServer3_2.exe?download |
2. | MediaWiki | v1.3.3 | 1,648,692 bytes | http://prdownloads.sourceforge.net/wikipedia/mediawiki-1.3.3.tar.gz?download |
Install the servers
- Run
UniServer3_2.exe
. This extracts the actual installation and will ask for a destination folder - i.e. do not unpack to a temp folder. It creates a sub-folder called "UniServer3_2
", which can be renamed now or any time later (as long as the servers are not running). Beneath this folder is a folder called "diskw
", which is the top of the folder tree that will be become a drive letter.
- (The installation's default MySQL password for the "
root
" user is "root
", which will be used in this procedure.)
Configure the servers
- If it is not already there, create a sub-folders under
diskw
called "tmp
". - Open the file
diskw\usr\local\Apache2\conf\httpd.conf
in any text editor (e.g. notepad): - Apache has 250 threads by default - reduce to 16 for lighter testing (search for "
ThreadsPerChild
" in the file) - Change "
Listen 80
" to "Listen 127.0.0.1:80
" - this restricts access to the local computer (which can be referred to as "localhost
") - Save and close the file
Install the wiki
- Unpack the MediaWiki zip file under the sub-folder
diskw\www
. (One free tool to unpack zip files is 7-zip.) - The unpacking creates a sub-folder called "
mediawiki-1.3.3
", which should be renamed. (These instructions will use the folder name "wi
" as an example.)
Configure the wiki
Initial wiki configuration
start.bat
needs an unused drive letter. These instructions use w
.
- Start both the web and database servers:
start.bat w mysql
- In your webbrowser, open
localhost/wi/config/index.php
[2]- Fill out the form and note:
- If you use lower-case for the first letter of the site name, it will be capitalised on most of the wiki pages
- "MySQL server" is
localhost
- "DB root password" is
root
- Press the "Install!" button. This writes the file
diskw\www\wi\LocalSettings.php
and creates thewikidb
database, with one initial user (WikiSysop
). An empty page is displayed (probably due to a bug in this procedure or a wiki script) where a 1.3 install success page is expected ...
- Fill out the form and note:
- In your webbrowser, open
localhost/a/uniconfig.php
[3]- Set
register_globals
from "On
" to "Off
" & press "Save" - Click "Back to main page"
- Click "Shut-down the server"
- Set
- From
diskw\usr\bin
, run:perl.exe -e "while (<>) {s/\r$//;print $_;}" <..\..\www\wi\config\LocalSettings.php >..\..\www\wi\LocalSettings.php
(The perl
command above copies the file LocalSettings.php
up one level from "diskw\www\wi\config
" to "diskw\www\wi
", and removes a bug with line-feeds at the same time.)
Optional wiki features
These can also be configured later.
Before editing configuration files:
- Stop the servers
- Make backup copies of the configuration files
Uploads
Uploads are disabled by default. To enable them:
- Open
diskw\www\wi\LocalSettings.php
in any text editor (e.g. notepad) - Find "
$wgDisableUploads
", and remove the "#
" in front of it - Save and close the file
If you do not have a SMTP server running on the local computer, pages that email will display an error. To use another SMTP server:
- Get the name or IP address of the SMTP server on your LAN or at your ISP
- Open
diskw\usr\local\Php\php.ini
in any text editor (e.g. notepad) - Change the SMTP server from "
localhost
" to the name of the actual SMTP server - Optionally change "
sendmail_from = me@localhost.com
" to use an actual email address for receiving bounces from inter-user email - Save and close the file
Default skin
To set a different default skin:
- Open
diskw\www\wi\LocalSettings.php
in any text editor (e.g. notepad) - Find "
$wgDefaultSkin
", and remove the "#
" in front of it, and change "monobook
" to "standard
" (or "cologneblue
" or "nostalgia
") — see #Software limitations - Save and close the file
Tidy up
- Start the servers again:
start.bat w mysql
- It's should now be working, but these next steps can be done immediately.
- In your webbrowser, open
localhost/wi/index.php?title=Special:Userlogin
[4]- Login as
WikiSysop
- Login as
- In your webbrowser, open
localhost/wi/index.php?title=MediaWiki:Sitesubtitle&action=edit
[5]- Edit the sub-title (keep it short)
- Press the "Save" button.
- In your webbrowser, open
localhost/wi/index.php?title=Help:Editing&action=edit
[6]- Type (or copy & paste):
#REDIRECT [[MetaWikiPedia:Help:Editing]]
- Press the "Save" button
- Type (or copy & paste):
- In your webbrowser, open
localhost/wi/index.php?title=Help:Contents&action=edit
[7]- Type (or copy & paste):
#REDIRECT [[MetaWikiPedia:Help:Contents]]
- Press the "Save" button
- Type (or copy & paste):
- If you didn't choose GFDL as the license during wiki configuration, open
localhost/wi/index.php?title=MediaWiki:Copyrightwarning&action=edit
[8]- Edit the page to match the license
- Press the "Save" button
Other pages to edit soon
These empty pages are already linked to from other pages, so they should be edited soon.
localhost/wi/index.php?title=About&action=edit
[9]localhost/wi/index.php?title=FAQ&action=edit
[10]localhost/wi/index.php?title=General_disclaimer&action=edit
[11]localhost/wi/index.php?title=Bug_reports&action=edit
[12]localhost/wi/index.php?title=Current_events&action=edit
[13]localhost/wi/index.php?title=Copyrights&action=edit
[14]localhost/wi/index.php?title=Main_page&action=edit
[15]- You may want to add a sandbox to assist new users ...
Components
See also: #Licensing
Uniform Server v3.2
Uniform Server v3.2 is a quick, easy and small installation containing the servers and platform software for MediaWiki. It includes:
- web-server Apache 2 (v2.0.50)
- scripting engine PHP 5 (v5.0.0) with libraries (inc. zlib v1.1.4, libxml2 v2.5.11, iconv v1.9) and extensions (sockets, mysql v3.23.57, GD2 v2.0.23-compatible inc. freetype v2.1.5)
- database administration phpMyAdmin (v2.6.0-beta2)
- databaser server MySQL 4 (v4.0.20d according to Uniform Server v3.2 documentation, but v4.0.20a according to MediaWiki and
mysqladmin.exe
) - command scripting ActiveState Perl 5 (v5.8.4.810)
MediaWiki v1.3.3
MediaWiki v1.3.3 is the same wiki software seen here, and consists of PHP web scripts and libraries (including PHPTAL and optional memcached support), and a database schema, data, and interfaces.
Requirements
These are the requirements and related work-arounds for this procedure.
Windows
This procedure may work on any 32-bit/64-bit Windows, but initial testing of this procedure has only been done on Windows 2000 SP4. Exceptions and any work-arounds are:
- Windows 95
- Ensure that the latest TCP/IP update (winsock2) has been applied.
If you are using USB removable media, Windows 95 needs to be the OSR2 edition, and may need extra drivers. - Windows 98
- If you are using USB removable media, extra media drivers may be needed.
- Windows NT 4
- Possible server-control problem [16].
For non-Windows operating systems, see Help:Installation#Platform-specific install instructions.
Disk space
- 7MB for the downloads
- 21MB for the initial installation and configuration
- Additional space as the wiki database grows with submissions
Drive letter
This procedure assumes that the drive letter w:
is unused. Otherwise use a different unused letter where you see the letter w
.
HTTP TCP port
This procedure assume that the HTTP TCP port (80) is unused. To check, run: netstat.exe -p TCP -n -a|find.exe ":80 "|find.exe "LISTEN"
If the output shows 0.0.0.0:80
or 127.0.0.1:80
, you need to either stop the current web server or use a different TCP port in this procedure. See #How to access the wiki from other computers.
No other Apache.exe
If another Apache is installed and running on the same computer, with the exact name "Apache.exe", then:
- Rename
Apache.exe
in the folderdiskw\usr\local\Apache2\bin\
toApacheW.exe
- Change "
Apache.exe
" to "ApacheW.exe
" inside these files:start.bat
(2),stop.bat
(1),diskw\home\admin\CGI\shutdown.cgi
(1)
Troubleshooting & support
Troubleshooting & support resources
- These log files may contain clues if errors seem to be happening:
diskw\usr\local\Apache2\logs\error.log
diskw\usr\local\mysql\data\<computer_name>.err
diskw\usr\local\Apache2\logs\access.log
- PHP can be configured to log errors. Edit
diskw\usr\local\Php\php.ini
:- set "
log_errors = On
" - set "
error_log = "w:\usr\local\Php\PHPerrors.log"
" - to include "notice"-level logging, set "
error_reporting = E_ALL
"
- set "
- MediaWiki can be configured to log errors ...
- There is a formal user guide
- There are MediaWiki mailing lists with archives
irc.freenode.net
has an IRC channel called#mediawiki
.
How to throw away the wiki and start again
- In your webbrowser, open
localhost/a/phpMyAdmin-2.6.0-beta2/db_details_structure.php?lang=en-iso-8859-1&server=1&db=wikidb
[17] - Click the "Drop" tab to remove the selected wikidb database
- Stop the database server using
localhost/a-cgi/mysqlstop.cgi
[18] - Delete
LocalSettings.php
from thediskw\www\wi
sub-folder - Follow the instructions again from #Configure MediaWiki
How to throw it all away and start again
- Stop the servers using
localhost/a/stop.html
[19] - Delete the top folder
- Follow the instructions again from #Install UniformServer
Limitations
Software limitations
- No monobook skin, as MediaWiki automatically disables it due to its included PHPTAL library being incompatible with Uniform Server's included PHP v5
- No maths markup, due to lack of texvc, LaTeX, dvips, and ImageMagick software
- Image resizing may not support certain formats, due to lack of ImageMagick software (but png, jpg and even gif formats should be okay)
Procedure limitations
- The servers only run while you are logged-in
Other limitations
- Running the wiki from portable writable media, while convenient, is slow.
Security considerations
The procedure only allows access to the web-server from the local machine. Once this changes, other aspects need to be considered for security.
Wiki security model
... overview & links ...
Types of users
- Anonymous
- ...
- Registered
- ... The initial
WikiSysop
user has the user rightssysop
andbureaucrat
. For more information on user rights, see Setting user rights in MediaWiki.
Wiki access
- Connecting to the wiki
- ...
- Reading the wiki
- ...
- Becoming a registered user
- ...
- Editing the wiki
- ...
- Special privileges (e.g. deletion)
- ...
Wiki access models
Combining the types of user and types of access gives a security policy or access model. Common examples are: ...
Privacy
- Internet
- ... server certificates, caches ...
- Web browser
- ... cookies, cache, history, auto-completion, passwords ...
Servers
... httpd IP address and port, mysql IP address ...
General
... mention firewalls/NAT/packet-filters, passwords, config folder, test database ...
How to access the wiki from other computers
... httpd.conf ... edit files ...
Multiple wikis
...
Internationalisation
... phpAdmin, multiple wikis ...
Licensing
Despite the variety of licenses, all components can be copied, modified, installed and run for free for private, public or corporate use. Source code is freely available for all binary components. Restrictions may apply if you wish to claim ownership of, sell, or relicense the components. Read the licenses for the actual terms.
- Uniform Server v3.2: BSD-revised-style license
- ActiveState Perl 5.8.0.810: ActiveState Community License
- Perl 5: choose one of the Artistic License or the GNU General Public License (GPL v2)
- Apache v2.0.50: Apache License v2.0.
- MySQL 4.0.20d: GPL v2
- PHP 5 v5.0.0: PHP License v3.0
- Zend Engine 2: Zend Engine License v2.00
- phpAdmin v2.6.0-beta2: GPL v2
- FPDF v1.51: "freeware" (public ___domain)
- PHPFM v0.2.3 (plugin): GPL v2
- go-pear v1.57 (plugin): choose one version of these PHP Licenses: v2.0 or v3.0
- blowfish (library): GNU Library General Public License
- profiling (library): Mozilla Public License (MPL) (the version does not seem to be specified, and could be v1.0 or v1.1)
- ActiveState Perl 5.8.0.810: ActiveState Community License
- MediaWiki v1.3.3: GPL v2
- PHPTAL-NP-0.7.0: GNU Lesser General Public License v2.1 (GLGPL)
- pear v1.1: PHP License v2.0
Also, some documentation-type files may be covered by the GNU Free Documentation License (GFDL) v1.1 or v1.2. Some library-type files may be covered by a GLPL: GNU Library General Public License or GNU Lesser General Public License. Some library files do not contain license information, some of which do contain copyright notices and/or attributions.
To be done
- Re-test final procedure again
- Report the MediaWiki
LocalSettings.php
CR-CR-LF line-feed problem in config\index.php, so that we don't need the workaround in late releases. - Document how to change MySQL's listening addresses
- Document how to change MySQL's root password
- Complete ...
- Test from a read-only image, e.g. CD-ROM
- Help fix monobook/PHPTAL incompatibiliy with PHP 5.
- Can the "tidy" MediaWiki feature be enabled within this article's goals?
- Create sourceforge project to contain link to these instructions and pre-built configuration files for further setup speed
- Reduce storage usage to less than:
- 20MB to fit on an Iomega Bernoulli Box floppy disk
- 16MB to fit on a smaller memory card / USB stick