• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to install Mediawiki in Centos 7

{{postValue.id}}

To install Mediawiki in Centos 7

In this article we will learn how to install Mediawiki. Mediawiki is an opensource wiki application which is written in PHP programing. The contents of Media wiki are stored in database. It is used for several wiki projects like Wikipedia, Wikimedia and many more.


To install Mediawiki

Before installing Mediawiki, check whether the following services are active.

Apache service

 [root@linuxhelp ~]# systemctl status httpd.service
httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service  enabled  vendor preset: disabled)
   Active: active (running) since Sun 2016-07-10 23:30:51 IST  1h 37min ago
.
.
.
Jul 10 23:30:51 linuxhelp.com systemd[1]: Started The Apache HTTP Server.

Mariadb service

[root@linuxhelp Desktop]# systemctl status mariadb.service
mariadb.service - MariaDB database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service  enabled  vendor preset: disabled)
   Active: active (running) since Sun 2016-07-10 23:30:51 IST  1h 39min ago
.
.
.
Jul 10 23:30:51 linuxhelp.com systemd[1]: Started MariaDB database server.

If both the services are not active, activate it and proceed.

Open the mysql shell, create the database for Mediawiki content and grant permission for the database.

[root@linuxhelp ~]# mysql &ndash u root -p

Welcome to the MariaDB monitor.  Commands end with   or g.
Your MariaDB connection id is 2
Server version: 5.5.47-MariaDB MariaDB Server
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
Type ' help '  or ' h'  for help. Type ' c'  to clear the current input statement.
MariaDB [(none)]>  create database media_db 
Query OK, 1 row affected (0.35 sec)
MariaDB [(none)]>  grant all privileges on media_db.* TO ' linux_user' @' localhost'  identified by ' p@ssw0rd'  with grant option 
Query OK, 0 rows affected (0.19 sec)
MariaDB [(none)]>  flush privileges 
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>  q 
Bye

Download the Media-wiki package by using the following command.

[root@linuxhelp ~]# wget https://releases.wikimedia.org/mediawiki/1.24/mediawiki-1.24.2.tar.gz
--2016-07-07 17:54:44--  https://releases.wikimedia.org/mediawiki/1.24/mediawiki-1.24.2.tar.gz
Resolving releases.wikimedia.org (releases.wikimedia.org)... 208.80.154.251, 2620:0:861:ed1a::3:d
.
.
.
Saving to: ‘ mediawiki-1.24.2.tar.gz’ 
100%[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=====> ] 21,874,196  49.9KB/s   in 45s   
2016-07-07 18:09:15 (23.6 KB/s) - ‘ mediawiki-1.24.2.tar.gz’  saved [21874196/21874196]

Extract the package by using the " tar" command.

[root@linuxhelp ~]# tar -xvf mediawiki-1.24.2.tar.gz
mediawiki-1.24.2/
mediawiki-1.24.2/opensearch_desc.php5
mediawiki-1.24.2/index.php5
.
.
.
mediawiki-1.24.2/languages/.htaccess
mediawiki-1.24.2/languages/ConverterRule.php
mediawiki-1.24.2/languages/Language.php

Create a directory inside the web root directory and move the extracted file.

[root@linuxhelp ~]# mv mediawiki-1.24.2 /var/www/html/media

Change the ownership and give the required permission for that media directory.

[root@linuxhelp ~]#  chown -R apache:apache /var/www/html/media/
[root@linuxhelp ~]# chmod 755 /var/www/html/media/

Allow the firewall to access the Media-wiki.

[root@linuxhelp ~]# firewall-cmd --permanent --add-port=80/tcp
success
[root@linuxhelp ~]# firewall-cmd --reload
Success

Check the port using iptables command.

[root@linuxhelp ~]# iptables-save | grep 80
-A IN_public_allow -p tcp -m tcp --dport 80 -m conntrack --ctstate NEW -j ACCEPT

Check the selinux status in webroot directory.

[root@linuxhelp Desktop]# getenforce
Enforcing
[root@linuxhelp Desktop]# restorecon -r /var/www/html/media/

Open the web-browser and navigate to http://< IP_address> /media/

Click " Set up the wiki" to configure.
install-Mediawiki-Centos7-wiki-application-Set-up-the-wiki

Choose the preferred language and click continue.
install-Mediawiki-Centos7-wiki-application-language

Welcome screen of Mediawiki appears. Click continue to proceed further.
install-Mediawiki-Centos7-wiki-application-Welcome-screen

Now connect Mediawiki to the database.
install-Mediawiki-Centos7-wiki-application-connect-Mediawiki-to-database

Enter the following fields and click Continue.
install-Mediawiki-Centos7-wiki-application-mysql-settings

install-Mediawiki-Centos7-wiki-application-user-account

Select the database settings as required.
install-Mediawiki-Centos7-wiki-application-database-settings

Fill the Installation fields
install-Mediawiki-Centos7-wiki-application-Installation-fields

install-Mediawiki-Centos7-wiki-application-admin-account

Now click continue to install.
install-Mediawiki-Centos7-wiki-application-continue
install-Mediawiki-Centos7-wiki-application-installation

We have successfully installed Mediawiki and it automatically generates LocalSetting.php file. click to download it
install-Mediawiki-Centos7-wiki-application-installed-LocalSetting.php-file

This file contains all the configurations needed to run the Media-wiki.
install-Mediawiki-Centos7-wiki-application-configurations

Tags:
lucas
Author: 

Comments ( 2 )

parthiban
Please check your apache's log file for a detailed error report, I think you got some misconfiguration on your apache so it may deny the /media directory
la558
Hello, This is a great tutorial. Thank you. I'm getting a problem when accessing the url through the browser; FYI - I'm installing the mediawiki in a Linux virtualbox - CentOS 7 if i type in the url browser > /media/ i get > Not Found the requested URL /media/ was not found on this server === I know the /media/directory exists and has media wiki files and folders, because I can navigate to it through the terminal and see all its content.
Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

How do I completely disable caching in MediaWiki?

A

To disable caching in MediaWiki
Add in your LocalSettings.php file the following lines:

$wgEnableParserCache = false;
$wgCachePages = false;

Q

How do I allow uploading of additional formats?

A

By using this command you allow the additional formats
Syntax: "$wgFileExtensions[] = 'pdf';"

Q

How do I stop anonymous users from editing any page?

A

To stop the annonymous user is by changing the value of the $wgGroupPermissions configuration option. Edit LocalSettings.php and add the line:
"$wgGroupPermissions['*']['edit'] = false;"

Q

How do I restrict account creation?

A

By using this command you can restrict the user
'$wgGroupPermissions['*']['createaccount'] = false;"

Q

Does MediaWiki work with safe_mode enabled?

A

Yes, MediaWiki is a safemode but only to a limited degree in safemode

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Sebastian ?
How to change non required to required field in SuiteCRM Custom/Default Modules

How to change not required to the required field in SuiteCRM Custom/Default Modules?

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.