MediaWiki installation


 * installation

Overview
MediaWiki installation is actually surprisingly simple, if you are familiar with basic web site configuration and know how to access your MySQL server. Most of the work in setting up a wiki is creating the skeleton content (filling in all the various pages linked to by the default navbox, links at the bottom, etc.; there should be an article listing all these at some point, because a few of them only show up when you do certain operations), though creating the logo can also take time.

Steps
The following steps were noted while installing MediaWiki version 1.4, and later versions have been similar.
 * 1) Download the latest version from the MediaWiki site. This is usually a .tar.gz file.
 * 2) Read the INSTALL file; it says what versions of PHP and MySQL are needed.
 * 3) Unzip the files and upload them to the directory from which the wiki will run. If your whole site is a wiki, then put them directly in the www/ directory; otherwise www/wiki/ or whatever you're calling it. Note: The folders you should be uploading will be "config", "docs", "extensions", etc.; you don't want to upload the outer folder, if any (currently called mediawiki-1.4.5), or else that will become part of the wiki's URL. Wherever the outermost index.php file goes, that will be the "home" URL of your wiki.
 * 4) Make sure your web server is set up to execute .php files; edit the .htaccess file if needed.
 * 5) Temporarily make the config folder writable by the web server – "chmod a+w config" should work, or use your FTP browser.
 * 6) At this point, you can either give the wiki setup script root access to your MySQL server (it will use the username "root", so if your MySQL root user is something different, you will need to create a user named "root" with permissions to create databases and tables), to add a database and user as needed, or you can create the database and user yourself. (Note that this is a username for the wiki software to use, not a human user.)
 * 7) Browse (with a web browser) to your intended homepage for the wiki – e.g. http://sitename.com/wiki
 * 8) *This will show you a link to the setup script. Click on that link and fill in the fields. If things seem to be missing, or if the script complains about missing files, re-upload the wiki files; I've had problems with uploads mysteriously leaving things out.
 * 9) Move the config/localSettings.php file into the wiki's home directory -- the installation will tell you to do this, and it will also tell you to click on the link to get to your wiki's home page (which should now be working).
 * 10) Once the wiki's main page is up and running, delete the config/ directory. (You can always copy it over again, and anyway it won't run unless you start over from scratch.)

And that should be it.

Possible Problems

 * Setup script complains about register_globals being set for PHP
 * if you have root access to the server, you can turn this off by editing php.ini. Otherwise, you can put the following line in .htaccess in your web root:

php_flag register_globals 0

For a little extra safety, add the following lines as well:

 deny from all 

That prevents anyone from accessing your .htaccess file via a web browser.


 * Contents look fine, but looks ugly (no logo, external links are followed by the URL in parentheses)
 * make sure .htaccess file is set to deliver .css files as 'text/css': "AddType text/css .css" If adding this line doesn't seem to have any effect, be sure to try clearing your cache or force-reloading the page (shift-reload).

Customizations
Some customizing you might want to do:

Security
require_once( "includes/DefaultSettings.php" );
 *  660 LocalSettings.php -- it has the database password in it. (To make sure you can still edit it, add yourself to the owner group.)
 * Note: all changes to LocalSettings.php should be made after this line:
 * Allow only logged-in users to edit
 * In LocalSettings.php, add this line: $wgWhitelistEdit = true;
 * Prevent uploaded (possibly malicious) scripts from being run
 * Put an .htaccess file in the images/ folder containing this line, plus any other file-extensions which might otherwise be executable: AddType text/plain .html .htm .shtml .php .phtml

Aesthetics

 * Customize an existing skin
 * e.g. to make changes to Monobook, add CSS code here (this affects all users): MediaWiki:Monobook.css
 * Create one or more new skins: to create a new skin called NewSkin based on the Monobook skin
 * copy MonoBook.php to NewSkin.php
 * copy the monobook folder to newskin
 * edit NewSkin .php and change the following two lines:

$this->skinname = ' monobook '; $this->stylename = ' monobook '; $this->template = ' MonoBook Template'; $this->skinname = ' newskin '; $this->stylename = ' newskin '; $this->template = ' NewSkin Template';
 * original ( MonoBook ) || new ( NewSkin )
 * original ( MonoBook ) || new ( NewSkin )
 * }
 * in NewSkin .php, modify the line "class MonoBook Template extends QuickTemplate {" by changing " MonoBook Template" to a new name, e.g. " NewSkin Template" (this change and the "this->template" change are necessary in order for login after an explicit logout to work properly)
 * The main CSS code is in newskin /main.css; most simple style changes can be made there. More advanced customization is covered here, here, and probably other places.


 * Make a different (or new) skin the default
 * In localSettings.php, change the value of $wgDefaultSkin to the lowercase name of the target skin (e.g. "newskin")
 * Modify the contents of the navigation bar (on the left in monobook)
 * This is actually very easy, even under v1.4 (it's even easier in v1.5); see MediaWiki Customization

Edit History

 * 2005-10-13 Post-import cleanup & some notes about v1.5
 * 2005-06-11 Created "Steps" and "Likely Customizations" from notes made while installing MediaWiki versions 1.4.1, 1.4.4, and 1.4.5 (4 different installs).