Setting up this MediaWiki

From The Age of Machine Intelligence
Revision as of 04:31, 26 December 2022 by (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Setting up a cloud ubuntu box

I setup an Ubuntu box on the cloud (Vultr).

ufw allow 80 so firewall allows HTTP traffic.

Install mediawiki

I followed this guide:

At this point shows the default "Apache is running" /var/www/html/index.html and shows the wiki.

Purchase a domain and point it to the box IP

I purchased a domain ( and created an A-record that sends sap to

It took a few hours for the change to make it to the DNS servers.

Now in Chrome directs to the /var/www/html/index.html

Redirect index.html in the Apache webroot to the wiki

Now I replace the index.html with:

    <meta http-equiv="refresh" content="0;url=mediawiki/index.php" />

Now in Chrome directs to & shows the wiki.

At this point I played with changing the webroot in /etc/apache2/sites-available/000-default.conf to DocumentRoot /var/www/html/mediawiki but decided I'd rather reserve the option to have a website/landing-page and not auto-direct to the wiki, so I reverted it.

Remember to systemctl restart apache2 every time you tweak Apache.

Tidy URL

Now to tidy that URL.

In /var/www/html/mediawiki/LocalSettings.php:

## The protocol and server name to use in fully-qualified URLs
# $wgServer = "";
$wgServer = "";  # pi

Now URL shows as

Challenge is to get

  1. a2enmod rewrite (and restart Apache). This enables the rewrite module (rewriting paths, I guess)

  2. Create '/var/www/html/.htaccess':

root@MediaWiki:/var/www/html# cat .htaccess
RewriteEngine On

# main rewrite rule
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/mediawiki/index.php [L]

# Redirect / to Main Page
RewriteRule ^/*$ %{DOCUMENT_ROOT}/mediawiki/index.php [L]
  1. Allow .htaccess files to be used in webroot (and subfolders):
    In /etc/apache2/apache2.conf:
<Directory />
    Options FollowSymLinks
    AllowOverride All
    Require all denied

<Directory /usr/share>
    AllowOverride All
    Require all granted

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted

# pi: ^ None -> All (x3)
  1. In /var/www/html/mediawiki/LocalSettings.php:
    $wgArticlePath = "/wiki/$1";

Now in Chrome loads the wiki main page, and URL bar shows

Enable Markdown

NOTE: I had to create the composer.local.json

NOTE: For the downloads:

cd extensions
git clone
git clone