Fedora 25: Install MediaWiki

This article will describe installing MediaWiki.

1 Install MediaWiki

  • Changing open port of firewall from https to http, you can connect via http.
  • MEDIAWIKI_PASSWD is password of admin user.
#!/bin/sh

[ -z "${MEDIAWIKI_PASSWD}" ] && \
  MEDIAWIKI_PASSWD=mediawiki_passwd

fedora_install_mysql()
{
  sudo dnf install -y mariadb-server
  sudo systemctl enable mariadb
  sudo systemctl start mariadb
}

fedora_install_mediawiki()
{
  sudo dnf install -y mediawiki php-mysqlnd

  # Create DB table and LocalSettings.php.
  cd /usr/share/mediawiki
  sudo php maintenance/install.php mediawiki admin \
       --pass "${MEDIAWIKI_PASSWD}" --dbuser root
  cd /var/www/wiki
  sudo ln -s /usr/share/mediawiki/LocalSettings.php .
}

fedora_install_apache()
{
  sudo dnf install -y mod_ssl

  cat <<EOF | sudo tee -a /etc/httpd/conf.d/mediawiki.conf
Alias /wiki/skins /usr/share/mediawiki/skins
Alias /wiki /var/www/wiki
EOF

  sudo firewall-cmd --add-service=https --permanent
  sudo firewall-cmd --reload
  sudo systemctl enable httpd
  sudo systemctl start httpd
}

fedora_main()
{
  fedora_install_mysql
  fedora_install_mediawiki
  fedora_install_apache
}

fedora_main

2 Access to MediaWiki

Access to the following URL.

https://<server>/wiki

Because the chrome does not have this page's certification, the crome warns the following and cannot to access to this page. You need to click "ADVANCED" and "Proceed to <server> (unsafe)". The other browser will needs the similar way.

0001_YourConnectionIsNotPrivate.png

MediaWiki is displayed. Click "Log in" at the top right, and input admin to user and MEDIAWIKI_PASSWD value to password. Then you can login to MediaWiki.

0002_MediaWiki.png