GICT knowledge base
How to Install MediaWiki on Centos?
Published
How to Install MediaWiki on Centos?
MediaWiki is a free web-based wiki platform which is written in PHP. It was originally created for Wikipedia with very powerful capabilities. MediaWiki is now used by several other projects of the non-profit Wikimedia Foundation and by many other wikis. MediaWiki is very easy to install does not take much time to complete. Some of the MediaWiki used websites are Wikipedia, Wiktionary etc. To install MediaWiki your server must contain a web server (Apache), PHP and a database server. In this let’s have a look into how can we install MediaWiki on Centos.
1) Login to your server via SSH.
# ssh root@IP
2) Download the latest version of MediaWiki from their official website.
# wget http://download.wikimedia.org/mediawiki/1.19/mediawiki-1.19.2.tar.gz
3) Untar the file to the document root of Apache.
# tar -xzvf mediawiki-1.19.2.tar.gz -C /var/www/html
4) You can easily find out the Apache’s document root by executing the following command.
# grep ‘^DocumentRoot’ /etc/httpd/conf/httpd.conf
5) You can rename the MediaWiki directory to a preferred one.
# mv /var/www/html/mediawiki-1.19.2 /var/www/html/mediawiki
6) The MediaWiki files must be owned by Apache.
# chown -R apache:apache
7) MediaWiki uses MySQL user and database. In order to create one, you can execute the following commands.
# echo “CREATE DATABASE wikidb;” | mysql -u root -p
# echo “CREATE USER ‘wikiuser’@’localhost’ IDENTIFIED BY ‘PASSWORD_HERE’;” | mysql -u root -p
# echo “GRANT ALL PRIVILEGES ON wikidb.* TO ‘wikiuser’@’localhost’;” | mysql -u root -p
# echo “FLUSH PRIVILEGES;” | mysql -u root -p
8) Now the installation process of MediaWiki has been successfully completed from CLI. You will need to do the rest from the web browser.
9) Open your favorite web browser and navigate to http://yourdomain.com/wiki and follow the onscreen instructions to complete the rest of installation. It will check the requirements and running the software. You will be needed to enter the database details and also must create an admin password. Once the GUI installation is completed, the MediaWiki will generate a ‘LocalSettings.php file.
Download the LocalSettings.php file, open the file and copy its contents.
10) Now open your favorite text editor and paste the copied contents to it.
# vi /var/www/html/wiki/LocalSettings.php
Finally, we have installed MediaWiki on Centos server. If you have any doubt regarding this, please do reach our support department.
If you need any further assistance please contact our support department.
Related guides
How to Install and Uninstall Imunify360?
In this tutorial, we can check how to install Imunify360. Imunify360 is an automated security solution with multi-layer defense architecture for Linux
CentOSInstall and Configure mod_evasive on CentOS
How to Install and Configure mod_evasive Apache on CentOS? The mod_evasive module for Apache that takes evasive action to protect Apache during the time
CentOSHow to Install Laravel on CentOS 6/7
How to Install Laravel on CentOS 6/7Laravel is a free, open-source MVC PHP web framework intended for the development of full-featured web applications.
CentOSHow to Setup and Install FirewallD on CentOS 7
How to Setup and Install FirewallD on CentOS 7. Many Linux distributions have a firewalld as their firewall management solution, and it acts as a front-end
