Initial revision
[lhc/web/wiklou.git] / INSTALL
1 The Wikipedia software was developed collabortively by
2 many people, so it's something of a hodgepodge. The
3 main wiki software itself is written in PHP, and requires
4 the Apache web server and MySQL database. The optional
5 math rendering functions are written in Objective CAML,
6 which is required to compile them. The test suite is
7 written in Java, using several external libraries.
8
9 Recommended versions are: Apache 1.3.26 or later; MySQL
10 2.23.51 or later; PHP 4.2.2 or later. The installation at
11 wikipedia.org also uses the APC caching software, but
12 that's entirely optional and doesn't affect anything else.
13
14 The math rendering functions are more complex, and will
15 probably only work on Linux. Objective CAML (probably
16 3.06 or later) is required to compile texvc, but produces
17 static binaries. TeTeX and ImageMagick are required at
18 runtime, and ImageMagick requires GhostScript. These are
19 present in most Linux distributions.
20
21 Before installing the software, you must copy the file
22 "LocalSettings.sample" to "LocalSettings.php", and
23 "AdminSettings.sample" to "AdminSettings.php", and
24 customize both of the php files to your local setup
25 (things like installation parh, passwords, etc.) The
26 script install.php in the maintenance directory can then
27 be run to install the software.
28
29 Here are some more notes on building a system from scratch
30 the way it was done for the Wikipedia server:
31
32 Downloads:
33
34 gcc-2.95.3.tar.gz
35 mysql-3.23.51.tar.gz
36 libiconv-1.8.tar.gz
37 apache_1.3.26.tar.gz
38 php-4.2.1.tar.gz
39 apc-cvs.tar.gz
40
41 And for math support:
42 ocaml-3.06.tar.gz
43 (TeTeX, ImageMagick, and GhostScript come with most Linux distros)
44
45 1. MySQL strongly recommends using gcc 2.95 to compile MySQL.
46 RedHat Linux comes with 2.96 by default, so you'll have to install
47 2.95 first. Use "../gcc*/configure --enable-shared" If your Linux
48 installation doesn't use gcc 2.96 you can skip this step.
49
50 2. Install MySQL source; add "mysql" user and group. Make sure the
51 directory into which you installed gcc 2.95 appears before the
52 directory of gcc 2.96 in your path. Configure with:
53
54 FLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --disable-shared --with-extra-charset=complex
55
56 Edit the file myisam/ftdefs.h, changing the define for minimum word
57 length for fulltext indexing: #define MIN_WORD_LEN 2. Update
58 $wgDBminWordLen in LocalSettings.php to reflect this. Build and
59 install according to instructions. Make root user as recommended;
60 the root password will be required for the wiki installation script.
61
62 3. Unpack the phase3.zip source distribution, or check out the "phase3"
63 module from CVS. Copy LocalSettings.sample to LocalSettings.php,
64 AdminSettings.sample to AdminSettings.php, and customize them for
65 things like local paths and passwords. If desired, update
66 FulltextStoplist.php from the MySQL sources if you have customized
67 MySQL's stop list.
68
69 4. Optionally, install libiconv (http://www.gnu.org/software/libiconv/).
70 This will be used by some language packages for converting
71 native-charset URLs to and from UTF-8. If you're running an
72 English-only wiki, this won't be necessary.
73
74 5. Unpack Apache distribution and begin configuring, but don't finish
75 build yet. Configure with something like:
76
77 OPTIM='-O2 -mpentiumpro' ./configure --with-layout=Apache
78
79 6. If you'll want to use Apache's mod_rewrite to make page-viewing URLs
80 look like static links (as wikipedia.org does), install the included
81 patch "apache-ampersand.diff" which is needed to support page titles
82 with ampersands in them:
83
84 patch -p0 < /path/to/maintenance/apache-ampersand.diff
85
86 7. Unpack and configure PHP. Configure with something like:
87
88 ./configure --enable-apc --with-mysql=/usr/local/mysql --with-iconv=/usr/local/lib --with-apache=/home/lee/src/apache_1.3.26
89
90 (using your own local paths, of course). Build and install as
91 instructed. Set "register_globals" on in the config file.
92
93 8. Finish building Apache. Configure with something like:
94
95 OPTIM='-O2 -mpentiumpro' ./configure --with-layout=Apache --enable-module=rewrite --activate-module=src/modules/php4/libphp4.a
96
97 Update httpd.conf as needed for your site. For example:
98
99 <IfModule mod_php4.c>
100 AddType application/x-httpd-php .php .php4 .phtml
101 AddType application/x-httpd-php-source .phps
102 </IfModule>
103 <IfModule mod_php4.c>
104 php_admin_flag engine off
105 </IfModule>
106 <Directory "DIRECTORY_OF_WIKI_SCRIPTS">
107 <IfModule mod_php4.c>
108 php_admin_flag engine on
109 </IfModule>
110 </Directory>
111 RewriteEngine On
112 RewriteMap ampescape int:ampescape
113 RewriteRule ^/wiki/(.*)$ /wiki.phtml?title=${ampescape:$1} [L]
114
115 It is *seriously* recommended that you configure the webserver
116 to disable running of PHP scripts except in the script directories
117 (the "php_admin_flag engine off/on" directives above) to prevent
118 the uploading and running of malicious scripts.
119
120 9. Optionally, install APC, following standard instructions for
121 installing as a Zend extension.
122
123 10. If using embedded TeX support, be sure TeX and ImageMagick are
124 installed (they are common on most Linux distros and freely
125 downloadable). Also get and install OCaml according to its
126 instructions.
127
128 You'll need to compile the texvc helper script; enter the math
129 subdirectory of the source tree and run "make".
130
131 If you don't want embedded TeX support, disable it by setting
132
133 $wgUseTex = false;
134
135 in LocalSettings.php
136
137 11. You should now be able to run the install.php script. Use PHP in
138 command-line mode, i.e., type "php install.php". Should be run as
139 root, or as a user or group able to create files and directories
140 in the installation tree.
141
142 12. If you have Java installed and running, install the "ant" package
143 from Apache (http://ant.apache.org/) and run ant in the testsuite
144 directory to build the tests. Copy wikitest.prefs.sample to
145 wikitest.prefs, and edit to reflect your local settings. Then
146 "./run WikiSuite -o -b" will run the whole test suite and report.
147
148 ----
149
150 Don't forget that this is pre-release software under development!
151 Chances are good there's a crucial step that hasn't made it
152 into the documentation. You should probably sign up for the
153 Wikipedia developers' mailing list; you can ask for help (please
154 provide enough information to work with, and preferably be aware
155 of what you're doing!) and keep track of major changes to the
156 software, including performance improvements and security patches.
157
158 http://www.wikipedia.org/mailman/listinfo/wikitech-l
159