Page MenuHomePhabricator
Paste P279

404 and 500 error pages

Authored by greg on Feb 10 2015, 9:21 PM.
Referenced Files
F39102: 404_and_500_error_pages
Feb 10 2015, 9:21 PM
From an email by @bd808:
The production and beta clusters use custom Apache config and
supporting files to handle the various error pages. MediaWiki-Vagrant
not-so-helpfully in your case uses sightly different files. The
operations/mediawiki-config.git repostitory [0] holds the files you
will want to modify:
* mediawiki-config/404.html
* mediawiki-config/503.html
* mediawiki-config/w/404.php
* mediawiki-config/hhvm-fatal-error.php
* mediawiki-config/wmf-config/missing.php
I think that I have figured out a way that you can setup a working
copy of the files used in production to test under MediaWiki-Vagrant:
$ git clone ssh://
$ vagrant ssh
$ cd /var/www
$ sudo ln -s /vagrant/mediawiki-config mediawiki-config
$ cd /srv
$ sudo ln -s /vagrant/mediawiki-config mediawiki
$ exit
This clones the mediawiki-config repo and symlinks it to the Apache
docroot directory inside the VM so that we can see the files served
from the VM's web server. Now you can hit the various error pages
The 404.html page is served up as a 404 response by the vhost which acts as a legacy redirection domain
for URLs from before SSL was available on the individual domains.
The 503.html page is served up on 503 errors (Service unavailable)
which can have various causes.
The w/404.php page is served up as the 404 response for most projects.
The hhvm-fatal-error.php page is served up as the http 500 status
response by the application servers.
The wmf-config/missing.php page is kind of a meta 404 page that is
served when the URL requests a non-existing language for an existing
project. There are actually multiple output paths in this file and
triggering all of them in a test environment will take some trickery I
There may be other 404/500 pages that I'm not finding while grepping
the Apache configs. I'm CC'ing Sam so he can give a sanity check on
that and my explanations are not complete lies. :)

Event Timeline

greg changed the title of this paste from untitled to 404 and 500 error pages.
greg updated the paste's language from autodetect to autodetect.
greg added a project: Release-Engineering-Team.