Difference between revisions of "MediaWiki/archive/installing"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
 
m (MediaWikiDoc:Installation Notes moved to MediaWiki Installation)
(No difference)

Revision as of 13:58, 13 October 2005

Techniques: Software: MediaWiki: Installation Notes MediaWiki installation is actually surprisingly simple, if you are familiar with basic web site configuration and know how to access your MySQL server.

Steps

The following steps apply to MediaWiki versions 1.4.1, 1.4.4, and 1.4.5.

  1. Download the latest version from the [http://mediawiki.org/ MediaWiki

site]. This is usually a .tar.gz file.

  1. Read the INSTALL file; it says what versions of php and MySQL are

needed.

  1. 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.

  1. Make sure your web server is set up to execute .php files; edit

.htaccess file if needed.

  1. Temporarily make the config folder writable by the web server

– "chmod a+w config" should work, or use your FTP browser.

  1. 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.)

  1. Browse (with a web browser) to your intended homepage for the wiki

– e.g. http://sitename.com/wiki

    • 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.

  1. 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).

  1. 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. This process has never once gone 100% smoothly, but it has also never taken me more than 2-3 of hours to fix the various problems that cropped up.

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, the server's sysop will have to do it, or you can just ignore the warning.

  • 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).

Likely Customizations

Some customizing you might want to do:

Security

  • chmod 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:

require_once( "includes/DefaultSettings.php" );
  • 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

  • Create one or more new skins; make a new skin the default
    • I haven't figured out how to do this yet. Working on it.
      • You can customize an existing skin, e.g. Monobook, by adding CSS

code here (this affects all users): MediaWiki:Monobook.css

      • You can create a new skin, which will show up in the list of skins

available to the user, by copying MySkin.php and the myskin folder to a new name. (I'm assuming the folder name should be the all-lowercase version of the .php file's name.) However, despite seeming to be based on Monobook, this new skin will appear essentially the same as the "Classic" skin, and I don't know why.

  • Modify the contents of the navigation bar (on the left in

monobook)

Edit History

  • 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).