OpenBSD Journal

IPv6 Support in httpd(8)

Contributed by merdely on from the ipv6-will-save-the-world dept.

Recently, Marc Balmer (mbalmer@) committed an update to OpenBSD's Apache implementation to enable IPv6:

Add support for IPv6 while keeping the default at IPv4 to not break
existing installations.  See the documentation for the IPv6 related
configuration.

This changes the module ABI since addresses are now struct addrinfo.

This has been tested by many people and run on production machines
for several months.

Details about integrating IPv6 into httpd(8) from Marc below.

Marc explains how the IPv6 integration came about and what its impact was:

The IPv6 support for httpd originally comes from KAME. Todd Fries (todd@) had it lying around and provided me with it. I brushed it up a bit and installed in on several machines to make sure it works correctly.

IPv6 support for httpd changed the module ABI [Application Binary Interface], since IPv6 addresses take up more space in memory that IPv4 addresses. This meant that I had to check all modules that we have in base (KAME fixed some of them) and also in ports. I converted all modules to the new ABI and I hope that I did not forget one...

Also the webalizer port that we had did not support logfiles with IPv6 addresses in it, so we switched that to an extended version that supports IPv6 addresses.

He goes on to explain the impact of this update on IPv4 support and what users can expect:

IPv6 programs usually are programmed in an address family independent way, which means they will use IPv6 or IPv4 addresses. Often IPv6 is preferred over IPv4. Many programs have -4 and -6 command line switches to restrict them to the use of IPv4 or IPv6 addresses only.

With httpd we did it slightly different: The default behaviour is to use the IPv4 address family only. There is a command line switch to use IPv6 by default for ambiguous directives like "BindAddress *", but by default httpd should just behave like it did before. We wanted to avoid the situation where httpd listens on IPv6 addresses after an update without the sysadmin being aware of it. That was also the main issue with all this: Introducing support for IPv6 without breaking IPv4.

So an IPv4 user can just go on as usual, an IPv6 user can use IPv6 addresses in the httpd.conf file where usually IPv4 addresses have been used.

A README.IPv6 has been created with more information.

A handful of standard modules included in base were updated: mod_proxy, mod_ssl, mod_access, mod_unique_id and mod_usertrack. In addition to the webalizer port, mod_perl, mod_security and mod_scgi were updated to handle the changes in httpd.

Thank you to all of the developers that worked to bring IPv6 to OpenBSD's httpd. And thank you, Marc, for sharing the details.

(Comments are closed)


Comments
  1. By Anonymous Coward (212.112.242.89) on

    A little typo:

    He goes on to explain the impact of this update on IPv4 support and what users can expect:

    IPv4 -> IPv6

    Btw:

    If I have the apache listening on IPv4 on one device and IPv6 on another: Can users using IPv6 visit websites wich are bound to IPv4?
    It all should work via loopback or?!

    It's nothing wich I use in production or so. It just right now poped up in my mind because OpenBSD does not support translation (IPv4->IPv6 and vice versa).

    Comments
    1. By Mike Erdely (merdely) on http://erdelynet.com/

      > A little typo:
      >
      > He goes on to explain the impact of this update on IPv4 support and what users can expect:
      >
      > IPv4 -> IPv6

      That's not a typo. The point of that section is to show that IPv4 httpd users will not be impacted by this change to include support for IPv6.

      Comments
      1. By aht (80.85.151.246) on

        > In addition to the webalizer port, mod_perl, mod_security
        > and mod_scgi were updated to handle the changes in httpd.

        What about PHP?

        Comments
        1. By Marc Balmer (2001:8a8:1001:0:216:76ff:fe72:356c) on

          > > In addition to the webalizer port, mod_perl, mod_security
          > > and mod_scgi were updated to handle the changes in httpd.
          >
          > What about PHP?

          PHP has built in support for IPv6, it fully works.

    2. By Loki (2001:388:f000::8bb) on

      > A little typo:
      >
      > He goes on to explain the impact of this update on IPv4 support and what users can expect:
      >
      > IPv4 -> IPv6
      >
      > Btw:
      >
      > If I have the apache listening on IPv4 on one device and IPv6 on another: Can users using IPv6 visit websites wich are bound to IPv4?
      > It all should work via loopback or?!

      If you have IPv6-only users then you can use faithd and faith (in base) and totd (in packages ) to allow those users to access IPv4 services as long as there is an IPv4 connection to the cloud.

      >
      > It's nothing wich I use in production or so. It just right now poped up in my mind because OpenBSD does not support translation (IPv4->IPv6 and vice versa).

      See above and man faithd and man faith. Look at totd in packages for the DNS proxy to make lookups feasible.



  2. By Anonymous Coward (2001:6f8:94d:4:2c0:9fff:fe1a:6a01) on

    Congratulations!

    You finally made it, after some five years.

Latest Articles

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]