User:BDavis (WMF)/Notes/Thumb.php with Vagrant

= Enable Use of thumb.php in Vagrant VM =

Create a Vagrant "role" that enables thumb.php in the wikimedia instance.

Manual
### thumb.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2 [PT,QSA,B] ### ^^^^ this works but doesn't match wiki docs ### PT instead of L
 * Add config to LocalSettings.php:
 * Configure 404 handler in /etc/apache2/sites-enabled/devwiki (Manual:Thumb.php):

RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ /w/thumb.php?f=$1&width=$2&archived=1 [PT,QSA,B] ### end thumb.php

Note that I used the MediaWiki <= 1.19 syntax. I couldn't get  to work properly. It seems like the PathRouter setup isn't quite right to handle it. I also had to change from  to   to get the alias for   to take effect.

With these changes in place my vm instance is generating new thumbs on the fly. They are also saved to disk in /svr/images