How to Install Mediawiki on a CentOS Server with Screenshots

May 9, 2014 | By
| 2 Replies More

MediaWiki is a free software open source wiki package written in PHP, originally for use on Wikipedia.The software is optimized to correctly and efficiently handle projects of all sizes, including the largest wikis, which can have terabytes of content and hundreds of thousands of hits per second.Because Wikipedia is one of the world's largest websites, achieving scalability through multiple layers of caching and database replication has also been a major concern for developers. Wikipedia and other Wikimedia projects continue to define a large part of the requirement set for MediaWiki. I'm describing about the installation of mediawiki on a CentOS server.

Download mediawiki

Download mediawiki into /usr/local/src

#cd  /usr/local/src

#wget  http://releases.wikimedia.org/mediawiki/1.22/mediawiki-1.22.3.tar.gz

Download mediawiki

Extract mediawiki and move into DocumentRoot

#tar xvzf mediawiki-1.22.3.tar.gz

#mv  mediawiki-1.22.3 /var/www/html/mediawiki

Create Database and User in mysql

Enter into mysql as root

You need to enter mysql root password to enter in to mysql.

#mysql -u root -p

Enter password:

You will get mysql command terminal.We need to create Database, User for mediawiki.

I'm going to set database name, username , and password as 'mediawiki'.You can change it as per your wish.

setup mysql

Create database

mysql> create database mediawiki;

Create User

mysql> create user mediawiki@localhost;

Set password for mysql user

mysql> set password for mediawiki@localhost = password ('mediawiki');

Allow Grant privileges to the user

mysql>GRANT ALL PRIVILEGES ON mediawiki.* to mediawiki@localhost identified by 'mediawiki';

Flush privileges

mysql> flush privileges;

Now all the Activities in mysql is completed.You can simply logout from the mysql using quit

mysql>quit;

Set Ownership and permission in DocumentRoot

We need to set the Owner  and group of mediawiki as apache.Set 755 permission to the /var/www/html/mediawiki folder

#chown -R apache:apache /var/www/html/mediawiki

#chmod -R 755 /var/www /html/mediawiki

Installation of mediawiki from the browser.

You can start installation of mediawiki via browse http://Public_IP/mediawiki

You will get a page like localsettings.php not found.Click on the setup the wiki

localsettings not found

There is a probability of get a blank page .It is due to the missing of pfp-dom.You can install it through the following steps.

#yum install php-xml

#service httpd restart

Now the problem will solve and you will get a language setting page.You can set language as per your wish

language setting

Click Continue, You will get a Welcome page of wediawiki.

welcome to mediawiki

Again Click continue .You will get Connect to database page.We are using mysql as database.So mark mysql and fillup our database details.

connect to database

Click continue. You will get a database settings page.You don't need to change anything on this page.

database settings

Click Continue.You will get a page to Name the mediawiki, and Setup the admin account.  Then simply click continue on next two pages.You will get a installation complete page.

complete

Now you will get a LocalSettings.php file.You need to put that file into /var/www/html/mediawiki.Installation complete and you can enter into your mediawiki now .

You are successfully installed mediawiki now.You can use meidawiki  to share valuable information to the world.

Filed Under : HOWTOS, LINUX HOWTO

Free Linux Ebook to Download

Comments (2)

Trackback URL | Comments RSS Feed

  1. Joseph Morgan says:

    Thanks for your article. Probably it works great on a centos server, but I have debian wheezy installed on my server, so I searched the Internet and found this article http://www.rosehosting.com/blog/how-to-install-mediawiki-on-debian-wheezy/ followed the instructions and installed mediawiki.

  2. Adam says:

    Thanks so much for your article. It was a big help. I was able to get the wiki installed, up and running but I am having a couple of problems (accessing via https and AD authentication). I realize these weren't covered by your article but in my search for answers I ran across a couple of things that led me to have a couple of questions about the installation steps. Install was on CentOS7

    1) in the steps above we recursively set the permissions for the mediawiki directory to 755 and the owner to apache. However, when I copied the LocalSettings.php file back to the server at the end I did it as root so it is owned by root with 644 permissions. Should this file have its owner and permissions changed as well?

    2) One of the mediawiki manuals (http://www.mediawiki.org/wiki/Manual:Running_MediaWiki_on_Red_Hat_Linux)installs into a different directory and then there a number of commands altering the apache configs and about setting selinux configuration. This wasn't covered in your tutorial; is it applicable?

    Thanks again for the write-up

Leave a Reply

Commenting Policy:
Promotion of your products ? Comment gets deleted.
All comments are subject to moderation.