HowTo: Install MediaWiki on IIS Shared Hosting
By Eric Hartwell - Last updated
March 26, 2006
Mediawiki is the
open-source wiki program that is used by
Wikipedia. Although GNU/Linux/Apache is
"suggested", it's supposed to run on "any web server" with
PHP
≥ 4.3 and MySQL ≥ 3.23. MediaWiki ships with an installation
utility which will enable you to install
configure it using your web
browser.
My current web host, ASPnix.com,
provides IIS/ASP hosting with PHP 4 and MySQL 4.1, so it qualifies.
Installation
MediaWiki has a fairly good
installation guide.
- Download and unzip the setup file from here:
http://www.sf.net/projects/wikipedia
- Upload the MediaWiki files to the server. "If you are using a hosting
company, it is usually worth creating a directory under the /www/ folder in
the filesystem, such as /wiki and upload all the files from your local drive
into this folder."
I used the folder
/wwwroot/wiki.
- Create a MySQL database. "If you don't have root access on your server
(i.e. you are on a shared server), before running the setup script, create a MySQL
database and create a user for the database at your local host."
I used the control panel to create a MySQL database called "wikidb" with the
administrator account "wikiadmin". ASPnix created a database an returned its
IP address.
- Change permissions on "config" folder. cd into the directory where the
mediawiki files are. You will find index.php and the config directory. You
need to make the "config" directory writable by the web server.
With ASPnix, you need to submit a support ticket to enable "execute" access
for scripts in the wiki directory and subdirectories, and enable write
access to the config directory. In my case, the changes took a little while
to propagate to my shared hosting site.
- If all is well, at this point you should be able to run the web-based
installation script at http://mydomain.com/wiki, http://mydomain.com/wiki/config/,
or even
http://mydomain.com/config/index.php.
Most of the setup options are straightforward.
Caution: the
Copyright/license metadata field is partway down the form, but if
you read the fine print there, it warns you that changing the copyright "will
wipe out any other data in this form!". Choose the copyright you want
before you fill in any other fields.
- Site name
- Contact e-mail
- Language
- Copyright/license metadata [Caution: changing the copyright "will
wipe out any other data in this form!"]
- Sysop account name and password.
- Shared memory caching: probably not
- E-mail, e-mail notification and authentication setup
- E-mail (general)
- User-to-user e-mail
- E-mail notification
- E-mail address authentication
- Database config
- MySQL server: use the address from step 3.
- Database name, username, password: use the settings
from step 3.
- Database table prefix: leave blank
- Database charset: use default Backwards-compatible UTF-8
- Super user: not needed since database was already created.
- Click "Install!"
- Here's my install log:
MediaWiki 1.5.7 installation
Checking environment...
PHP 4.4.2: ok
Warning: PHP's
register_globals option
is enabled. MediaWiki will work correctly, but this setting
increases your exposure to potential security vulnerabilities in PHP-based
software running on your server. You should disable it if you are
able.
PHP server API is cgi-fcgi; using ugly URLs (index.php?title=Page_Title)
Have XML / Latin1-UTF-8 conversion support.
PHP is configured with no memory_limit.
Have zlib support; enabling output compression.
Neither Turck MMCache
nor eAccelerator are
installed, can't use object caching functions
GNU diff3 not found.
Found GD graphics library built-in, image thumbnailing will be enabled
if you enable uploads.
Installation directory:
C:\Domains\ehartwell.com\wwwroot\wiki
Script URI path: /wiki
Warning: $wgSecretKey key is insecure, generated with mt_rand().
Consider changing it manually.
PHP is linked with old MySQL client libraries. If you are using a
MySQL 4.1 server and have problems connecting to the database, see
http://dev.mysql.com/doc/mysql/en/old-client.html for help.
Connecting to wikidb on 66.179.84.111 as wikiadmin...success.
Connected to 4.1.16-nt; using enhancements for mySQL 4.
Warning: $wgSecretKey key is insecure, generated with mt_rand().
Consider changing it manually.
You are using mySQL 4.1, however, PHP is
linked to older client libraries. If you encounter authentication problems,
see http://dev.mysql.com/doc/mysql/en/old-client.html for pertinent
solutions.
Database wikidb exists
Creating tables... using MySQL 3/4 table defs... done.
Initializing data...
Created sysop account WikiAdmin.
Initialising "MediaWiki" namespace...
- At this point, the installation hung/paused/stopped without completing.
- I
resubmitted the configuration form; setup recognized the existing database
tables, and stopped at the same point.
- I tried a couple more times with the same
result.
- Finally, I added debug "print" statements to the index.php script -
and it ran to completion!
My guess is that the configuration process was taking so long that the
server timed out and reset the application, but adding the debug output
kept the session alive long enough for it to finish.
- After setup, a file called LocalSettings.php is created in the "config"
folder. Move this file to the main wiki folder.
- Delete the config directory to prevent security problems.
Now your very own MediaWiki is running.
References