- 1 Overview
- 2 Installing MediaWiki
- 3 Extensions
- 4 Utilities
- 5 Email
- 6 Caching
- 7 Enabling uploads
- 8 Backing up
- 9 Security
- 10 Upgrading
- 11 Licensing settings
- 12 Troubleshooting
- 13 See also
MediaWiki is a program you can download and use to create a wiki site such as Wikipedia. The application is great for creating knowledge base pages just like an encyclopedia.
For more information about MediaWiki, visit MediaWiki's official site:
MediaWiki is offered as a One-Click Install in your DreamHost web panel.
The simplist way to install is to use the One-Click Install feature in your panel which installs the software for you.
The other option is to install it manually which requires you to download the files yourself and upload them to your web server.
Detailed instructions to manually install MediaWiki are provided in the following article:
MediaWiki offers many different types of extensions which you can use to add further functionality and customization to your site. Visit the following page for further details:
You can also add Google Analytics on your MediaWiki if you wish. Visit the following page for detailed instructions:
Running maintenance scripts
In the MediaWiki root install, there is a subdirectory named /maintenance which includes various scripts you can run on your MediaWiki application. In order to run the php scripts, you must enable shell access on your domain.
In order to run the scripts, you must enter ‘php’ before the filename. For example, run the following command if you wish to run the script eval.php in the maintenance directory:
|Note:||If you simply type ‘php’, it defaults to PHP 5.4 effective June 2015. You can specify another version by using the following instead:
To learn more about the individual scripts, visit the following page:
MediaWiki can occasionally have problems generating image thumbnails, such as returning corrupted images or the error message "Error creating thumbnail". A common cause of this is not enough memory.
If you upload a large image and see "Error creating thumbnail" where a thumbnail should be, try adding the following to your LocalSettings.php file in your site’s main directory:
$wgMaxShellMemory = 524288;
For best results in generating thumbnails of SVG images, you may wish to install librsvg.
|Note:||The SVG installation process is not supported and is recommended only for advanced users. More information can be found on the following page:|
Add the following to your LocalSettings.php file:
$wgUserEmailUseReplyTo = true;
This spoofs the domain so that the sending user's email is in a Reply-To header instead of the From header. Otherwise, the email that users try to send each other through Special:EmailUser on your wiki will not be delivered.
If a page is watchlisted by 100 users who have that user preference enabled, then a change to that page uses up your quota for an hour, if you are on shared hosting.
Blocking MediaWiki spam
- Provides steps you can take to combat SPAM on your website.
- Description of what wiki spam is, and instructions on how any user can help tackle the wiki-spam problem (not just administrators). Not all of which is obvious, so it's worthwhile for administrators to read through this too, as you might wish to refer your wiki users to this.
- Enabling a Captcha on any form will help to reduce spam.
- By default, anyone can create an account on your wiki. However you can restrict who has the ability to create accounts.
- You also have control over user rights. You can disable disable non-user edits with this feature.
There are several ways to cache your data using MediaWiki. View the following article for detailed information:
To use the intl PECL extension for Unicode normalization, follow this guide on creating a phprc file. Once added, you can add the following line to it:
extension = intl.so
View the following guide for instructions on how to enable file uploads:
View the following guide for instructions on how to backup your data:
Also view the Dreamhost guide for further instructions:
Passwords and HTTPS
The One-Click Dreamhost MediaWiki installation uses a form on an HTTP web page to take your password. This means that your password will go over the network in clear text. To use HTTPS, you must enable Secure Hosting. Once an SSL certificate is added to your domain, you can force HTTPS in any request by adding code to an .htaccess file. View the following article for further details:
LocalSettings.php has your database login information in it, including the database username and password. After you move the LocalSettings.php file to your root directory, have a look at its permissions.
You should update the permissions on that file to 640 or 600. This can be done by running the following command:
$ chmod 640 LocalSettings.php
This makes the file only writeable for the owner while the group can still read it. However the most secure option is to mark the file as only readable/writable by the owner:
$ chmod 600 LocalSettings.php
This way, other people on the same server will not be able to steal your MySQL password from the file. View the following article for further details on permissions:
Move database credentials to another file
Another good security idea is to set up a separate PHP file stored in your user's directory. This file will store your credentials and will pass them as variables. In this setup, your LocalSettings.php file would link to this new file. For example:
- In your user's directory (not the domain's directory) create a new directory called "external_includes"
- In this new folder, create a file called "database_info.php".
- The full path to this new file would be:
- The file would include the following (fill in your true values in the quotes):
<?php $database_server = "mysql.domain.com"; $database_name = "databasename"; $database_user = "username"; $database_pw = "password"; ?>
- Next, remove the current database credentials in your LocalSettings.php file.
- Replace those lines with the following:
# enhanced DB security require_once ("/home/[yourusername]/external_includes/database_info.php"); $wgDBserver = $database_server; $wgDBname = $database_name; $wgDBuser = $database_user; $wgDBpassword = $database_pw; # DB variables not security related - leave these alone from how when you set up your wiki $wgDBprefix = "wiki_"; $wgDBtype = "mysql";
This way, even if someone is able to read your LocalSettings file, it still won't reveal any credentials.
Always make sure to first backup your database and website files before making any adjustments. This way, if something were to error you could quickly replace your files. View the following article for details:
If you used the One-Click Install feature to install MediaWiki, visit the following article for upgrade instructions:
If you have a manual install, view the following guide:
You have the option of which licensing to use. View the following article for details:
You can enable debugging by adding lines at the bottom of your LocalSettings.php file. By enabling this, you are provided detailed debugging information to help isolate the cause.
View the following article for further details:
Once you finish troubleshooting your install, you should disable your debugging settings.
You can shorten the URLs to appear more user friendly. For example, you can change:
Original URL example: wikisite.tld/w/index.php?title=Main_Page
Shortened URL example: wikisite.tld/wiki/Main_Page
View the following article for further instructions: