2 Installing Wikipedia Phase III Software
5 The Wikipedia software was developed collaboratively by
6 many people, so it's something of a hodgepodge. The
7 main wiki software itself is written in PHP, and requires
8 the Apache web server and MySQL database. The optional
9 math rendering functions are written in Objective CAML,
10 which is required to compile them.
12 Recommended versions are: Apache 1.3.27 or later; MySQL
13 4.0.13 or later; PHP 4.3.2 or later. The installation at
14 wikipedia.org also uses PHP Accelerator software, but
15 that's entirely optional and doesn't affect anything else.
17 The math rendering functions are more complex, and will
18 probably only work on Linux. Objective CAML (probably
19 3.06 or later) is required to compile texvc, but produces
20 static binaries. TeTeX and ImageMagick are required at
21 runtime, and ImageMagick requires GhostScript. These are
22 present in most Linux distributions.
25 Scripts install.php and update.php
28 Before installing the software, you must copy the file
29 "LocalSettings.sample" to "LocalSettings.php", and
30 "AdminSettings.sample" to "AdminSettings.php", and
31 customize both of the php files to your local setup
32 (things like installation path, passwords, etc.) The
33 script install.php can then be run to install the
34 software. It must be run from the command line with
35 PHP: that is, type "php install.php" (you may need to
36 specify the path the php executable). You will probably
39 Hint: If you are using Debian, the PHP interpreter is
40 not part of the "php4" package; you need to install
41 php4-cgi separately (the interpreter will be called
44 This script will copy all the necessary software over to
45 the directories you have specified in the settings files.
46 It will then warn you that it is about to create the
47 database and give you the chance to exit. If you are
48 installing the software to an existing database, you can
49 answer "no" here and it will be left alone. The software
50 installation will be otherwise complete. If you do choose
51 to create a new database, you will need te root password
52 to your MySQL installation.
54 If you are merely updating an existing installation, run
55 "php update.php" instead of install. This will copy all
56 the software, and also run any database updates that may
57 be necessary. These should give appropriate warnings if
58 there are any dangerous ones.
64 Here are some more notes on building a system from scratch
65 the way it was done for the Wikipedia server:
69 gcc-2.95.3.tar.gz (only if you now have gcc 2.96)
70 mysql-4.0.13.tar.gz (or 3.23.57 should work)
77 ocaml-3.06.tar.gz (3.04 doesn't work)
78 (TeTeX, ImageMagick, and GhostScript come with most Linux distros)
80 1. MySQL strongly recommends using gcc 2.95 to compile MySQL.
81 RedHat Linux 7.x comes with 2.96 by default, so you'll have to install
82 2.95 first. Use "../gcc*/configure --enable-shared" If your Linux
83 installation doesn't use gcc 2.96, or has a more recent gcc 3.x,
84 you can skip this step.
86 2. Install MySQL source; add "mysql" user and group. Make sure the
87 directory into which you installed gcc 2.95 appears before the
88 directory of gcc 2.96 in your path. Configure with:
90 FLAGS="-O3 -mcpu=i686" CXX=gcc CXXFLAGS="-O3 -mcpu=i686 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --disable-shared --with-extra-charset=complex
92 Edit the file myisam/ftdefs.h, changing the define for minimum word
93 length for fulltext indexing: #define MIN_WORD_LEN 2. Update
94 $wgDBminWordLen in LocalSettings.php to reflect this. Build and
95 install according to instructions. Make root user as recommended;
96 the root password will be required for the wiki installation script.
98 3. Unpack the phase3.zip source distribution, or check out the "phase3"
99 module from CVS. Copy LocalSettings.sample to LocalSettings.php,
100 AdminSettings.sample to AdminSettings.php, and customize them for
101 things like local paths and passwords. If desired, update
102 FulltextStoplist.php from the MySQL sources if you have customized
105 If you are running anything other than Wikipedia itself you'll want
106 to make a lot of changes to the LanguageXX.php files so it talks about
107 _your_ site and _your_ license. :)
109 4. Optionally, install libiconv (http://www.gnu.org/software/libiconv/).
110 This will be used by some language packages for converting
111 native-charset URLs to and from UTF-8. If you're running an
112 English-only wiki, this probably won't be necessary. (Most Linux
113 distributions should come with libiconv anyway, but check for
114 a separate 'dev' package if on RedHat.)
116 5. Unpack Apache distribution and begin configuring, but don't finish
117 build yet. Configure with something like:
119 OPTIM='-O2 -mcpu=i686' ./configure --with-layout=Apache
121 6. If you'll want to use Apache's mod_rewrite to make page-viewing URLs
122 look like static links (as wikipedia.org does), install the included
123 patch "apache-ampersand.diff" which is needed to support page titles
124 with ampersands in them:
126 patch -p0 < /path/to/maintenance/apache-ampersand.diff
128 7. Unpack and configure PHP. Configure with something like:
130 ./configure --enable-shmop --with-zlib --with-zlib-dir=/usr/lib --with-mysql=/usr/local/mysql --with-iconv --with-apache=/home/lee/src/apache_1.3.26 --with-readline --enable-sockets
132 Or for Apache 2.0 module:
133 ./configure --enable-shmop --with-zlib --with-zlib-dir=/usr/lib --with-mysql=/usr/local/mysql --with-iconv --with-apxs2filter=/usr/local/apache/bin/apxs --with-readline --enable-sockets
135 (using your own local paths, of course). Build and install as
136 instructed. Set "register_globals" on in the config file, and
139 8. Finish building Apache. Configure with something like:
141 OPTIM='-O2 -mcpu=i686' ./configure --with-layout=Apache --enable-module=rewrite --enable-module=mmap-static --enable-module=headers --enable-module=expires --activate-module=src/modules/php4/libphp4.a
143 Update httpd.conf as needed for your site. For example:
145 <IfModule mod_php4.c>
146 AddType application/x-httpd-php .php .php4
147 AddType application/x-httpd-php-source .phps
149 <IfModule mod_php4.c>
150 php_admin_flag engine off
152 <Directory "DIRECTORY_OF_WIKI_SCRIPTS">
153 <IfModule mod_php4.c>
154 php_admin_flag engine on
158 RewriteMap ampescape int:ampescape
159 RewriteRule ^/wiki/(.*)$ /index.php?title=${ampescape:$1} [L]
161 It is *seriously* recommended that you configure the webserver
162 to disable running of PHP scripts except in the script directories
163 (the "php_admin_flag engine off/on" directives above) to prevent
164 the uploading and running of malicious scripts.
166 9. Optionally, install APC or another PHP cache plug-in, following
167 standard instructions for installing as a Zend extension.
169 10. If using embedded TeX support, be sure TeX and ImageMagick are
170 installed (they are common on most Linux distros and freely
171 downloadable). Also get and install OCaml according to its
174 You'll need to compile the texvc helper script; enter the math
175 subdirectory of the source tree and run "make".
177 If you want embedded TeX support, enable it by setting
183 11. You should now be able to run the install.php script. Use PHP in
184 command-line mode, i.e., type "php install.php". Should be run as
185 root, or as a user or group able to create files and directories
186 in the installation tree.
188 12. If you have Java installed and running, install the "ant" package
189 from Apache (http://ant.apache.org/) and run ant in the testsuite
190 directory to build the tests. Copy wikitest.prefs.sample to
191 wikitest.prefs, and edit to reflect your local settings. Then
192 "./run WikiSuite -o -b" will run the whole test suite and report.
196 Don't forget that this is pre-release software under development!
197 Chances are good there's a crucial step that hasn't made it
198 into the documentation. You should probably sign up for the
199 Wikipedia developers' mailing list; you can ask for help (please
200 provide enough information to work with, and preferably be aware
201 of what you're doing!) and keep track of major changes to the
202 software, including performance improvements and security patches.
204 http://mail.wikipedia.org/mailman/listinfo/wikitech-l