Issue : after server reboot apache2 won't automatically start (have to manually ssh and start via systemctl which starts without any issue)
Error message:
Feb 08 05:53:46 domain1_test.com systemd[1]: Starting The Apache HTTP Server...
Feb 08 05:53:47 domain1_test.com apachectl[834]: (99)Cannot assign requested address: AH00072: make_sock: could not bind to address [xxxx:xxxx::xxxx:xxxx:xxxx:xxxx]:80
Feb 08 05:53:47 domain1_test.com apachectl[834]: no listening sockets available, shutting down
Feb 08 05:53:47 domain1_test.com apachectl[834]: AH00015: Unable to open logs
Feb 08 05:53:47 domain1_test.com apachectl[809]: Action 'start' failed.
Feb 08 05:53:47 domain1_test.com apachectl[809]: The Apache error log may have more information.
Feb 08 05:53:47 domain1_test.com systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Feb 08 05:53:47 domain1_test.com systemd[1]: apache2.service: Failed with result 'exit-code'.
Current apache setup :
# port.conf
Listen xxx.xxx.xx.xx:80
Listen xxx.xxx.xx.xx:443
Listen [xxxx:xxxx::xxxx:xxxx:xxxx:xxxx]:80
Listen [xxxx:xxxx::xxxx:xxxx:xxxx:xxxx]:443
---
# domain1_VirtualHosts.conf
<VirtualHost xxx.xxx.xx.xx:80 [xxxx:xxxx::xxxx:xxxx:xxxx:xxxx]:80>
....
<VirtualHost xxx.xxx.xx.xx:443 [xxxx:xxxx::xxxx:xxxx:xxxx:xxxx]:443>
I have already tested adding network dependency through target and wants in the apache2 unit file but still getting the cannot bind socket error upon checking on the apache2 status post reboot
[Unit]
Description=The Apache HTTP Server
After=network.target network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target
Documentation=https://httpd.apache.org/docs/2.4/
[Service]
Type=forking
Environment=APACHE_STARTED_BY_SYSTEMD=true
ExecStart=/usr/sbin/apachectl start
ExecStop=/usr/sbin/apachectl stop
ExecReload=/usr/sbin/apachectl graceful
PrivateTmp=true
Restart=on-abort
[Install]
WantedBy=multi-user.target
Appreciate any inputs on the matter
Environment : Ubuntu 20.04.2 LTS + Apache/2.4.41