Apache – Debian/Apache2 doen’t start and stays in inactive mode


VPS, Debian

After purging and reinstalling Apache2 through apt-get install apache2, it does not start. After starting service apache2 start, it does not give any message. systemctl status apache2 gives the following:

● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2)
  Drop-In: /lib/systemd/system/apache2.service.d
   Active: inactive (dead) since Su 2016-10-16 23:24:07 KRAT; 14min ago
  Process: 1953 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 1947 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)

there is nothing hanging on port 80. simple http-servers (by Python eg) work ok.
there is nothing in log – all files are empty.

How to make apache work?

Best Solution

I've found the answer. thanx for your attention. For that here is what i did for solving this.

What I have done

  1. I've found that I do not have /usr/sbin/apache2 AT ALL. Have no idea, how it's happend. sudo apachectl configtest told me about it.

  2. Took /usr/sbin/apache2 from backup. surely I could reinstall it from apt-get.

  3. After that, doing sudo apachectl configtest, I've found a message like that:

    apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: 
    Syntax error on line 2 of /etc/apache2/mods-enabled/access_compat.load: 
    Cannot load /usr/lib/apache2/modules/mod_access_compat.so into server: 
    /usr/lib/apache2/modules/mod_access_compat.so: cannot open shared object file: No such file or directory
    Action 'configtest' failed.

  1. it was cured by sudo apt-get --reinstall install apache2-bin

that's all. thank you

Related Question