$wgServer must be set in LocalSettings.php. See
https://www.mediawiki.org/wiki/Manual:$wgServer
.