By voomdelivery
I have just upgraded apache2 to ver 2.4.51 and then the service failed to start with errors-----
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2021-11-17 14:44:50 UTC; 9min ago
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Nov 17 14:44:50 voomdelivery apachectl[1791]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Nov 17 14:44:50 voomdelivery apachectl[1791]: no listening sockets available, shutting down
Nov 17 14:44:50 voomdelivery apachectl[1791]: AH00015: Unable to open log
Can any one help please to guide me on how to resolve the problems
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Hello,
I know the question has been answered however, I want to shed some light on such situations.
Sometimes you have both Nginx and Apache installed but for some reason you are not using Nginx as a reverse proxy to Apache but rather have both but use only one. In this case, it seems that way or maybe after the Upgrade of Apache2, the default port was returned to port 80 which was already taken by Nginx.
The most descriptive error is that one:
- Nov 17 14:44:50 voomdelivery apachectl[1791]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
It states something is using port 80 and thus it can’t start. The check what’s going on on port 80, you can type
- netstat -pentul | grep 80
This will show you the process which is using the said port. Now, if you know you need this service and your application is using it, then Apache should be listening to another port. These situations are usually when you have Nginx as a reverse proxy and Apache listening on another port serving up content.
If however, you don’t need anything on that port other than Apache, then you can disable the service. To do that, you can type
- systemctl disable name-of-service
The above will stop the service from automatically starting up on boot and taking up the Apache port.
I have resolve the issue. I had to stop nginx and then start apache2 and then restart nginx and apache 2 was restarted successfully this time–
sudo service nginx stop sudo service apache2 start that did it
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.