Apache 2.4 Upgrade Notes

In December 2020 we began the process of upgrading the primary department webserver, www.cs.jhu.edu, from Apache 2.2 to Apache 2.4. This includes some incompatible changes; please read through this page to see if you need to adjust your website or personal web pages that we host.

In general, these changes should only matter if you use a .htaccess file anywhere within your webspace. You can find out if you have one by running the following command on one of our Linux clients: find ~/public_html -name .htaccess

Everyone will have at least ~/public_html/.htaccess; if that's your only file and the only thing in that file is an FcgidWrapper directive, you don't need to worry about anything on this page. Otherwise, please continue reading.

Versioning

In cases where the syntax for something has changed, you will need to have both syntaxes present in order for things to work on both our old and new server. This will be required until the old server is fully retired, which we expect to happen in late January 2021.

To accomplish this, you will need to use Apache's IfVersion directive, roughly like this:

<IfVersion < 2.4>
  # Apache 2.2-specific things, e.g.:
  # Order ...
  # Allow ...
</IfVersion>
<IfVersion >= 2.4>
  # Apache 2.4 things, e.g.:
  # Require ...
</IfVersion>

Access

The Apache authorization directives have changed significantly. Instead of a combination of Order and Allow or Deny directives, you now need to use a singular Require directive. The Apache upgrading page goes into more detail, but some common cases are as follows:

Allow all:

<IfVersion < 2.4>
  Order allow,deny
  Allow from all
</IfVersion>
<IfVersion >= 2.4>
  Require all granted
</IfVersion>

Allow only from a particular subnet:

<IfVersion < 2.4>
  Order deny,allow
  Allow from 128.220.35.0/24
</IfVersion>
<IfVersion >= 2.4>
  Require ip 128.220.35.0/24
</IfVersion>

For setups requiring a password, see either the Shibboleth section below (if you're Using Shibboleth) or the Apache upgrading page (if you're using Apache's basic authentication).

Shibboleth

The instructions from our Using Shibboleth page should be almost all of what you need. The only change you need to make is to put the ShibCompatWith24 directive inside an IfVersion clause:

<IfVersion < 2.4>
  ShibCompatWith24 On
</IfVersion>