Option to hide IP addresses in page header so can use file page cache
[mediawiki.git] / INSTALL
blob9efed0c05f17073f921c1107e6fecde79a9b2e0f
1 ----
2 Installing Wikipedia Phase III Software
3 ----
5 The Wikipedia software was developed collabortively 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. The test suite is
11 written in Java, using several external libraries.
13 Recommended versions are: Apache 1.3.26 or later; MySQL
14 2.23.51 or later; PHP 4.2.2 or later. The installation at
15 wikipedia.org also uses the APC caching software, but
16 that's entirely optional and doesn't affect anything else.
18 The math rendering functions are more complex, and will
19 probably only work on Linux. Objective CAML (probably
20 3.06 or later) is required to compile texvc, but produces
21 static binaries. TeTeX and ImageMagick are required at
22 runtime, and ImageMagick requires GhostScript. These are
23 present in most Linux distributions.
25 ----
26 Scripts install.php and update.php
27 ----
29 Before installing the software, you must copy the file
30 "LocalSettings.sample" to "LocalSettings.php", and
31 "AdminSettings.sample" to "AdminSettings.php", and
32 customize both of the php files to your local setup
33 (things like installation parh, passwords, etc.) The
34 script install.php can then be run to install the
35 software. It must be run from the command line with
36 PHP: that is, type "php install.php" (you may need to
37 specify the path the php executable). You will probably
38 need to run as root.
40 This script will copy all the necessary software over to
41 the directories you have specified in the settings files.
42 It will then warn you that it is about to create the
43 database and give you the chance to exit. If you are
44 installing the software to an existing database, you can
45 answer "no" here and it will be left alone. The software
46 installation will be otherwise complete. If you do choose
47 to create a new database, you will need te root password
48 to your MySQL installation.
50 If you are merely updating an existing installation, run
51 "php update.php" instead of install.  This will copy all
52 the software, and also run any dtabase updates that may
53 be necessary. These should give appropriate warnings if
54 there are any dangerous ones.
56 ----
57 Building from scratch
58 ----
60 Here are some more notes on building a system from scratch
61 the way it was done for the Wikipedia server:
63 Downloads:
65   gcc-2.95.3.tar.gz
66   mysql-3.23.51.tar.gz (or 4.0.12)
67   libiconv-1.8.tar.gz
68   apache_1.3.26.tar.gz
69   php-4.3.1.tar.gz
70   apc-cvs.tar.gz
72 And for math support:
73   ocaml-3.06.tar.gz
74   (TeTeX, ImageMagick, and GhostScript come with most Linux distros)
76 1. MySQL strongly recommends using gcc 2.95 to compile MySQL.
77   RedHat Linux comes with 2.96 by default, so you'll have to install
78   2.95 first.  Use "../gcc*/configure --enable-shared"  If your Linux
79   installation doesn't use gcc 2.96 you can skip this step.
81 2. Install MySQL source; add "mysql" user and group. Make sure the
82   directory into which you installed gcc 2.95 appears before the
83   directory of gcc 2.96 in your path.  Configure with:
85   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
87   Edit the file myisam/ftdefs.h, changing the define for minimum word
88   length for fulltext indexing: #define MIN_WORD_LEN 2.  Update
89   $wgDBminWordLen in LocalSettings.php to reflect this.  Build and
90   install according to instructions.  Make root user as recommended;
91   the root password will be required for the wiki installation script.
93 3. Unpack the phase3.zip source distribution, or check out the "phase3"
94   module from CVS. Copy LocalSettings.sample to LocalSettings.php,
95   AdminSettings.sample to AdminSettings.php, and customize them for
96   things like local paths and passwords.  If desired, update
97   FulltextStoplist.php from the MySQL sources if you have customized
98   MySQL's stop list.
100 4. Optionally, install libiconv (http://www.gnu.org/software/libiconv/).
101   This will be used by some language packages for converting
102   native-charset URLs to and from UTF-8. If you're running an
103   English-only wiki, this won't be necessary.
105 5. Unpack Apache distribution and begin configuring, but don't finish
106   build yet. Configure with something like:
108    OPTIM='-O2 -mcpu=i686' ./configure --with-layout=Apache
110 6. If you'll want to use Apache's mod_rewrite to make page-viewing URLs
111   look like static links (as wikipedia.org does), install the included
112   patch "apache-ampersand.diff" which is needed to support page titles
113   with ampersands in them:
115    patch -p0 < /path/to/maintenance/apache-ampersand.diff
117 7. Unpack and configure PHP. Configure with something like:
119   ./configure --enable-apc --enable-shmop --with-mysql=/usr/local/mysql --with-iconv=/usr/local/lib --with-apache=/home/lee/src/apache_1.3.26
121   (using your own local paths, of course). Build and install as
122   instructed. Set "register_globals" on in the config file.
124 8. Finish building Apache. Configure with something like:
126   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
128   Update httpd.conf as needed for your site.  For example:
130   <IfModule mod_php4.c>
131     AddType application/x-httpd-php .php .php4 .phtml
132     AddType application/x-httpd-php-source .phps
133   </IfModule>
134   <IfModule mod_php4.c>
135     php_admin_flag engine off
136   </IfModule>
137   <Directory "DIRECTORY_OF_WIKI_SCRIPTS">
138     <IfModule mod_php4.c>
139       php_admin_flag engine on
140     </IfModule>
141   </Directory>
142   RewriteEngine On
143   RewriteMap ampescape int:ampescape
144   RewriteRule ^/wiki/(.*)$ /wiki.phtml?title=${ampescape:$1} [L]
146   It is *seriously* recommended that you configure the webserver
147   to disable running of PHP scripts except in the script directories
148   (the "php_admin_flag engine off/on" directives above) to prevent
149   the uploading and running of malicious scripts.
151 9. Optionally, install APC, following standard instructions for
152   installing as a Zend extension.
154 10. If using embedded TeX support, be sure TeX and ImageMagick are
155   installed (they are common on most Linux distros and freely
156   downloadable). Also get and install OCaml according to its
157   instructions.
159   You'll need to compile the texvc helper script; enter the math
160   subdirectory of the source tree and run "make".
162   If you want embedded TeX support, enable it by setting
164    $wgUseTex = true;
166   in LocalSettings.php
168 11. You should now be able to run the install.php script. Use PHP in
169   command-line mode, i.e., type "php install.php". Should be run as
170   root, or as a user or group able to create files and directories
171   in the installation tree.
173 12. If you have Java installed and running, install the "ant" package
174   from Apache (http://ant.apache.org/) and run ant in the testsuite
175   directory to build the tests. Copy wikitest.prefs.sample to
176   wikitest.prefs, and edit to reflect your local settings.  Then
177   "./run WikiSuite -o -b" will run the whole test suite and report.
179 ----
181 Don't forget that this is pre-release software under development!
182 Chances are good there's a crucial step that hasn't made it
183 into the documentation. You should probably sign up for the
184 Wikipedia developers' mailing list; you can ask for help (please
185 provide enough information to work with, and preferably be aware
186 of what you're doing!) and keep track of major changes to the
187 software, including performance improvements and security patches.
189 http://www.wikipedia.org/mailman/listinfo/wikitech-l