Could not bind to address

I set my system IP address so that it will be consistent 192.168.1.2 and the command “ip address” reports as follows:

2: enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether d4:5d:64:80:8f:db brd ff:ff:ff:ff:ff:ff
inet 192.168.1.2/24 brd 192.168.1.255 scope global noprefixroute enp4s0
valid_lft forever preferred_lft forever
inet6 fe80::ce3b:4e8:906a:8814/64 scope link noprefixroute
valid_lft forever preferred_lft forever

However “systemctl status httpd” says

Jan 07 08:40:40 quiet-pc systemd[1]: Started Apache Web Server.
Jan 07 08:40:40 quiet-pc httpd[517]: (99)Cannot assign requested address: AH00072: make_sock: could not bind to address 192.168.1.2:80
Jan 07 08:40:40 quiet-pc httpd[517]: no listening sockets available, shutting down
Jan 07 08:40:40 quiet-pc httpd[517]: AH00015: Unable to open logs
Jan 07 08:40:40 quiet-pc systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Jan 07 08:40:40 quiet-pc systemd[1]: httpd.service: Failed with result ‘exit-code’.

So IOW it says it could not “bind” to that address nor open the logs.
Thus I have no idea why.

Even more confusing is that if I now reenable httpd it works just fine. The log files are updated and I can then access my “quiet-pc” from my web browser using said local ip address (as well as with the hostname “quiet-pc”) .

This startup malfunction only started recently so something I did has changed it but of course I never noticed until reboot.

Any suggestion what could be causing this malfunction on startup please?

Ah… I seem to have solved it myself, although IDK why it was necessary to wildcard the IP address:
Just in case others have this problem: Don’t put explicit IP address in /etc/httpd/conf/
so IOW don’t do this

#Listen 192.168.1.2:80
#Listen 127.0.0.1:80

leave it as

Listen *:80

Note: I do suspect I might have problems if I put another webserver on my LAN… but I will cross that bridge if and when I get there :wink:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.