Difference between revisions of "Install MediaWiki as Wikipedia in Linux CentOS 7"

From Gejoreuy
Jump to navigation Jump to search
Line 1: Line 1:
=== System Requirements ===
+
== System Requirements ==
  
 
MediaWiki requires PHP 5.5.9+ and either MySQL 5.0.2+, MariaDB, or one of the other three possible stores.
 
MediaWiki requires PHP 5.5.9+ and either MySQL 5.0.2+, MariaDB, or one of the other three possible stores.
  
=== Install Web Server, PHP, and Database ===  
+
== Setup Web Server and Database ==
 +
 
 +
=== Install Web Server, PHP, and Database ===
  
 
To run MediaWiki, make sure you already have PHP 5.5.9+ and MySQL 5.0.2+ running in your server. You can read all related installations in below links.
 
To run MediaWiki, make sure you already have PHP 5.5.9+ and MySQL 5.0.2+ running in your server. You can read all related installations in below links.
Line 16: Line 18:
 
[[Install PHPMyAdmin on CentOS 7]] --> https://www.hostinger.com/tutorials/how-to-install-phpmyadmin-on-centos-7/
 
[[Install PHPMyAdmin on CentOS 7]] --> https://www.hostinger.com/tutorials/how-to-install-phpmyadmin-on-centos-7/
  
=== Prepare MediaWiki Sources ===  
+
== Prepare MediaWiki Sources ==
  
==== Download MediaWiki 1.27.0 ====
+
=== Download MediaWiki 1.27.0 ===
  
 
The last stable MediaWiki can be downloaded from MediaWiki.
 
The last stable MediaWiki can be downloaded from MediaWiki.
Line 24: Line 26:
 
<code> wget https://releases.wikimedia.org/mediawiki/1.27/mediawiki-1.27.0.tar.gz </code>
 
<code> wget https://releases.wikimedia.org/mediawiki/1.27/mediawiki-1.27.0.tar.gz </code>
  
==== Put Media Wiki in Web Server ====
+
=== Put Media Wiki in Web Server ===
  
 
As example, if we're using Centos 7, the web server path is in /var/www/html/.  
 
As example, if we're using Centos 7, the web server path is in /var/www/html/.  
Line 30: Line 32:
 
<code>mv mediawiki-1.27.0.tar.gz /var/www/html/</code>
 
<code>mv mediawiki-1.27.0.tar.gz /var/www/html/</code>
  
==== Extract the File ====
+
=== Extract the File ===
  
 
Extract the tar file and rename it with your wiki name, as example named with wikipedia.
 
Extract the tar file and rename it with your wiki name, as example named with wikipedia.
Line 38: Line 40:
 
<code>mv /var/www/html/mediawiki-1.27.0 /var/www/html/wikipedia</code>
 
<code>mv /var/www/html/mediawiki-1.27.0 /var/www/html/wikipedia</code>
  
=== Run the MediaWiki Installation ===  
+
== Run the MediaWiki Installation ==  
  
 
Open MediaWiki index.php page at http://[web_server_address]/wikipedia/index.php and follow the installation requirement there.
 
Open MediaWiki index.php page at http://[web_server_address]/wikipedia/index.php and follow the installation requirement there.
  
=== Troubleshooting ===
+
== Troubleshooting ==
  
==== Problem 1 : LocalSettings.php file not readable ====
+
=== Problem 1 : LocalSettings.php file not readable ===
 
Solution : https://stackoverflow.com/questions/29363757/localsettings-php-not-readable-even-if-i-set-permission-to-777
 
Solution : https://stackoverflow.com/questions/29363757/localsettings-php-not-readable-even-if-i-set-permission-to-777
  
==== Problem 2 : First login Error (Session Hijacking Protection) ====
+
=== Problem 2 : First login Error (Session Hijacking Protection) ===
 
Solution : Change $wgMainCacheType from CACHE_ACCEL to CACHE_ANYTHING as suggested above in LocalSettings.php appears to be the fix.
 
Solution : Change $wgMainCacheType from CACHE_ACCEL to CACHE_ANYTHING as suggested above in LocalSettings.php appears to be the fix.
  
==== Problem 3 : upload File Error (LocalFileLockError) ====
+
=== Problem 3 : upload File Error (LocalFileLockError) ===
 
Solution : Run '''$ sudo setenforce 0''' and try again.
 
Solution : Run '''$ sudo setenforce 0''' and try again.

Revision as of 15:12, 9 August 2019

System Requirements

MediaWiki requires PHP 5.5.9+ and either MySQL 5.0.2+, MariaDB, or one of the other three possible stores.

Setup Web Server and Database

Install Web Server, PHP, and Database

To run MediaWiki, make sure you already have PHP 5.5.9+ and MySQL 5.0.2+ running in your server. You can read all related installations in below links.

Install Apache Web Server, PHP & MySQL

Install Apache Web Server, PHP & MySQL on CentOS 7 --> https://hostadvice.com/how-to/how-to-install-lamp-stack-on-centos-7/

Install PHP mbstring

Install PHP mbstring on CentOS 7 --> $ yum install php-mbstring

Install PHPMyAdmin

Install PHPMyAdmin on CentOS 7 --> https://www.hostinger.com/tutorials/how-to-install-phpmyadmin-on-centos-7/

Prepare MediaWiki Sources

Download MediaWiki 1.27.0

The last stable MediaWiki can be downloaded from MediaWiki.

wget https://releases.wikimedia.org/mediawiki/1.27/mediawiki-1.27.0.tar.gz

Put Media Wiki in Web Server

As example, if we're using Centos 7, the web server path is in /var/www/html/.

mv mediawiki-1.27.0.tar.gz /var/www/html/

Extract the File

Extract the tar file and rename it with your wiki name, as example named with wikipedia.

tar xvzf mediawiki-1.27.0.tar.gz

mv /var/www/html/mediawiki-1.27.0 /var/www/html/wikipedia

Run the MediaWiki Installation

Open MediaWiki index.php page at http://[web_server_address]/wikipedia/index.php and follow the installation requirement there.

Troubleshooting

Problem 1 : LocalSettings.php file not readable

Solution : https://stackoverflow.com/questions/29363757/localsettings-php-not-readable-even-if-i-set-permission-to-777

Problem 2 : First login Error (Session Hijacking Protection)

Solution : Change $wgMainCacheType from CACHE_ACCEL to CACHE_ANYTHING as suggested above in LocalSettings.php appears to be the fix.

Problem 3 : upload File Error (LocalFileLockError)

Solution : Run $ sudo setenforce 0 and try again.