If you’re still running mod_perl and using Apache2::Request, this may be of interest to you.

The Apache HTTP Server Project has officially discontinued maintenance of libapreq2. The last official release, 2.17, dates back to August 2022, and the project’s source repository was archived on May 8, 2026.

That could present a problem for applications that still depend on Apache2::Request, Apache2::Cookie, and the underlying APR request libraries.

Like many legacy Perl shops, we still use mod_perl and Apache2::Request and have no current plans to change. Historically, building Apache2::Request from the official CPAN distribution has been a challenge. To begin with, you need to install Apache itself with all of the development tools. To avoid that friction, some people end up building both mod_perl and libapreq2 from source - meaning you need to download a source archive from Apache, configure the C library, compile the Apache module and build the Perl XS bindings.

Apache’s test infrastructure introduces yet another complication on systems where essential Apache modules are dynamically loaded.

And, most recently, installing Apache2::Request has had some difficulties with modern CPAN installation clients. In particular, its build process failed when an attempt was made to build and install using cpm (not cpm’s fault by the way).

Unfortunately, that’s often the status quo for unsupported, legacy software.

Wouldn’t it be nice if things just worked?

Once the release is available on CPAN, installing Apache2::Request should be as simple as:

cpm install -L local Apache2::Request

or

cpanm -l local Apache2::Request

Note: You still need Apache HTTP Server and its development headers, along with the APR and APR-util development libraries and standard build tools such as gcc, libtool, and autoconf.

A fork in the road…

Yes, it would be nice if life were that simple. So after a day of diving into the bowels of libapreq2 I’ve managed to create a fork of the 2.17 Apache repository:

https://github.com/rlauer6/apreq

I’ve released libapreq2 2.18 from the fork. It incorporates the unreleased changes from Apache’s development branch and addresses several build and packaging issues.

  • Correct handling of MakeMaker arguments passed by CPAN installation clients.
  • Generation of CPAN metadata during configuration.
  • Improved Apache::Test configuration for dynamically loaded Apache modules.
  • A reproducible release process that doesn’t require compiling or testing the library merely to create the distribution archive.

The distribution can be generated from a fresh Git checkout, without first compiling or testing the library. I’ve also verified that the resulting tarball builds, passes its tests, and installs successfully using cpm. A clean-room script reproduces the process.

You can find that script here.

What’s next?

I’ve contacted Steve Hay, who is listed as the maintainer on CPAN, notifying him of the fork. Hopefully this will land soon on CPAN. If not, you can build your own CPAN distribution from my fork or download the distribution from my mirror.

cpm install --resolver 02packages,https://cpan.openbedrock.net/orepan2 Apache2::Request

Caveat Emptor

To be clear, I’m not looking to adopt Apache2::Request. Moreover I do not have enough expertise or experience with Apache internals to claim to be anything more than someone familiar enough with Perl, autoconf and building software to be able to work through the issues building libapreq2 (with a little help from AI to guide me through the debugging process and write a cogent README).

So, while you can go ahead and post issues (I will try to address them), it would be best if someone with much more knowledge of Apache was willing to maintain Apache2::Request and friends.

In the meantime, libapreq2 lives to see another day.

Links


Previous post: Introducing Log::Log4perl::Appender::CloudWatchLogs