Installing MediaWiki on Windows Server 2003

From Meta, a Wikimedia project coordination wiki
This is an archived version of this page, as edited by 69.93.175.98 (talk) at 02:00, 3 October 2005 (→‎5. Install MySQL 4.1). It may differ significantly from the current version.

The WIMP Stack used for this installation:

  • Windows Server 2003
  • IIS 6
  • MySQL 4.1
  • PHP 4.3

Ingredients:

MediaWiki 1.4.5

MediaWiki 1.4.5

PHP 4.3.11

PHP 4.3.11

MySQL-4.1

MySql 4.1

DBTools 3.03 (optional)

DBTools 3.03

Preparation:

1. Install PHP

  • use an msi and test that it has been loaded.
  • add it to the PATH and PATHEXT variables:

PATH=C:\PHP; (postpend to the paths already present!) PATHEXT: .PHP

 C:\>php -v
 PHP 4.3.11 (cgi-fcgi) (built: Mar 30 2005 17:34:09)
 Copyright (c) 1997-2004 The PHP Group
 Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
  • grant IUSR_MACHINENAME modify permissions to C:\PHP\uploadtemp
  • grant IUSR_MACHINENAME modify permissions to C:\PHP\sessiondata

2. Create a virtual directory

  • Extract MediaWiki into C:\wiki\mediawiki and create a virdir pointing to it.
  • Ensure that the virdir had the php extension enabled and that the default document is set to index.php.
  • Grant the permissions Read & Execute.
  • change the applications configuration for the virdir

(properties/configuration) (the msi should have already configured this, if not, add .php as an extension and define the path to the executable)

3. Configure IIS to allow PHP scripts to execute

  • expand inetmgr\machine-name\web service extensions and right-click to

add a new extension.

  • for extension name, enter: .cgi
  • for required files, enter: C:\PHP\php.exe
  • tick 'set extension to allowed'

Warning: the above steps don't work. The system does not allow you to create .cgi extention saying " C:\PHP\php.exe" allready required by extention PHP.

4. Make C:\wiki\mediawiki\config world-writable (TEMPORARILY!)

  • add IUSR_MACHINE-NAME to the ACL for the folder and grant modify.
  • NB: check the default anonymous inet user account name; it may be

different than the actual machinenname if IIS was installed on an image and cloned. To see the account used for anonymous connections over the web, right-click the virdir, properties->directory security->edit: the name should be listed.

5. Install MySQL 4.1

  • Use the setup file. Perform a full installation with defaults.
  • check the 'configue now' box and select 'detailed configuration'
  • Options to choose: Server, multifunction, OLTP, Latin1 collation, do not change accounts (mediawiki installation will gack), add BIN to PATH variable, start as a service
  • ensure the installation worked:
  C:\>mysqlshow -u root -p

Enter password: ***********

  +-----------+
  | Databases |
  +-----------+
  | mysql     |
  | test      |
  +-----------+

6. force MySQL to use 16-byte password encryption

  • open the file C:\Program Files\MySQL\MySQL Server 4.1\my.ini
  • add the following in the [mysqld] section:
  #Use old password encryption method
  old_passwords
  • restart the MySQL service!

NB: the reasons for this are detailed at http://dev.mysql.com/doc/mysql/en/old-client.html

7. Install MediaWiki by visiting the virdir previously created

NB: if your website cannot be addressed as localhost, then go to IIS setting, select the vroot and right clik on it and select browse.

  • visit the virdir in a browser
  • sitename: demowiki
  • contact email: root@wikihost
  • sysop: WikiSysop
  • pwd: S3cur3Passw0rD
  • no caching
  • MySQL SERVER: wikihost
  • dbname: wikidb
  • wikiuser S3cur3Passw0rD2
  • root pwd: S3cur3Passw0rD3

8. Move the config/LocalSettings.php file into the parent directory

  • To enable image uploads, make sure the 'images' directory is writable, then uncomment this:
$wgDisableUploads		= false;

9. Change the config directory permissions back to secure state

10. change the root password of the MySQL instance!

Use the command line or DBTools.

Troubleshooting

(taken from Brion Vibber's post to the MediaWiki Listserv)

Confirmed that the installation was correct? Confirmed that the GRANTs on the database are correct? Confirmed that the username and password given to the installer are correct? Tried digging into the code to add more output checks? Checked the MySQL error logs?

If you are still having problems, ensure that you have done the following:

Tried fresh install? Tried different settings? Tried a different server? Tried different ports? Any difference between the multiple servers?

If you're having trouble with blank pages on IIS and can't switch, try the workaround suggested in this bug report: http://bugzilla.wikimedia.org/show_bug.cgi?id=1763

If you are getting "Undefined index REQUEST_URI" error messages try this: This problem is a PHP for Windows problem. You should replace all references to the REQUEST_URI member of the _SERVER array with SCRIPT_NAME. The name of the same variable is different between the Windows and UNIX versions of PHP.

Thus:

 Old:  $_SERVER['REQUEST_URI']

Change to:

 New:  $_SERVER['SCRIPT_NAME']

I have seen this within the Setup.php and WebRequest.php both in the INCLUDES folder.

TODO: fix for --

  1. Turck MMCache not installed, can't use object caching functions
  2. Couldn't find GD library or ImageMagick; image thumbnailing disabled.


documented by -- [ian] 12:57, 24 May 2005 (Mountain Daylight Time)