Jay Hart
2020-Jun-16 02:06 UTC
[CentOS] Apache (httpd) fails to start at boot - Centos 8.1
If I do 'systemctl start httpd', apache will start right up. But during boot, it doesn't and I get the resulting errors below. Jun 15 21:17:28 dream httpd[1534]: (99)Cannot assign requested address: AH00072: make_sock: could not bind to address 10.20.30.11:80 Jun 15 21:17:28 dream httpd[1534]: no listening sockets available, shutting down Jun 15 21:17:28 dream httpd[1534]: AH00015: Unable to open logs Jun 15 21:17:29 dream systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE Jun 15 21:17:29 dream systemd[1]: httpd.service: Failed with result 'exit-code'. the box's ip address is 10.20.30.11, and I am trying to get http (80), and https (443) going. Firewall is turned on. The listen parameter in httpd.conf is 10.20.30.11:80 The log files in /var/log/httpd are all owned by root. Httpd runs as user 'apache'. Google searches have not returned anything that looks remotely promising. Got any suggestions? Thanks in advance, Jay
Alan McRae
2020-Jun-16 02:40 UTC
[CentOS] Apache (httpd) fails to start at boot - Centos 8.1
I have always had exactly the same problem. I had to write a script and run it at boot time: sleep 10 /usr/bin/systemctl start httpd Must be some timing problem with the interface addresses not being set up in time. Alan On 16/06/2020 14:06, Jay Hart wrote:> If I do 'systemctl start httpd', apache will start right up. But during boot, it doesn't and I > get the resulting errors below. > > Jun 15 21:17:28 dream httpd[1534]: (99)Cannot assign requested address: AH00072: make_sock: could > not bind to address 10.20.30.11:80 > Jun 15 21:17:28 dream httpd[1534]: no listening sockets available, shutting down > Jun 15 21:17:28 dream httpd[1534]: AH00015: Unable to open logs > Jun 15 21:17:29 dream systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE > Jun 15 21:17:29 dream systemd[1]: httpd.service: Failed with result 'exit-code'. > > the box's ip address is 10.20.30.11, and I am trying to get http (80), and https (443) going. > > Firewall is turned on. The listen parameter in httpd.conf is 10.20.30.11:80 The log files in > /var/log/httpd are all owned by root. Httpd runs as user 'apache'. > > Google searches have not returned anything that looks remotely promising. > > Got any suggestions? > > Thanks in advance, > > Jay > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos
Kenneth Porter
2020-Jun-16 04:03 UTC
[CentOS] Apache (httpd) fails to start at boot - Centos 8.1
On 6/15/2020 7:06 PM, Jay Hart wrote:> Jun 15 21:17:28 dream httpd[1534]: (99)Cannot assign requested address: AH00072: make_sock: could > not bind to address 10.20.30.11:80Could some transient service be holding port 80 at that time? You could probably arrange to run a script that runs "lsof -i" and "ip addr show", dumping the output to a temp file, just before httpd runs to see what's not set up right.
Gordon Messmer
2020-Jun-16 04:21 UTC
[CentOS] Apache (httpd) fails to start at boot - Centos 8.1
On 6/15/20 7:06 PM, Jay Hart wrote:> If I do 'systemctl start httpd', apache will start right up. But during boot, it doesn't and I > get the resulting errors below. > > Jun 15 21:17:28 dream httpd[1534]: (99)Cannot assign requested address: AH00072: make_sock: could > not bind to address 10.20.30.11:80httpd is starting before an interface has been configured with 10.20.30.11. The default configuration starts httpd after "network.target" but you want to start it after "network-online.target". IIRC: run "systemctl edit httpd.service" and insert: [Unit] After=network-online.target
Alessandro Baggi
2020-Jun-16 06:11 UTC
[CentOS] Apache (httpd) fails to start at boot - Centos 8.1
Il 16/06/20 06:21, Gordon Messmer ha scritto:> On 6/15/20 7:06 PM, Jay Hart wrote: >> If I do 'systemctl start httpd', apache will start right up.? But >> during boot, it doesn't and I >> get the resulting errors below. >> >> Jun 15 21:17:28 dream httpd[1534]: (99)Cannot assign requested >> address: AH00072: make_sock: could >> not bind to address 10.20.30.11:80 > > > httpd is starting before an interface has been configured with 10.20.30.11. > > The default configuration starts httpd after "network.target" but you > want to start it after "network-online.target". > > IIRC: run "systemctl edit httpd.service" and insert: > > [Unit] > After=network-online.target > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos+1 This happened to me with ssh.
Alan McRae
2020-Jun-16 22:10 UTC
[CentOS] Apache (httpd) fails to start at boot - Centos 8.1
Thank you Gordon. That works for me. 8.2 needs the same fix. Alan On 16/06/2020 16:21, Gordon Messmer wrote:> On 6/15/20 7:06 PM, Jay Hart wrote: >> If I do 'systemctl start httpd', apache will start right up.? But >> during boot, it doesn't and I >> get the resulting errors below. >> >> Jun 15 21:17:28 dream httpd[1534]: (99)Cannot assign requested >> address: AH00072: make_sock: could >> not bind to address 10.20.30.11:80 > > > httpd is starting before an interface has been configured with > 10.20.30.11. > > The default configuration starts httpd after "network.target" but you > want to start it after "network-online.target". > > IIRC: run "systemctl edit httpd.service" and insert: > > [Unit] > After=network-online.target > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos