In this article, we will guide you on how to install MediaWiki on a CentOS/Fedora VPS. MediaWiki is a free, web-based wiki platform written in PHP, with powerful capabilities. It is one of the most popular applications of this type in the world.
The installation of MediaWiki is easy and can be done in under 10 minutes. You should have a web server (Apache), PHP, and a database server (MySQL) installed on your Linux VPS to run MediaWiki.
Step-by-step Guide
1. Go to MediaWiki’s official website and download the latest version of the platform:
# wget http://download.wikimedia.org/mediawiki/1.19/mediawiki-1.19.2.tar.gz
2. Now you should extract the downloaded tar.gz file in your Apache Document Root directory:
# tar -xzvf mediawiki-1.19.2.tar.gz -C /var/www/html
3. To find out Apache’s document root directory, execute:
# grep '^DocumentRoot' /etc/httpd/conf/httpd.conf
4. Rename the extracted directory. In our case, we will rename the directory from ‘mediawiki-1.19.2’ to ‘mediawiki’:
# mv /var/www/html/mediawiki-1.19.2 /var/www/html/mediawiki
5. All WikiMedia’s files and directories should be owned by the Apache user, which in our case is user ‘apache’:
# chown -R apache:apache
6. MediaWIki requires MySQL user and database, so let’s create them by executing 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
Congratulations!
With this step, the installation from the command line is finished. All the rest can be done from a web browser. All you need to do is open http://yourdomain.tld/wiki and follow the on-screen instructions. With this, MediaWiki will check if your server meets the requirements for installing and running the software. You will be prompted to set your MySQL user and database information, as well as other general settings. At the end of the installation, the MediaWiki installer generates a ‘LocalSettings.php’ file, which contains all the necessary configuration settings. You will need to copy the code from the screen and paste it into a file called ‘LocalSettings.php’ in the ‘/var/www/html/wiki’ directory. Execute:
# nano /var/www/html/wiki/LocalSettings.php
Paste the code and save the file. That’s all.
In case you liked this post, please share it with your friends or leave a reply below. Thanks.
Thanks this site and the steps helping greatly……