updates
[lhc/web/wiklou.git] / INSTALL
1 ----
2 Installing Wikipedia Phase III Software
3 ----
4
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.
12
13 Recommended versions are: Apache 1.3.27 or later; MySQL
14 4.0.13 or later; PHP 4.3.2 or later. The installation at
15 wikipedia.org also uses PHP Accelerator software, but
16 that's entirely optional and doesn't affect anything else.
17
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.
24
25 ----
26 Scripts install.php and update.php
27 ----
28
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.
39
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.
49
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.
55
56 ----
57 Building from scratch
58 ----
59
60 Here are some more notes on building a system from scratch
61 the way it was done for the Wikipedia server:
62
63 Downloads:
64
65 gcc-2.95.3.tar.gz (only if you now have gcc 2.96)
66 mysql-4.0.13.tar.gz (or 3.23.57 should work)
67 libiconv-1.8.tar.gz
68 apache_1.3.27.tar.gz
69 php-4.3.2.tar.gz
70 apc-cvs.tar.gz
71
72 And for math support:
73 ocaml-3.06.tar.gz
74 (TeTeX, ImageMagick, and GhostScript come with most Linux distros)
75
76 1. MySQL strongly recommends using gcc 2.95 to compile MySQL.
77 RedHat Linux 7.x 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, or has a more recent gcc 3.x,
80 you can skip this step.
81
82 2. Install MySQL source; add "mysql" user and group. Make sure the
83 directory into which you installed gcc 2.95 appears before the
84 directory of gcc 2.96 in your path. Configure with:
85
86 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
88 Edit the file myisam/ftdefs.h, changing the define for minimum word
89 length for fulltext indexing: #define MIN_WORD_LEN 2. Update
90 $wgDBminWordLen in LocalSettings.php to reflect this. Build and
91 install according to instructions. Make root user as recommended;
92 the root password will be required for the wiki installation script.
93
94 3. Unpack the phase3.zip source distribution, or check out the "phase3"
95 module from CVS. Copy LocalSettings.sample to LocalSettings.php,
96 AdminSettings.sample to AdminSettings.php, and customize them for
97 things like local paths and passwords. If desired, update
98 FulltextStoplist.php from the MySQL sources if you have customized
99 MySQL's stop list.
100
101 If you are running anything other than Wikipedia itself you'll want
102 to make a lot of changes to the LanguageXX.php files so it talks about
103 _your_ site and _your_ license. :)
104
105 4. Optionally, install libiconv (http://www.gnu.org/software/libiconv/).
106 This will be used by some language packages for converting
107 native-charset URLs to and from UTF-8. If you're running an
108 English-only wiki, this probably won't be necessary. (Most Linux
109 distributions should come with libiconv anyway, but check for
110 a separate 'dev' package if on RedHat.)
111
112 5. Unpack Apache distribution and begin configuring, but don't finish
113 build yet. Configure with something like:
114
115 OPTIM='-O2 -mcpu=i686' ./configure --with-layout=Apache
116
117 6. If you'll want to use Apache's mod_rewrite to make page-viewing URLs
118 look like static links (as wikipedia.org does), install the included
119 patch "apache-ampersand.diff" which is needed to support page titles
120 with ampersands in them:
121
122 patch -p0 < /path/to/maintenance/apache-ampersand.diff
123
124 7. Unpack and configure PHP. Configure with something like:
125
126 ./configure --enable-apc --enable-shmop --with-zlib --with-zlib-dir=/usr/lib --with-mysql=/usr/local/mysql --with-iconv=/usr/local/lib --with-apache=/home/lee/src/apache_1.3.26
127
128 Or for Apache 2.0 module:
129 ./configure --enable-shmop --with-zlib --with-zlib-dir=/usr/lib --with-mysql=/usr/local/mysql --with-iconv --with-apxs2filter=/usr/local/apache/bin/apxs
130
131 (using your own local paths, of course). Build and install as
132 instructed. Set "register_globals" on in the config file, and
133 "warnings" to
134
135 8. Finish building Apache. Configure with something like:
136
137 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
138
139 Update httpd.conf as needed for your site. For example:
140
141 <IfModule mod_php4.c>
142 AddType application/x-httpd-php .php .php4 .phtml
143 AddType application/x-httpd-php-source .phps
144 </IfModule>
145 <IfModule mod_php4.c>
146 php_admin_flag engine off
147 </IfModule>
148 <Directory "DIRECTORY_OF_WIKI_SCRIPTS">
149 <IfModule mod_php4.c>
150 php_admin_flag engine on
151 </IfModule>
152 </Directory>
153 RewriteEngine On
154 RewriteMap ampescape int:ampescape
155 RewriteRule ^/wiki/(.*)$ /wiki.phtml?title=${ampescape:$1} [L]
156
157 It is *seriously* recommended that you configure the webserver
158 to disable running of PHP scripts except in the script directories
159 (the "php_admin_flag engine off/on" directives above) to prevent
160 the uploading and running of malicious scripts.
161
162 9. Optionally, install APC or another PHP cache plug-in, following
163 standard instructions for installing as a Zend extension.
164
165 10. If using embedded TeX support, be sure TeX and ImageMagick are
166 installed (they are common on most Linux distros and freely
167 downloadable). Also get and install OCaml according to its
168 instructions.
169
170 You'll need to compile the texvc helper script; enter the math
171 subdirectory of the source tree and run "make".
172
173 If you want embedded TeX support, enable it by setting
174
175 $wgUseTex = true;
176
177 in LocalSettings.php
178
179 11. You should now be able to run the install.php script. Use PHP in
180 command-line mode, i.e., type "php install.php". Should be run as
181 root, or as a user or group able to create files and directories
182 in the installation tree.
183
184 12. If you have Java installed and running, install the "ant" package
185 from Apache (http://ant.apache.org/) and run ant in the testsuite
186 directory to build the tests. Copy wikitest.prefs.sample to
187 wikitest.prefs, and edit to reflect your local settings. Then
188 "./run WikiSuite -o -b" will run the whole test suite and report.
189
190 ----
191
192 Don't forget that this is pre-release software under development!
193 Chances are good there's a crucial step that hasn't made it
194 into the documentation. You should probably sign up for the
195 Wikipedia developers' mailing list; you can ask for help (please
196 provide enough information to work with, and preferably be aware
197 of what you're doing!) and keep track of major changes to the
198 software, including performance improvements and security patches.
199
200 http://mail.wikipedia.org/mailman/listinfo/wikitech-l
201