Apache 2.2 pretends on missing IPv6 support in FreeBSD

Posted by: admin  :  Category: FreeBSD

Today I faced a very issue with Apache 2.2 in FreeBSD.

Despite having it compiled with IPV6 support enabled, it pretended in missing IPv6 support, throwing this error message at me.

Syntax error on line 336 of /usr/local/etc/apache22/httpd.conf:
The specified IP address is invalid.

The line in question contained a “limit” clause like this:

allow from ::1

This behaviour is very odd indeed, as one would expect that compiling Apache 2.2 with IPv6 should effectively permit the afore mentioned configuration statement.

The reason for this behaviour lies much deeper and is not directly related to the Apache 2.2 port itself, but to one of it’s core dependencies, the APR (Apache Portable Runtime).

Depending on which ports you compile and install, chances are that a few may require the APR library to work properly.
One amongst them is subversion (svn).
If you don’t pay attention to the port configuration dialogs (usually seen by invoking “make config”), chances are likely you choose wrong values or just go with the defaults, so you may end up with an APR without IPv6 support.

To check if your APR has IPv6 support enable, just invoke this command:

localhost:/# pkg_info apr*
Information for apr-gdbm-db42-

Apache Portability Library

Required by:

The Apache Portable Runtime is a library of C data structures and routines,
forming a system portability layer that covers as many operating systems as
possible, including Unices, Win32, BeOS, and OS/2.

This port also includes the APR-Util package, which contains some useful
utilities built on top of APR.

WWW: http://apr.apache.org/

The package name gives a clear statement if it supports IPv6 or not. If it does, it’ll read something like this:


If it does NOT, it’ll read something like this:


So, if you insist in managing your port build options manually, make sure to always do a “make config WITH_IPV6=yes” first.
This is your best bet to catch all ports, as most of them support the WITH_IPV6 flag.

You’re better off however, if you add the flag to /etc/make.conf like this:

WITH_IPV6= yes

In either way, you make sure that your APR will always support IPv6, even if it happens to get installed before Apache.

Comments are closed.