Apache isn´t work

July 25, 2019 154 views
Apache

I dont know why my apache isnt work in digitalocean… see resuls:

root@acionista:~# systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
└─apache2-systemd.conf
Active: failed (Result: exit-code) since Thu 2019-07-25 14:01:18 UTC; 6s ago
Process: 11632 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Jul 25 14:01:18 acionista apachectl[11632]: AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1. S
Jul 25 14:01:18 acionista apachectl[11632]: (98)Address already in use: AH00072: makesock: could not bind to address [::]:80
Jul 25 14:01:18 acionista apachectl[11632]: (98)Address already in use: AH00072: make
sock: could not bind to address 0.0.0.0:80
Jul 25 14:01:18 acionista apachectl[11632]: no listening sockets available, shutting down
Jul 25 14:01:18 acionista apachectl[11632]: AH00015: Unable to open logs
Jul 25 14:01:18 acionista apachectl[11632]: Action ‘start’ failed.
Jul 25 14:01:18 acionista apachectl[11632]: The Apache error log may have more information.
Jul 25 14:01:18 acionista systemd[1]: apache2.service: Control process exited, code=exited status=1
Jul 25 14:01:18 acionista systemd[1]: apache2.service: Failed with result 'exit-code’.
Jul 25 14:01:18 acionista systemd[1]: Failed to start The Apache HTTP Server.

1 comment
  • Can you share any changes you’ve made to your apache configurations?
    Did you change /etc/apache2/sites-available/000-default.conf?
    Let us know your virtualhosts?

2 Answers

i put a servername localhost in the apache2.conf now i have this problem:

Jul 25 14:13:33 acionista systemd[1]: Starting The Apache HTTP Server…
Jul 25 14:13:33 acionista apachectl[12208]: (98)Address already in use: AH00072:
Jul 25 14:13:33 acionista apachectl[12208]: (98)Address already in use: AH00072:
Jul 25 14:13:33 acionista apachectl[12208]: no listening sockets available, shut
Jul 25 14:13:33 acionista apachectl[12208]: AH00015: Unable to open logs
Jul 25 14:13:33 acionista apachectl[12208]: Action ‘start’ failed.
Jul 25 14:13:33 acionista apachectl[12208]: The Apache error log may have more i
Jul 25 14:13:33 acionista systemd[1]: apache2.service: Control process exited, c
Jul 25 14:13:33 acionista systemd[1]: apache2.service: Failed with result 'exit-
Jul 25 14:13:33 acionista systemd[1]: Failed to start The Apache HTTP Server.

Hello,

It seems like you have another service listening on the same port. What you need to do is the following.

  • Run netstat:
netstat -plant | grep 80

This would return the service that is listening on port 80. If you have another service like Nginx for example, you would need to stop it or change it’s port in order to be able to start Apache.

You can not have two services listening on the same port

  • Another thing that you could try is to run a config test:
apachectl -t

In case that you have any errors in your Apache config this would give you almost the exact line that is causing the problem in your config.

Hope that this helps!
Bobby

Have another answer? Share your knowledge.