RHEL7: How to install a Mediawiki service.
Presentation
MediaWiki is a free software open source wiki package written in PHP, originally for use on Wikipedia (source: Mediawiki website).
A wiki is a website that provides collaborative modification of its content and structure directly from the web browser. In a typical wiki, text is written using a simplified markup language (source: Wikipedia website).
Prerequisites
Start by installing a MySQL/MariaDB database.
You don’t need at this stage to create any database, user or tables, the web installation process will take care of it.
Installation Procedure
Install the EPEL repository:
# yum install -y epel-release
Install the following PHP packages:
# yum install -y php-xcache php-gd php-intl php-mysqlnd
Install the v1.23 Mediawiki package:
# yum install -y mediawiki123
Rename the /etc/httpd/conf.d/welcome.conf file:
# cd /etc/httpd/conf.d; mv welcome.conf welcome.conf.dist
Uncomment most of the lines in the /etc/httpd/conf.d/mediawiki123.conf file and get the following result:
# This is a sample configuration for a wiki instance located under
# /var/www/mediawiki123 and exposed as http://thishost/wiki123. Please
# read /usr/share/doc/mediawiki123-*/README.RPM on whether to use this
# instance or create copies of it.
# Remove this after installing.
Alias /wiki123/mw-config /var/www/mediawiki123/mw-config
Alias /wiki123/index.php /var/www/mediawiki123/index.php
Alias /wiki123/api.php /var/www/mediawiki123/api.php
Alias /wiki123/load.php /var/www/mediawiki123/load.php
Alias /wiki123/opensearch_desc.php /var/www/mediawiki123/opensearch_desc.php
Alias /wiki123/skins /var/www/mediawiki123/skins
Alias /wiki123/images /var/www/mediawiki123/images
Alias /wiki123 /var/www/mediawiki123/index.php
<Directory /var/www/mediawiki123>
Options FollowSymLinks
</Directory>
Start and enable at boot the httpd service:
# systemctl start httpd && systemctl enable httpd
Add the HTTP service to the firewall configuration:
# firewall-cmd --permanent --add-service=http
success
# firewall-cmd --reload
success
Point your browser at http://servername/wiki123 to finish the configuration.
Configuration Procedure
In the web interface, select:
- your language,
- the wiki language,
- the database system (MySQL),
- the database host (localhost),
- your database name (my_wiki by default),
- the MySQL database prefix (keep empty if you don’t know),
- the database username (root),
- the database password (normally the same as specified in the MySQL/MariaDB installation tutorial),
- the database engine (InnoDB),
- the database character set (Binary),
- the name of the wiki (the name that you want displayed in the browser window),
- the project namespace (leave the default),
- your username,
- your password,
- your email address,
- the user rights profile:
- Open wiki: this wiki model allows anyone to edit, without even logging in.
- Account creation required: this kind of wiki provides extra accountability, but may deter casual contributors.
- Authorized editors only: this wiki model allows approved users to edit, but the public can view the pages, including history.
- Private wiki: this kind of wiki only allows approved users to view pages, with the same group allowed to edit.
- the copyright and licence (leave the default if you don’t know),
- if you enable outbound email or not,
- the return email address and some specific emails settings (leave the default if you don’t know),
- the settings for object caching (PHP object caching (APC, XCache or WinCache)).
At the end, you get a file called LocalSettings.php that you put at the root of your webserver structure (normally in the /var/www/mediawiki123 directory).
Finally, edit the /etc/httpd/conf.d/mediawiki123.conf file and comment out the following line:
Alias /wiki123/mw-config /var/www/mediawiki123/mw-config
Reload the httpd service:
# systemctl reload httpd
You can now point your browser at http://servername/wiki123 and start using it.
Additional Resources
This tutorial is inspired by the Mediawiki website. The HowToForge website provides a tutorial about installing MediaWiki with Nginx on CentOS 7.
Leave a comment