A few days ago when I changed the PHP version of the server and was restarting apache , then it showed me the error:
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
To solve, I did the following:
I ran the command: netstat -tlpn | grep 80
It showed me the following:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1355/nginx
tcp6 0 0 :::80 :::* LISTEN 1355/nginx
Then I finished the process with the command: kill 1355
, I restarted apache and only the tcp6
But today I went to the site and saw that it was showing: 502 BAD GATEWAY ERROR . I was restarting apache to see if it would resolve and showed me the same error I mentioned earlier. I did the same process and it worked.
I wanted to know why this type of error is occurring and if there is any way to resolve it permanently.