Making a English Wikipedia server: Difference between revisions

Spell checked
Line 1: Line 1:
[https://www.mediawiki.org MediaWiki] makes dumps of the English Wikipedia about once a month. As it is free and open source content, you can use these dumps to make your own server with the English Wikipedia content in it. As the English Wikipedia is the largest Wikipedia, it does take a while to import the dumps, but it is by no means impossible. This guide will help you long the way.
[https://www.mediawiki.org MediaWiki] makes dumps of the English Wikipedia about once a month. As it is free and open source content, you can use these dumps to make your own server with the English Wikipedia content in it. As the English Wikipedia is the largest Wikipedia, it does take a while to import the dumps, but it is by no means impossible. This guide will help you long the way.


This guide is based entierly on the English Wikipedia, but should be quite relevent for other languages too.
This guide is based entirely on the English Wikipedia, but should be quite relevant for other languages too.


== Prerequisites ==
== Prerequisites ==
Line 27: Line 27:
* Prepare MySQL/MariaDB and PHP for the incoming large transactions.
* Prepare MySQL/MariaDB and PHP for the incoming large transactions.


== Preperation ==
== Preparation ==


=== Downloading the dumps ===
=== Downloading the dumps ===
Line 33: Line 33:
# The dumps for English Wikipedia are available from [https://dumps.wikimedia.org/enwiki/ Wikimedia Dumps]. When there, you'll obviously want to select the latest date.
# The dumps for English Wikipedia are available from [https://dumps.wikimedia.org/enwiki/ Wikimedia Dumps]. When there, you'll obviously want to select the latest date.
# Once there, you'll need to download the following:
# Once there, you'll need to download the following:
#* <code>enwiki-(date)-pages-articles-multistream.xml.bz2</code> (This is the latest revision of every Wikipedia page, article and template - the basics you need to get going)
#* <code>enwiki-<date>-pages-articles-multistream.xml.bz2</code> (This is the latest revision of every Wikipedia page, article and template - the basics you need to get going)
# This is compressed with Bzip2 - if you have the space, extract it once downloaded to speed up importing.
# This is compressed with Bzip2 - if you have the space, extract it once downloaded to speed up importing.


Line 67: Line 67:
This can be tweaked with different database and user names as required.
This can be tweaked with different database and user names as required.


=== Moving databse to a different hard drive ===
=== Moving database to a different hard drive ===


Due to the sheer size of the databse, you may choose to move the MariaDB database to a different drive. MariaDB stores each database in a seperate folder by default making this easy.
Due to the sheer size of the database, you may choose to move the MariaDB database to a different drive. MariaDB stores each database in a separate folder by default making this easy.


* Stop MariaDB
* Stop MariaDB
Line 119: Line 119:
* Click 'Continue'
* Click 'Continue'
* Click 'Continue' to finish the install
* Click 'Continue' to finish the install
* Ensure the installation has completed sucessfully then click 'Continue'
* Ensure the installation has completed successfully then click 'Continue'
* A copy of the LocalSettings.php file will be downloaded automatically. This needs to be moved to the root folder of the wiki which will then make it work.
* A copy of the LocalSettings.php file will be downloaded automatically. This needs to be moved to the root folder of the wiki which will then make it work.
* Click 'Enter your wiki'. You will be greeted with the default MediaWiki Main page if all is well.
* Click 'Enter your wiki'. You will be greeted with the default MediaWiki Main page if all is well.
Line 130: Line 130:
* Change <code>$wgEnableUserEmail</code> to <code>false</code>
* Change <code>$wgEnableUserEmail</code> to <code>false</code>
* Edit <code>$wgEmergencyContact</code> and <code>$wgPasswordSender</code> with your email address between the quote marks
* Edit <code>$wgEmergencyContact</code> and <code>$wgPasswordSender</code> with your email address between the quote marks
* Change <code>$wgLocaltimezone</code> from UTC to your correct PHP timezone - in our case, <code>Europe/London</code>
* Change <code>$wgLocaltimezone</code> from UTC to your correct PHP time zone - in our case, <code>Europe/London</code>
* Underneath <code>$wgGroupPermissions['*']['edit'] = false;</code>, add the following
* Add under <code>$wgGroupPermissions['*']['edit'] = false;</code>:
  $wgGroupPermissions['*']['createaccount'] = false;
  $wgGroupPermissions['*']['createaccount'] = false;
This stops user accounts being created and prevents editing by anyone other than yourself.
This stops user accounts being created and prevents editing by anyone other than yourself.