Bind Lighttpd to Specific IP
I run Nextcloud, Gogs plus a few others services on this one machine. I have a public /28 and use 1-to-1 NATs on my PA for some of my services.
System Info
uname -a
Linux srv 4.15.0-109-generic #110-Ubuntu SMP Tue Jun 23 02:39:32 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Netplan Config
/etc/netplan/01-network.yaml.
network:
version: 2
ethernets:
eno1:
addresses:
- 192.168.20.66/28
- 192.168.20.67/28
- 192.168.20.68/28
- 192.168.20.69/28
- 192.168.20.70/28
- 192.168.20.71/28`
Lighttpd Error
sudo journalctl -u lighttpd
Jul 08 20:20:07 srv lighttpd[13206]: 2020-07-08 20:20:07: (network.c.477) can't bind to port: 192.168.20.67 80 Address already in use
Lighttpd Config
/etc/lighttpd/external.conf
server.bind = "192.168.20.67"
Pihole Config
/etc/pihole/setupVars.conf
PIHOLE_INTERFACE=eno1
IPV4_ADDRESS=192.168.20.67/28
PIHOLE_DNS_1=9.9.9.9
PIHOLE_DNS_2=149.112.112.112
QUERY_LOGGING=true
INSTALL_WEB_SERVER=true
INSTALL_WEB_INTERFACE=true
LIGHTTPD_ENABLED=true
WEBPASSWORD=****
BLOCKING_ENABLED=true
IPv6 Disabled
cat /proc/sys/net/ipv6/conf/all/disable_ipv6
1
Ports
sudo netstat -nltup
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:4711 0.0.0.0:* LISTEN 1521/pihole-FTL
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1494/mysqld
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 1126/redis-server 1
tcp 0 0 192.168.20.71:8080 0.0.0.0:* LISTEN 2342/nitter
tcp 0 0 0.0.0.0:49 0.0.0.0:* LISTEN 2236/tac_plus
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 1521/pihole-FTL
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2230/sshd
tcp 0 0 192.168.20.68:3000 0.0.0.0:* LISTEN 26687/gogs
tcp 0 0 0.0.0.0:19999 0.0.0.0:* LISTEN 1740/netdata
tcp6 0 0 :::80 :::* LISTEN 1367/apache2
tcp6 0 0 :::49 :::* LISTEN 2236/tac_plus
tcp6 0 0 :::53 :::* LISTEN 1521/pihole-FTL
tcp6 0 0 :::22 :::* LISTEN 2230/sshd
tcp6 0 0 :::443 :::* LISTEN 1367/apache2
tcp6 0 0 :::19999 :::* LISTEN 1740/netdata
udp 0 0 0.0.0.0:53 0.0.0.0:* 1521/pihole-FTL
udp 0 0 0.0.0.0:68 0.0.0.0:* 1314/dhcpcd
udp 0 0 0.0.0.0:161 0.0.0.0:* 1145/snmpd
udp 0 0 0.0.0.0:47425 0.0.0.0:* 1145/snmpd
udp6 0 0 :::53 :::* 1521/pihole-FTL
Not sure why netstat shows tcp6 lines when it's disabled...
Nextcloud Apache2 Config (shortened)
/etc/apache2/sites-available/nextcloud.conf
<VirtualHost 192.168.20.69:80>
...
<VirtualHost 192.168.20.69:443>
...
So there's all the important info. Pihole DNS is working, but the web page is not. What am I missing?