Manual:Installing Mediawiki on Oracle Linux 7

This document will help you step by step to setup your own MediaWiki server in Oracle Linux 7. This document will not cover the installation of Oracle Linux 7.

Installation additional software packages
In order to be able to install a MediaWiki server you will have to install these extra software packages in Oracle linux: httpd, php, php-mysql, php-gd, php-xml, mariadb-server, mariadb, php-mbstring, php-json.

BUT in order to be able to install the latest php software packages, you will have to add the development repo from Oracle linux 7:

# yum-config-manager --add-repo http://yum.oracle.com/repo/OracleLinux/OL7/developer_php72/x86_64 # yum update

The httpd package is the Apache webserver and mariadb-server is the mysql server.

# yum install httpd php php-mysql php-gd php-xml mariadb-server php-mbstring php-json

Check if both mariadb and httpd services are disabled:

# systemctl status mariadb mariadb.service - MariaDB database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled) Active: inactive (dead)

# systemctl status httpd Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled) Active: inactive (dead) Docs: man:httpd(8) man:apachectl(8)

Configuration httpd webserver
Before proceeding, you will have to configure the httpd webserver first. The main configuration file httpd.conf of the httpd webserver can be found in /etc/httpd/conf. First of all you will have to add the ip address of the webserver to the httpd.conf file. You can do this to uncomment the line ServerName and fill in the correct ip address:

# cd /etc/httpd/conf # cp httpd.conf httpd.conf.orig # vi httpd.conf

# #
 * 1) ServerName gives the name and port that the server uses to identify itself.
 * 2) This can often be determined automatically, but we recommend you specify
 * 3) it explicitly to prevent problems during startup.
 * 1) If your host doesn't have a registered DNS name, enter its IP address here.
 * 1) ServerName  www.example.com:80

The httpd.conf file contains also the DocumentRoot out of which your httpd server will serve your html documents. # DocumentRoot "/var/www/html"
 * 1) DocumentRoot: The directory out of which you will serve your
 * 2) documents. By default, all requests are taken from this directory, but
 * 3) symbolic links and aliases may be used to point to other locations.

After filling in the correct ip address you can enable and start the httpd service:

# systemctl enable httpd # systemctl start httpd

# systemctl status httpd httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2018-03-16 10:20:56 EDT; 12min ago Docs: man:httpd(8) man:apachectl(8) Main PID: 15801 (httpd) Status: "Total requests: 3; Current requests/sec: 0; Current traffic:  0 B/sec" CGroup: /system.slice/httpd.service ├─15801 /usr/sbin/httpd -DFOREGROUND ├─15806 /usr/sbin/httpd -DFOREGROUND ├─15807 /usr/sbin/httpd -DFOREGROUND ├─15808 /usr/sbin/httpd -DFOREGROUND ├─15809 /usr/sbin/httpd -DFOREGROUND ├─15811 /usr/sbin/httpd -DFOREGROUND └─15989 /usr/sbin/httpd -DFOREGROUND Mar 16 10:20:56 Mediawiki-OL7 systemd[1]: Starting The Apache HTTP Server... Mar 16 10:20:56 Mediawiki-OL7 httpd[15801]: AH00558: httpd: Could not reliably determine the ...age Mar 16 10:20:56 Mediawiki-OL7 systemd[1]: Started The Apache HTTP Server.

If you now open your browser and fill in the ip address of your Oracle Linux server, you will see the default Apache webserver page.



When your test was successful you can stop the httpd server again:

# systemctl stop httpd

Mariadb root password
Before you can use the mariadb server, you will have to create a password for the root user.

# systemctl enable mariadb # systemctl start mariadb

# systemctl status mariadb mariadb.service - MariaDB database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2018-03-16 10:14:19 EDT; 2s ago Process: 15417 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS) Process: 15334 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS) Main PID: 15416 (mysqld_safe) CGroup: /system.slice/mariadb.service ├─15416 /bin/sh /usr/bin/mysqld_safe --basedir=/usr └─15578 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr... Mar 16 10:14:17 Mediawiki-OL7 mariadb-prepare-db-dir[15334]: MySQL manual for more instructions. Mar 16 10:14:17 Mediawiki-OL7 mariadb-prepare-db-dir[15334]: Please report any problems at http...a Mar 16 10:14:17 Mediawiki-OL7 mariadb-prepare-db-dir[15334]: The latest information about Maria.... Mar 16 10:14:17 Mediawiki-OL7 mariadb-prepare-db-dir[15334]: You can find additional informatio...: Mar 16 10:14:17 Mediawiki-OL7 mariadb-prepare-db-dir[15334]: http://dev.mysql.com Mar 16 10:14:17 Mediawiki-OL7 mariadb-prepare-db-dir[15334]: Consider joining MariaDB's strong ...: Mar 16 10:14:17 Mediawiki-OL7 mariadb-prepare-db-dir[15334]: https://mariadb.org/get-involved/ Mar 16 10:14:17 Mediawiki-OL7 mysqld_safe[15416]: 180316 10:14:17 mysqld_safe Logging to '/var...'. Mar 16 10:14:17 Mediawiki-OL7 mysqld_safe[15416]: 180316 10:14:17 mysqld_safe Starting mysqld ...ql Mar 16 10:14:19 Mediawiki-OL7 systemd[1]: Started MariaDB database server.

# mysqladmin -u root -p password

Download Mediawiki source software
You can download the MediaWiki resources at the download page of the MediaWiki website: https://www.mediawiki.org/wiki/Download. The mediawiki-1.30.0.tar.gz file can then be unpacked and copied into /var/www/html (DocumentRoot httpd server):

# scp /mediawiki-1.30.0.tar.gz @:/var/tmp On the Oracle linux server:

# cd /var/tmp # gunzip mediawiki-1.30.0.tar.gz # mv mediawiki-1.30.0.tar /var/www # cd /var/www # mv html html_httpd # tar xvf mediawiki-1.30.0.tar # mv mediawiki-1.30.0 html

When the Mediawiki software has been unpacked, you can start the httpd service:

# systemctl start httpd

Initial Mediawiki installation
If you now open your browser and fill in the ip address of Oracle linux 7 server, you will see the MediaWiki server first page and you can start the initial installation by clicking set up the wiki:



During the initial installation you will be prompted to fill in a Mediawiki database name and the root password of the mariadb server, which was generated earlier in this document. After the initial installation a LocalSetting.php file will be created. You will need to download the LocalSetting.php file and copy it to the DocumentRoot of your httpd webserver. In this case this will be /var/www/html.

After disabling/enabling the httpd service, you can start using your MediaWiki server:

# systemctl stop httpd # systemctl start httpd

JefAdams (talk) 15:06, 16 March 2018 (UTC)