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 panel.
The easiest 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:
Both installation methods install the same files and configurations. However, if you choose to install manually, you'll have the option to install the latest version of MediaWiki which DreamHost does not currently offer in the panel.
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:
[server]$ php eval.php
If you simply type ‘php’, it uses the default version on the server. However, you can explicitly choose any 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 primary directory:
$wgMaxShellMemory = 524288;
For best results in generating thumbnails of SVG images, you may wish to install librsvg.
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 non-user edits with this feature.
Caching your site can improve performance. There are several ways to cache your data using MediaWiki. View the following articles for further 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 Install 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 a configuration file. View the following articles for further details depending on if your site is running on an Apache or Nginx server:
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:
[server]$ 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:
[server]$ 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.example.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.
You have the option of which licensing to use. View the following article for details:
Wikipedia uses GFDL. If you want content to be able to be reused in Wikipedia and other GFDL-projects, then you must use GFDL (or multi-license to use both). In general, if there are other projects you want to work with, you should have compatible licensing.
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: example.com/w/index.php?title=Main_Page
toShortened URL example: example.com/wiki/Main_Page
View the following article for further instructions:
- How do I install a One-Click Install?
- What One-Click Installs does DreamHost offer?
- Upgrading MediaWiki
- How do I remove a One-Click Install?