This Article is Under Construction!

Difference between revisions of "MediaWiki"

From SETV Springfield Technical Wiki
Jump to: navigation, search
m
(Updated How-To)
 
Line 2: Line 2:
  
 
== About ==
 
== 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 ==
 
== Install ==
  
=== Basic Install ===
+
=== Basic Install<ref>https://www.digitalocean.com/community/tutorials/how-to-install-mediawiki-on-centos-7</ref> ===
 +
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
  
=== Extensions to Add ===
+
==== Downloading Media Wiki ====
 +
Navigate to a directory to download any files we need. ( /tarballs on our server)
  
=== Clean URLs ===
+
<code>curl -O https://releases.wikimedia.org/mediawiki/1.28/mediawiki-1.28.0.tar.gz</code>
  
=== Setting up RunJobs in Cron ===
+
<code>tar xvzf mediawiki*.tar.gz</code>
  
=== Additional LocalSettings.php Settings ===
+
<code>mv mediawiki-1.28.0/* /home/USER/public_html</code>
  
== Using MediaWiki ==
+
==== Creating SQL Database ====
 +
We will use the simple cPanel method to create the DB
  
=== Importing from Wikipedia ===
+
Find <code>MySQL Database Wizard</code>
  
=== Template Basics ===
+
New Database Name: <code>ssdcou5_mediawiki</code>
 +
 
 +
New Database User: <code>ssdcou5_wiki</code>
 +
 
 +
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: <code>ALL PRIVILEGES</code>
 +
 
 +
=== 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: <code>mySQL</code>
 +
* DB Host: <code>localhost</code>
 +
* DB Name: <code>ssdcou5_mediawiki</code>
 +
* DB prefix: <code>[blank]</code>
 +
* DB User: <code>ssdcou5_wiki</code>
 +
* DB Password: <code>[Password generated from before]</code>
 +
Next...
 +
* Check Use the same account as for installation
 +
* Storage Engine <code>InnoDB</code>
 +
* DB Character Set: <code>Binary</code>
 +
Next...
 +
 
 +
Name Wiki
 +
 
 +
Project Namespace<ref>https://www.mediawiki.org/wiki/Help:Namespaces</ref><blockquote>Namespaces are indicated in page titles by prefixing the page name with "<code>namespace:</code>", so the prefix "<code>Help:</code>" 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.</blockquote>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]]
 +
 
 +
[[mediawikiwiki:Extension:Maintenance|Maintenance]]
 +
 
 +
[[mediawikiwiki:Extension:MaintenanceShell|Maintenance Shell]]
 +
 
 +
=== Clean/Short URLs<ref>https://www.mediawiki.org/wiki/Manual:Short_URL/Apache</ref> ===
 +
Before you do ANYTHING else use this URL to do Clean URLs
 +
 
 +
http://shorturls.redwerks.org/
 +
 
 +
=== Setting up RunJobs in Cron<ref>https://www.mediawiki.org/wiki/Manual:Job_queue</ref> ===
 +
SSH Into server
 +
 
 +
<code>crontab -e</code>
 +
0 0 * * * /usr/bin/php /var/www/wiki/maintenance/runJobs.php > /var/log/runJobs.log 2>&1
  
 
=== Editing ===
 
=== Editing ===

Latest revision as of 16:36, 2 March 2017


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