If you want to use the maintained Debian MediaWiki package, it’s going to be 1.3.5 and it really wants to be in your.example.com/mediawiki without a virtualhost. You can install a newer MediaWiki (now 1.3.8) from source, but it won’t be maintained. The second problem we can take care of with a simple Apache config.
FWIW, MediaWiki has a page about this, but I couldn’t get any of it to work their way and reading their configs I don’t know if it’s worked in many years. This is more simple anyway.
It is assumed this is your server and you know how to load mod_rewrite and php_fpm and configure certs and everything.
With these assumptions:
- virtualhost: wiki.example.com
- path: /w
- documentroot : /var/www/wiki.example.com
Set your LocalSettings.php file to include:
$wgScriptPath = "/w";
$wgServer = "https://wiki.example.com";
and your Apache virtualhost to include:
Alias /w /usr/share/mediawiki
Alias /mediawiki /usr/share/mediawiki
RewriteRule ^/*$ /w [R,L]
And that should do it.
The mediawiki alias is to support the “Powered by Debian” icons at the bottom of your sample config file. If you want to get rid of both you may, but don’t just do one.