I have finally taken the decision to set up a private MediaWiki instance and start using it as a note taking application. I used the web based installation wizard and I expected the installation process to be quick and smooth, but it turned out to be the exact opposite, as I spent over four hours on it. Although I had initially thought the reason for all this spent time was an issue with MediaWiki’s installation wizard, after much trial and error, I realized that some parts of my web server configuration, although they did not affect the normal operation of the wiki, they were actually responsible for the problem during installation.
The exact problem I encountered was that the installation wizard kept returning to the step about the database settings, instead of proceeding to the next step of the procedure. It kept asking me to re-enter the connection settings all over again, regardless of the fact that they had already been entered correctly! Moreover, no helpful error message had been displayed in the browser or recorded in the web server or PHP error logs. At first, I had assumed the wizard had a bug. But, after doing some extensive research on the web, I didn’t come up with anything significant about a possible bug.
So, I started looking at my server’s configuration and kept changing it while performing MediaWiki’s installation after every change. The reason why the problem was so hard to troubleshoot was that it was a combination of various configuration settings, mostly about access control, that were responsible for the problem. As soon as all of them were removed from the Virtualhost
, Directory
and .htaccess
contexts of the httpd configuration, the MediaWiki installation wizard started working as expected.
So, here is a list of things you must avoid doing when installing MediaWiki with a web browser:
- Never protect MediaWiki’s directory with Basic Authentication or any other authentication type, before completing the installation procedure. As this was meant to be a private wiki, but accessible over the web, I had configured the virtual host to forbid any access, unless the HTTP client had authenticated itself using Basic Auth. Mediawiki’s web based installation wizard does not like it.
- Never perform any checks whether the client has connected over HTTPS and redirect it based on the scheme that has been used, until you have finished installing the web application. In fact, I highly recommend performing the installation over plain HTTP. More specifically, make sure you do so in case you haven’t configured SSL access within the web server using mod-ssl, but instead use a separate reverse proxy for SSL termination. Furthermore, avoid installing over HTTPS, if you use self signed SSL certificates or certificates signed by your private certificate authority, even if your system has been configured to trust that custom certificate authority.
- Last, but not least, never put MediaWiki’s installation files directly in the directory set as the
DocumentRoot
. The installation wizard is not going to work. Instead, put them in a subdirectory and move them toDocumentRoot
afterwards.
After the installation is complete, feel free to protect the whole virtual host with authentication, enforce access over the HTTPS protocol or even move the MediaWiki files to the DocumentRoot directory. Everything is going to work smoothly.
Needless to say that I also tested installing using the maintenance/install.php
script, which worked as expected every time, regardless of the configuration of the web server. However, the web based wizard has more configuration options and is admittedly a better experience.
It’s been many years since the last time I had used MediaWiki. My final thoughts are that it is a fantastic piece of open source software, built by fantastic people. The detailed documentation about installing it is absolutely great and I also really liked the installation wizard (as soon as it started working!). However, the point that needs some improvement is the check of the server environment. In my opinion, if the checks were broader and more detailed, the installation wizard would know exactly how to function in that specific environment and either perform the wiki installation without problems or provide some helpful error messages to the user. On the other hand, the configuration of this particular box is highly experimental. Various access control mechanisms using both mod-rewrite rules and other httpd authorization directives and expressions are spread throughout the various configuration contexts of Apache. Many things could have affected the installation process. Time permitting, I’m going to experiment some more with it running in this specific server and I’ll most probably submit a bug report about my findings, if necessary.
Things to avoid when using the installation wizard of MediaWiki by George Notaras is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Copyright © 2016 - Some Rights Reserved