Changes that will Affect You in Apache 2.4.7

I recently upgraded my Linux Mint machines from Olivia to Petra (Mint 15 to Mint 16) and as always, did a fresh L[AMP] stack install starting with Apache. The release timetable on the Apache Home page would indicate I was probably running 2.0.65 in Olivia, so if you have similar system upgrade patterns like mine here are two breaking changes you’ll encounter in Apache 2.4.7.

.Conf Extension of Sites-Available Configuration Files

In prior Apache releases, sites-available configuration files contained the site name only. Below you see the new .conf file format in my sites-available directory. Previously they were 000-default, embedly, javaws, wall, dbvt, etc.

If you were to enable a new site without the .conf extension like I did when setting up Petra, your command line response would be

ERROR: Site [yoursite] does not exist!

If you really like the .conf-free format you can keep it by modifying the

IncludeOptional sites-enabled/*.conf

statement in apache2.conf.  Personally, I like the fact that configuration files now have a .conf extension. I changed the extension-less site config files with this nifty bash script.

$ sudo find /etc/apache2/sites-available -type f -not -name “*.*” -exec mv “{}” “{}”.conf \;

New Site Access Module and Require Control Directive

If you don’t know about this Apache 2.4 change, when you fire up your sites in Petra you’ll encounter

403 Forbidden You don’t have permission to access / on this server

This is because Apache-2.4 adds a new mod_authz_host module to handle access, and with it a new Require directive is now used.

The old way of granting full access is

<Directory />
Allow from all

While the new syntax is

<Directory />
Require all granted

I changed this in the apache2.conf which was all I needed to solve the 403, though I’ll want to update the individual site configuration files with the new syntax as well.

Those are the only two breaking changes in “Petra Apache” I’ve encountered thus far. Here is an Upgrading Apache¬†to 2.4 from 2.2 document if you want the complete story. If I find any other breaking changes I will post them on the G+ comment thread linked below.