Solved: systemd[1]: Failed to start The Apache HTTP Server.

If you are trying to install apache2 webserver as we mentioned in our another post “How to install Apache webserver on Ubuntu ?” there are chances that you may see an error like “systemd[1]: Failed to start The Apache HTTP Server.” in a red color on command line as below,

Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
invoke-rc.d: initscript apache2, action "start" failed.
● 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 Mon 2020-05-18 23:42:39 IST; 6ms ago
  Process: 5424 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

May 18 23:42:39 devlab apachectl[5424]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
May 18 23:42:39 devlab apachectl[5424]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
May 18 23:42:39 devlab apachectl[5424]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
May 18 23:42:39 devlab apachectl[5424]: no listening sockets available, shutting down
May 18 23:42:39 devlab apachectl[5424]: AH00015: Unable to open logs
May 18 23:42:39 devlab apachectl[5424]: Action 'start' failed.
May 18 23:42:39 devlab apachectl[5424]: The Apache error log may have more information.
May 18 23:42:39 devlab systemd[1]: apache2.service: Control process exited, code=exited status=1
May 18 23:42:39 devlab systemd[1]: apache2.service: Failed with result 'exit-code'.
May 18 23:42:39 devlab systemd[1]: Failed to start The Apache HTTP Server.

Solution

Its possible that you may already have some other webserver running on your website which is using port 80, hence it was showing an error as “Address already in use: : make_sock: could not bind to address” so we have to identify which application is using this port 80 and stop this application so as we can install apache2.

Related :   How to resolve : " fatal error: openssl/ssl.h: No such file or directory " for Ubuntu Linux

Check which app is using port 80, you can use below command and Close this program and kill using command line. [ You can also refer to our post “Identify which application / process is using which port or keeping it busy on android / Linux” ]

$ sudo netstat -nap | grep 80

In our Desktop, we had “lighthttpd” installed and running which was causing this problem, so we used below command to identify it as,

$ ps -ax | grep httpd
 6165 ?        Ss     0:00 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf

and then stopped this webserver as,

$ sudo /etc/init.d/lighttpd stop
[ ok ] Stopping lighttpd (via systemctl): lighttpd.service.

lynxbee_ezoic

Subscribe with Valid Email Id to receive updates in Inbox. ( Secured by Google FeedBurner )

   


Leave a Comment

Android Android Applications Android Build system Android Commands Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development & Build Development, Debugging and Performance Tools Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia Audio, Video, Images NDK / Middleware / HAL OS Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web design and development Website Hosting Wordpress Yocto / Bitbake / Openembedded