Question

(Raspberry Pi) apache2 restart issue

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: make_sock: 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]: pam_unix(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]: pam_unix(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]: pam_unix(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]: pam_unix(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]: pam_unix(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


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi Jarland,

Thanks for the information

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