Broken vhosts with Apache 2.4 on Ubuntu 13.10

At first sight, the Ubuntu upgrade from Raring Ringtail (13.04) to Saucy Salamander (13.10) happened smoothly without any crucial issues on my dev box.

Nothing really changed on the desktop side, except for some new fancy dash additions.

Unfortunately an annoying problem appeared as soon as I went back to hack on local projects : all my custom vhosts stopped working!

I was a bit worried that the upgrade had deleted the content of /etc/apache2/sites-available/ without warning, but no everything was still there. The corresponding symlinks in sites-enabled too.

New authentication and authorization module

Apache 2.4 introduced a new way of handling auth in configuration files. Order, Deny, Allow directives are all replaced by a simple Require one.

This transition help page details the changes pretty well. The instructions are straightforward but didn't help at all in my case. The mod_access_compat is activated by default to avoid breaking compatibility with previous confs.

Use .conf extension

After a few hours debugging this weird scenario, I stumbled upon this providential answer on StackOverflow : the vhost conf need to ends with .conf extension to be parsed by Apache! I still need to investigate the reasoning behind this sudden lack of flexibility. Anyway, I hope it will help other lost fellows.

Bonus Stage

Don't be surprised if all your apps using JSON stopped working as well. The new PHP version does not include the JSON module by default because of a licence issue. A sudo apt-get install php5-json will solve this painful update.