Question

(Raspberry Pi) apache2 restart issue

Posted January 8, 2019 2.1k views
ApacheDigitalOceanUbuntu 16.04

I have received this message after typing this in (sudo /etc/init.d/apache2 restart)

[....] Restarting apache2 (via systemctl): apache2.serviceJob for apache2.service failed because the control process exited with error code.
See “systemctl status apache2.service” and “journalctl -xe” for details.

And I have typed this in (sudo journalctl -xe)
Result:
– Unit apache2.service has begun starting up.
Jan 08 13:54:00 raspberrypi apachectl[12922]: AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1
Jan 08 13:54:00 raspberrypi apachectl[12922]: (98)Address already in use: AH00072: makesock: could not bind to address [::]:80
Jan 08 13:54:00 raspberrypi apachectl[12922]: (98)Address already in use: AH00072: make
sock: could not bind to address 0.0.0.0:80
Jan 08 13:54:00 raspberrypi apachectl[12922]: no listening sockets available, shutting down
Jan 08 13:54:00 raspberrypi apachectl[12922]: AH00015: Unable to open logs
Jan 08 13:54:00 raspberrypi apachectl[12922]: Action ‘start’ failed.
Jan 08 13:54:00 raspberrypi apachectl[12922]: The Apache error log may have more information.
Jan 08 13:54:00 raspberrypi systemd[1]: apache2.service: Control process exited, code=exited status=1
Jan 08 13:54:00 raspberrypi systemd[1]: Failed to start The Apache HTTP Server.
– Subject: Unit apache2.service has failed
– Defined-By: systemd

– Support: https://www.debian.org/support

– Unit apache2.service has failed.

– The result is failed.
Jan 08 13:54:00 raspberrypi systemd[1]: apache2.service: Unit entered failed state.
Jan 08 13:54:00 raspberrypi systemd[1]: apache2.service: Failed with result 'exit-code’.
Jan 08 13:54:00 raspberrypi sudo[12907]: pamunix(sudo:session): session closed for user root
Jan 08 13:54:29 raspberrypi sudo[12967]: pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/journalctl -xe
Jan 08 13:54:29 raspberrypi sudo[12967]: pam
unix(sudo:session): session opened for user root by (uid=0)
Jan 08 13:55:01 raspberrypi CRON[12975]: pamunix(cron:session): session opened for user pi by (uid=0)
Jan 08 13:55:01 raspberrypi CRON[12979]: (pi) CMD (python /home/pi/insertDB.py)
Jan 08 13:55:01 raspberrypi CRON[12975]: (CRON) info (No MTA installed, discarding output)
Jan 08 13:55:01 raspberrypi CRON[12975]: pam
unix(cron:session): session closed for user pi
Jan 08 13:57:50 raspberrypi sudo[12967]: pamunix(sudo:session): session closed for user root
Jan 08 13:57:58 raspberrypi sudo[12998]: pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/journalctl -xe
Jan 08 13:57:58 raspberrypi sudo[12998]: pam
unix(sudo:session): session opened for user root by (uid=0)
Jan 08 13:58:01 raspberrypi sudo[12998]: pamunix(sudo:session): session closed for user root
Jan 08 13:58:21 raspberrypi sudo[13018]: pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/journalctl -xe
Jan 08 13:58:21 raspberrypi sudo[13018]: pam
unix(sudo:session): session opened for user root by (uid=0)
Jan 08 13:58:24 raspberrypi sudo[13018]: pamunix(sudo:session): session closed for user root
Jan 08 13:58:34 raspberrypi sudo[13031]: pi : TTY=pts/0 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/journalctl -xe
Jan 08 13:58:34 raspberrypi sudo[13031]: pam
unix(sudo:session): session opened for user root by (uid=0)

Can anyone teach me how to solve this issue? Thank You

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Hey friend,

I propose that the meaningful error line is this one:

Jan 08 13:54:00 raspberrypi apachectl[12922]: (98)Address already in use: AH00072: makesock: could not bind to address [::]:80

This would suggest to me that something is already listening on port 80. Check what that is like this:

sudo netstat -tulpn | grep ":80"

The service you find listening there, if you disable that then Apache will likely start fine afterward.

Jarland

Hi Jarland,

Thanks for the information

Submit an Answer