I have recently upgraded my Apache 2.2 on Ubuntu Server 12.04 to version 2.4 and since I have had a few headaches getting all the settings to work as they did before the upgrade, I decided to jot down a quick checklist of what you should double check when you go through the same upgrade:

  1. Move everything inside the html folder. Previously, the default root folder was /var/www while now it’s /var/www/html, so make sure you copy all your content inside here. To make sure to move all your files (including the hidden ones), you can run something like this:
    mv /var/www/{.,}* /var/www/html
  2. Change the root folder in your default virtual host configuration file (/etc/apache2/sites-enabled/000-default.conf). Specifically, there are three places where you should do this:
    1. DocumentRoot /var/www/html
    2. <Directory /var/www/html/>
    3. <Directory /var/www/html/>

    The last one is in /etc/apache2/apache2.conf

  3. Inside this <Directory /var/www/html/> section, you will see a new option named DirectoryIndex which for me defaulted to disabled (this resulted in permission issues trying to access websites). Change it to index.php or index.html depending on the type of website you are serving
  4. AllowOverride defaults to None by default. For security reasons, this is good, but if this is a test system you might not want this. In this last case, change it to AllowOverride All
  5. Replace all occurrences of
    Order allow,deny
    Allow from all


    Require all granted

    which is the new Apache 2.4 syntax for this

Depending on your environment, there might be more things to double check, but this was likely enough on my test web server. For a complete list of changes between Apache 2.2 and 2.4, have a look at the Apache website.

Note: this will obviously not take care of those cases in which settings related to paths are handled by application-specific settings. For example, I use Observium to monitor my VMs, and the path to the installation folder is hardcoded in its configuration file. Therefore, if you notice something not working as expected, make sure to go through the individual application settings to update all relevant settings.