Howto restrict IPv6 listening address in lighttpd on Debian
0
votes
2
answers
6164
views
I try to make a lighttpd only available from localhost on a Debian system. The following lines are in
/etc/lighttpd/lighttpd.conf
server.port = 80
server.bind = "127.0.0.1"
server.use-ipv6 = "disable"
However, the webserver is running on all IPv6 addresses, too:
# netstat -tupan|grep lighttpd
tcp 0 0 127.0.0.1:80 0.0.0.0:* LISTEN 519887/lighttpd
tcp6 0 0 :::80 :::* LISTEN 519887/lighttpd
With the following line instead of the formerly printed lines in the config file, the server won't start:
server.bind = "[::1]"
It means, I've got only an error message about a used port, but the port ist not used!
# netstat -tupan|grep LISTEN|grep 80/; lighttpd -f /etc/lighttpd/lighttpd.conf; netstat -tupan|grep LISTEN|grep 80/
2023-04-27 16:50:24: (network.c.537) can't bind to socket: [::1]:80: Address already in use
How I can restrict lighttpd to listen only on localhost (only IPv4, only IPv6 or IPv4 and IPv6)
Asked by Micha
(187 rep)
Apr 27, 2023, 02:52 PM
Last activity: Feb 2, 2025, 08:49 PM
Last activity: Feb 2, 2025, 08:49 PM