Update INSTALL from 1.2 branch; deprecate install.php and update.php.
[lhc/web/wiklou.git] / INSTALL
1 ---
2 Installing MediaWiki
3 ---
4
5 Starting with MediaWiki 1.2.0, it's possible to install
6 and configure the wiki "in-place", as long as you have
7 the necessary prerequesites available.
8
9 Required software:
10 * Web server with PHP 4.1.2 or higher (4.3.x is preferred)
11 * A MySQL server. 4.0.x is preferred, but 3.2.x should
12 work as well.
13
14 MediaWiki is developed and tested mainly on Unix/Linux
15 platforms, but should work on Windows as well.
16
17 If your PHP is configured as a CGI plug-in rather than
18 an Apache module you may experience problems, as this
19 configuration is not well tested.
20
21 Don't forget to check the RELEASE-NOTES file...
22
23 ********************** WARNING **************************
24
25 The web-based install is still somewhat experimental. It
26 doesn't yet support updating the format of an existing
27 MediaWiki database, the maintenance scripts aren't available,
28 and there may be all kinds of horrible bugs or security
29 problems that haven't been worked out yet.
30
31 HOWEVER it is much easier, safer, and more reliable than
32 the old install.php, and does not require root access
33 if you already have a database and user access to it.
34
35 REMEMBER: ALWAYS BACK UP YOUR DATABASE BEFORE ATTEMPTING
36 TO INSTALL OR UPGRADE!!!
37
38 ----
39 In-place web install
40 ----
41
42 Decompress the MediaWiki installation archive either on
43 your server, or on your local machine and upload the
44 directory tree. Rename it from "mediawiki-1.x.x" to
45 something nice, like "wiki", since it'll be in your URL.
46
47 To run the install script, you'll need to temporarily make
48 the 'config' subdirectory writable by the web server. The
49 simplest way to do this on a Unix/Linux system is to make
50 it world-writable:
51
52 chmod a+w config
53
54 Hop into your browser and surf into the wiki directory.
55 It'll direct you into the config script. Fill out the form...
56 remember you're probably not on an encrypted connection.
57 Gaaah! :)
58
59 If all goes well, you should soon be told that it's set up
60 your wiki database and written a configuration file. There
61 should now be a 'LocalSettings.php' in the config directory;
62 move it back up to the main wiki directory, and the wiki
63 should now be working.
64
65 Once the wiki is set up, you should remove the config
66 directory, or at least make it not world-writable (though
67 it will refuse to config again if the wiki is set up).
68
69
70 ----
71 "Classic" install instructions:
72 ----
73
74 THE INSTRUCTIONS BELOW ARE OLD AND MAY BE INACCURATE.
75 THIS INSTALL METHOD IS NOT RECOMMENDED, IT MAY RUN
76 OVER YOUR DOG.
77
78 If you use the command-line install, you MUST NOT make the
79 source directory web-accessible, as it will expose maintenance
80 scripts to the public internet. You MUST NOT install to the
81 same directory as your are installing from, this WILL
82 overwrite and destroy files.
83
84 Because install.php and update.php are unsafe, they have
85 been disabled as of 1.2.4. If you wish to use them, remove
86 the "die()" call at the top of the file.
87
88 --
89
90 The Wikipedia software was developed collaboratively by
91 many people, so it's something of a hodgepodge. The
92 main wiki software itself is written in PHP, and requires
93 the Apache web server and MySQL database. The optional
94 math rendering functions are written in Objective CAML,
95 which is required to compile them.
96
97 Recommended versions are: Apache 1.3.27 or later; MySQL
98 4.0.13 or later; PHP 4.3.2 or later. The installation at
99 wikipedia.org also uses PHP Accelerator software, but
100 that's entirely optional and doesn't affect anything else.
101
102 The math rendering functions are more complex, and will
103 probably only work on Linux. Objective CAML (probably
104 3.06 or later) is required to compile texvc, but produces
105 static binaries. TeTeX and ImageMagick are required at
106 runtime, and ImageMagick requires GhostScript. These are
107 present in most Linux distributions.
108
109 ----
110 Scripts install.php and update.php
111 ----
112
113 Before installing the software, you must copy the file
114 "LocalSettings.sample" to "LocalSettings.php", and
115 "AdminSettings.sample" to "AdminSettings.php", and
116 customize both of the php files to your local setup
117 (things like installation path, passwords, etc.) The
118 script install.php can then be run to install the
119 software. It must be run from the command line with
120 PHP: that is, type "php install.php" (you may need to
121 specify the path the php executable). You will probably
122 need to run as root.
123
124 Hint: If you are using Debian, the PHP interpreter is
125 not part of the "php4" package; you need to install
126 php4-cgi separately (the interpreter will be called
127 php4).
128
129 This script will copy all the necessary software over to
130 the directories you have specified in the settings files.
131 It will then warn you that it is about to create the
132 database and give you the chance to exit. If you are
133 installing the software to an existing database, you can
134 answer "no" here and it will be left alone. The software
135 installation will be otherwise complete. If you do choose
136 to create a new database, you will need te root password
137 to your MySQL installation.
138
139 If you are merely updating an existing installation, run
140 "php update.php" instead of install. This will copy all
141 the software, and also run any database updates that may
142 be necessary. These should give appropriate warnings if
143 there are any dangerous ones.
144
145 ----
146 Building from scratch
147 ----
148
149 Here are some more notes on building a system from scratch
150 the way it was done for the Wikipedia server:
151
152 Downloads:
153
154 gcc-2.95.3.tar.gz (only if you now have gcc 2.96)
155 mysql-4.0.13.tar.gz (or 3.23.57 should work)
156 libiconv-1.8.tar.gz
157 apache_1.3.27.tar.gz
158 php-4.3.2.tar.gz
159 apc-cvs.tar.gz
160
161 And for math support:
162 ocaml-3.06.tar.gz (3.04 doesn't work)
163 (TeTeX, ImageMagick, and GhostScript come with most Linux distros)
164
165 1. MySQL strongly recommends using gcc 2.95 to compile MySQL.
166 RedHat Linux 7.x comes with 2.96 by default, so you'll have to install
167 2.95 first. Use "../gcc*/configure --enable-shared" If your Linux
168 installation doesn't use gcc 2.96, or has a more recent gcc 3.x,
169 you can skip this step.
170
171 2. Install MySQL source; add "mysql" user and group. Make sure the
172 directory into which you installed gcc 2.95 appears before the
173 directory of gcc 2.96 in your path. Configure with:
174
175 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
176
177 Edit the file myisam/ftdefs.h, changing the define for minimum word
178 length for fulltext indexing: #define MIN_WORD_LEN 2. Update
179 $wgDBminWordLen in LocalSettings.php to reflect this. Build and
180 install according to instructions. Make root user as recommended;
181 the root password will be required for the wiki installation script.
182
183 3. Unpack the phase3.zip source distribution, or check out the "phase3"
184 module from CVS. Copy LocalSettings.sample to LocalSettings.php,
185 AdminSettings.sample to AdminSettings.php, and customize them for
186 things like local paths and passwords. If desired, update
187 FulltextStoplist.php from the MySQL sources if you have customized
188 MySQL's stop list.
189
190 If you are running anything other than Wikipedia itself you'll want
191 to make a lot of changes to the LanguageXX.php files so it talks about
192 _your_ site and _your_ license. :)
193
194 4. Optionally, install libiconv (http://www.gnu.org/software/libiconv/).
195 This will be used by some language packages for converting
196 native-charset URLs to and from UTF-8. If you're running an
197 English-only wiki, this probably won't be necessary. (Most Linux
198 distributions should come with libiconv anyway, but check for
199 a separate 'dev' package if on RedHat.)
200
201 5. Unpack Apache distribution and begin configuring, but don't finish
202 build yet. Configure with something like:
203
204 OPTIM='-O2 -mcpu=i686' ./configure --with-layout=Apache
205
206 6. If you'll want to use Apache's mod_rewrite to make page-viewing URLs
207 look like static links (as wikipedia.org does), install the included
208 patch "apache-ampersand.diff" which is needed to support page titles
209 with ampersands in them:
210
211 patch -p0 < /path/to/maintenance/apache-ampersand.diff
212
213 7. Unpack and configure PHP. Configure with something like:
214
215 ./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
216
217 Or for Apache 2.0 module:
218 ./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
219
220 (using your own local paths, of course). Build and install as
221 instructed.
222
223 8. Finish building Apache. Configure with something like:
224
225 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
226
227 Update httpd.conf as needed for your site. For example:
228
229 <IfModule mod_php4.c>
230 AddType application/x-httpd-php .php .php4
231 AddType application/x-httpd-php-source .phps
232 </IfModule>
233 <IfModule mod_php4.c>
234 php_admin_flag engine off
235 </IfModule>
236 <Directory "DIRECTORY_OF_WIKI_SCRIPTS">
237 <IfModule mod_php4.c>
238 php_admin_flag engine on
239 </IfModule>
240 </Directory>
241 RewriteEngine On
242 RewriteMap ampescape int:ampescape
243 RewriteRule ^/wiki/(.*)$ /index.php?title=${ampescape:$1} [L]
244
245 It is *seriously* recommended that you configure the webserver
246 to disable running of PHP scripts except in the script directories
247 (the "php_admin_flag engine off/on" directives above) to prevent
248 the uploading and running of malicious scripts.
249
250 9. Optionally, install APC or another PHP cache plug-in, following
251 standard instructions for installing as a Zend extension.
252
253 10. If using embedded TeX support, be sure TeX and ImageMagick are
254 installed (they are common on most Linux distros and freely
255 downloadable). Also get and install OCaml according to its
256 instructions.
257
258 You'll need to compile the texvc helper script; enter the math
259 subdirectory of the source tree and run "make".
260
261 If you want embedded TeX support, enable it by setting
262
263 $wgUseTex = true;
264
265 in LocalSettings.php
266
267 11. You should now be able to run the install.php script. Use PHP in
268 command-line mode, i.e., type "php install.php". Should be run as
269 root, or as a user or group able to create files and directories
270 in the installation tree.
271
272 12. If you have Java installed and running, install the "ant" package
273 from Apache (http://ant.apache.org/) and run ant in the testsuite
274 directory to build the tests. Copy wikitest.prefs.sample to
275 wikitest.prefs, and edit to reflect your local settings. Then
276 "./run WikiSuite -o -b" will run the whole test suite and report.
277
278 ----
279
280 Don't forget that this is pre-release software under development!
281 Chances are good there's a crucial step that hasn't made it
282 into the documentation. You should probably sign up for the
283 Wikipedia developers' mailing list; you can ask for help (please
284 provide enough information to work with, and preferably be aware
285 of what you're doing!) and keep track of major changes to the
286 software, including performance improvements and security patches.
287
288 http://mail.wikipedia.org/mailman/listinfo/wikitech-l
289