Default: disable

You can use this setting if lighty was compiled without --disable-ipv6
and you have working IPv6 on your box.

Note: You can bind it to IPv6 sockets freely without enabling this option.

How does it work?

When enabled, it binds to IPv6 socket when a hostname is to be bound.
Otherwise hostnames bind by default to IPv4.

If your operating system doesn't have bindv6only enabled
(Linux: sysctl net.ipv6.bindv6only | BSD: sysctl net.inet6.ip6.v6only)
and server.set-v6only is disabled (added and enabled by default since 1.4.27),
it binds to an IPv6 socket and accepts IPv4 connections on it.
This results in IPv4 mapped addresses in the access.log like "::ffff:".

If you need IPv6 and don't like the mapped addresses, you have to enable bindv6only
or leave this option disabled and bind to the IPv4 address(es) and IPv6 address(es) yourself.

Please use server.use-ipv6 only for hostnames, not without server.bind or empty address.
Your config will break if the kernel default for bindv6only changes.

In lighttpd 1.4.56, the server.v4mapped option was introduced to provide more explicit control
whether or not to allow v4-mapped addresses with IPv6.
If server.v4mapped option is not present in config file, then operating system defaults apply.
If server.v4mapped = "disable", then IPV6_V6ONLY socket option is set to 1 on the IPv6 socket.
If server.v4mapped = "enable", then IPV6_V6ONLY socket option is set to 0 on the IPv6 socket.
If present, server.v4mapped overrides server.set-v6only.

See also

Updated by gstrauss over 3 years ago · 8 revisions