Page MenuHomePhabricator
Paste P279

404 and 500 error pages
ActivePublic

Authored by greg on Feb 10 2015, 9:21 PM.
Referenced Files
F39102: 404_and_500_error_pages
Feb 10 2015, 9:21 PM
Subscribers
None
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:
$ cd DIRECTORY_WHERE_YOU_INSTALLED_MWVAGRANT
$ git clone ssh://YOUR_GERRIT_SHELL_USERNAME@gerrit.wikimedia.org:29418/operations/mediawiki-config.git
$ 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
directly:
* http://127.0.0.1:8080/mediawiki-config/404.html
* http://127.0.0.1:8080/mediawiki-config/503.html
* http://127.0.0.1:8080/mediawiki-config/w/404.php
* http://127.0.0.1:8080/mediawiki-config/hhvm-fatal-error.php
* http://127.0.0.1:8080/mediawiki-config/wmf-config/missing.php
The 404.html page is served up as a 404 response by the
secure.wikimedia.org 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
imagine.
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. :)
[0]: https://github.com/wikimedia/operations-mediawiki-config

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.