Project

General

Profile

IPv6-Config » History » Revision 5

Revision 4 (kunaguers, 2013-08-30 11:36) → Revision 5/12 (stbuehler, 2013-08-30 11:53)

h1. IPv6-Config 

 h2. Listening to "real" IPv6 addresses 

 Examples: 

 * @server.bind = "[::1]"@ 
 * @$SERVER["socket"] == "[::1]:80" { ... }@ 

 You are fine with these - they only listen to IPv6 in any case. 

 h2. Listening to not specified addresses 

 Examples: 
 * not setting server.bind at all, but using @server.use-ipv6 = "enable"@ in the global context 
 * @$SERVER["socket"] == ":80" { server.use-ipv6 = "enable" ... }@ 
 * "Klinik Hipnoterapi Surabaya":http://subconscious-therapy.com/hipnoterapi-surabaya 
 * "Vertical Blind Jakarta":http://www.tiraimodern.com/product/vertical-blind 
 * "GPS Tracking":http://vamostech.com/gps-tracking 
 * "GPS Tracker":http://vamostech.com/gps-tracking 
 * "Aksesoris Sparepart Motor":http://www.pedatimotor.com 

 These configs listen on the IPv6 "any" address; depending on your system this may also accept IPv4 connections (default under linux unless your distribution disabled it; check @sysctl net.ipv6.bindv6only@). 
 So such configs may break any time if the kernel default changes. 

 h2. Listening to [::] 

 If you use 1.4.27+ or have @sysctl net.ipv6.bindv6only@ = 1, this will listen on IPv6 only, otherwise on IPv6 and IPv4: 

 Examples: 
 * @server.bind = "[::]"@ 
 * @$SERVER["socket"] == "[::]:80" { ... }@ 

 h2. Recommended IPv6 setup 

 This works since 1.4.27 or @sysctl net.ipv6.bindv6only@ = 1 

 <pre> 
 # listen to ipv4 
 server.bind = "0.0.0.0" 
 server.port = "80" 

 # listen to ipv6 
 $SERVER["socket"] == "[::]:80" {    } 

 # if you need ssl 
 $SERVER["socket"] == "0.0.0.0:443" { <here your ssl options> } 
 $SERVER["socket"] == "[::]:443" { <here your ssl options again> } 
 </pre> 

 h2. Changes in 1.4.27 

 Since 1.4.27 lighttpd will set the "V6_ONLY" option for ipv6 sockets that were not empty hostname; i.e. these two will still use the system default for V6_ONLY as before: 
 * server.bind = ""; server.use-ipv6 = "enable" 
 * $SERVER["socket"] = ":443" { server.use-ipv6 = "enable" } 

 But for these cases lighttpd will only listen to IPv6 since 1.4.27 (or if @sysctl net.ipv6.bindv6only@ is 1): 
 * server.bind = "[::]" 
 * server.bind = "localhost"; server.use-ipv6 = "enable" 
 * $SERVER["socket"] = "[::]:443" {    } 
 * $SERVER["socket"] = "localhost:443" { server.use-ipv6 = "enable" } 

 You can restore the old behaviour if you set @server.set-v6only = "disable"@ in the associated block. Use of this option is not recommended as long-term solution, as we will probably remove it again after some versions.