This Article is Under Construction!

MediaWiki

From SETV Springfield Technical Wiki
Jump to: navigation, search


About

MediaWiki is the platform from which Wikipedia runs on. Institutions from IT departments to the NSA use MediaWiki as a platform to centralize information about various topics. On this page we will go over the basics of MediaWiki, and how to install on a typical hosted VPS running CentOS in addition to using the Visual Composer instead of using plain MediWiki code.

Install

Basic Install[1]

We will assume a total LAMP stack has been properly set up (as it whould be with a hosted VPS), and jump right into MediaWiki

Downloading Media Wiki

Navigate to a directory to download any files we need. ( /tarballs on our server)

curl -O https://releases.wikimedia.org/mediawiki/1.28/mediawiki-1.28.0.tar.gz

tar xvzf mediawiki*.tar.gz

mv mediawiki-1.28.0/* /home/USER/public_html

Creating SQL Database

We will use the simple cPanel method to create the DB

Find MySQL Database Wizard

New Database Name: ssdcou5_mediawiki

New Database User: ssdcou5_wiki

Password: Generate. and note password to enter into LocalSettings.php (no need to keep the password after it is set up)

Add User to Database: ALL PRIVILEGES

Setting up the Wiki

Navigate to the site e.g. https://wiki.ssdcougars.tv

Follow all on-screen instructions to generate the LocalSettings.pjhp file

After language selection the install script will now check the server environment for any glaring problems. Mod_Security is sometimes an issue, we will get into that later.

Take note and fix and concerning problems that may have popped up in the check.

Connect to Database

  • DB Type: mySQL
  • DB Host: localhost
  • DB Name: ssdcou5_mediawiki
  • DB prefix: [blank]
  • DB User: ssdcou5_wiki
  • DB Password: [Password generated from before]

Next...

  • Check Use the same account as for installation
  • Storage Engine InnoDB
  • DB Character Set: Binary

Next...

Name Wiki

Project Namespace[2]
Namespaces are indicated in page titles by prefixing the page name with "namespace:", so the prefix "Help:" in this page's title ("Help:Namespaces") indicates that this page is in the Help namespace. Each namespace is identified by a number and a name, which can be translated and can also have some aliases.
We will use Same as the Wiki Name .

Click Continue, select all the extensions and anything else needed. Then click Install.

A LocalSettings.php file will be downloaded. Use cPanel File Manager or FTP client to overrite the current PHP file with the one downloaded from the setup.

Additional Extensions to Add

Visual Editor Install

Maintenance

Maintenance Shell

Clean/Short URLs[3]

Before you do ANYTHING else use this URL to do Clean URLs

http://shorturls.redwerks.org/

Setting up RunJobs in Cron[4]

SSH Into server

crontab -e

0 0 * * * /usr/bin/php /var/www/wiki/maintenance/runJobs.php > /var/log/runJobs.log 2>&1

Editing

Common Problems

Error while Editing with Visual Composer

Parsoid is not running; fix: $ service parsoid start
  1. https://www.digitalocean.com/community/tutorials/how-to-install-mediawiki-on-centos-7
  2. https://www.mediawiki.org/wiki/Help:Namespaces
  3. https://www.mediawiki.org/wiki/Manual:Short_URL/Apache
  4. https://www.mediawiki.org/wiki/Manual:Job_queue