0

I upgraded from debian 7 to 8 (yeah - quite late) and so from apache2.4 to 2.4, before i go for debian 9 I need some help for this issue:

when I start apache I get this:

Nov 14 15:20:32 srv087 apache2[27920]: Starting web server: apache2 failed!
Nov 14 15:20:32 srv087 apache2[27920]: The apache2 instance did not start within 20 seconds. Please read the log files to discover problems ... (warning).
Nov 14 15:20:32 srv087 systemd[1]: apache2.service: control process exited, code=exited status=1
Nov 14 15:20:32 srv087 systemd[1]: Failed to start LSB: Apache2 web server.
Nov 14 15:20:32 srv087 systemd[1]: Unit apache2.service entered failed state.

but the server with the ID is running:

27934   root            15:20   /usr/sbin/apache2 -k start
27937   www-data    15:20   /usr/sbin/apache2 -k start
27938   www-data    15:20   /usr/sbin/apache2 -k start
27939   www-data    15:20   /usr/sbin/apache2 -k start

in the error log I get this:

[Wed Nov 14 15:20:12.229256 2018] [core:warn] [pid 27934] AH00098: pid file /var/run/apache2.pid overwritten -- Unclean shutdown of previous Apache run?
[Wed Nov 14 15:20:12.235164 2018] [mpm_prefork:notice] [pid 27934] AH00163: Apache/2.4.10 (Debian) OpenSSL/1.0.1t configured -- resuming normal operations
[Wed Nov 14 15:20:12.235224 2018] [core:notice] [pid 27934] AH00094: Command line: '/usr/sbin/apache2'


# journalctl -xn

-- Unit apache2.service has finished shutting down. Nov 14 16:13:51 srvxx systemd[1]: Starting LSB: Apache2 web server...
-- Subject: Unit apache2.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has begun starting up.
   Nov 14 16:13:51 srvxx apache2[30226]: Starting web server: apache2httpd (pid 29324) already running
   Nov 14 16:14:11 srvxx apache2[30226]: failed! Nov 14 16:14:11 srvxx apache2[30226]: The apache2 instance did not start within 20 seconds. Please read the log files to discover problems ... (warning).
   Nov 14 16:14:11 srvxxsrvxx systemd[1]: apache2.service: control process exited, code=exited status=1
   Nov 14 16:14:11 srvxx systemd[1]: Failed to start LSB: Apache2 web server.
-- Subject: Unit apache2.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit apache2.service has failed.
--
-- The result is failed. Nov 14 16:14:11 srv087 systemd[1]: Unit apache2.service entered failed state.

Webserver: Apache/2.4.10 (Debian) OpenSSL/1.0.1t PHP-Version: 7.0.32-2+0~20181015120515.7+jessie~1.gbpa6b8cf MySQL-Server-Version: 5.6.39-1~dotdeb+7.1-log Webserver-Interface: APACHE2HANDLER

I had to change the lockfile settings from default /var/lock/apache2/accept.lock to Mutex file:${APACHE_LOCK_DIR} default.

With the original setting apache wouldn't start

Might be there is an error in the mutex configuration which is

# Since there is no sane way to get the parsed apache2 config in scripts, some
# settings are defined via environment variables and then used in apache2ctl,
# /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
# temporary state file location. This might be changed to /run in Wheezy+1
export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid
export APACHE_RUN_DIR=/var/run/apache2$SUFFIX
export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX
# Only /var/log/apache2 is handled by /etc/logrotate.d/apache2.
export APACHE_LOG_DIR=/var/log/apache2$SUFFIX

Any helpful hints are appreciated.

Daniele Santi
  • 2,479
  • 1
  • 25
  • 22
SeeSack
  • 1
  • 1
  • Check your Apache logs. – Michael Hampton Nov 15 '18 at 13:47
  • I did - there is no hint. It looks like a normal running apache - no errors. – SeeSack Nov 15 '18 at 14:04
  • I don't understand then. What is the problem you are trying to solve? – Michael Hampton Nov 15 '18 at 14:05
  • When I start apache, i get the message it's not running (Unit apache2.service entered failed state.) But it runs in this sort of failed sate. I guess that's not how it's supposed to be - I would like to have it in "normal" conditions ;) – SeeSack Nov 15 '18 at 14:12
  • Actually nevermind, it's in your question already: `Nov 14 16:13:51 srvxx apache2[30226]: Starting web server: apache2httpd (pid 29324) already running` – Michael Hampton Nov 15 '18 at 14:13
  • Yep - I know, that's part of the problem, I can stop it. There are no child procecces - nothing that even thinks to listen on port 80 or 443. When I start apache - it complains that it was already running... – SeeSack Nov 15 '18 at 14:23
  • OK, then kill the existing apache2 processes and try again. – Michael Hampton Nov 15 '18 at 14:24
  • I already feel like a mass murder.. I have the feeling it has something to do with mutex configuration - I had to change var/lock/apache2/accept.lock to Mutex file:${APACHE_LOCK_DIR} default while updating apache 2.2 to 2.4 Mutex conf. is: export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX – SeeSack Nov 15 '18 at 14:28
  • Did you actually try killing the existing apache processes? – Michael Hampton Nov 15 '18 at 14:37
  • Yes - I killed it, I stopped it. Searched for any service listening on port 80 and 443 – SeeSack Nov 15 '18 at 15:10
  • Look for duplicate `Listen` directives, then. – Michael Hampton Nov 15 '18 at 15:23
  • There isn't any - see this: Nov 14 16:13:51 srvxx apache2[30226]: Starting web server: apache2httpd (pid 29324) already running, and PID 29324 strats at the same time. 7059 root 0.0 % 14:59 /usr/sbin/apache2 -k start 7137 www-data 1.8 % 14:59 /usr/sbin/apache2 -k start 8039 www-data 0.2 % 15:28 /usr/sbin/apache2 -k start 9077 www-data 3.7 % 15:49 /usr/sbin/apache2 -k start 9100 www-data 1.2 % 15:51 /usr/sbin/apache2 -k start 9225 www-data 4.7 % 15:58 /usr/sbin/apache2 -k start – SeeSack Nov 15 '18 at 15:30

1 Answers1

0

solved 

changed in envars

export APACHE_PID_FILE=/var/run/apache2$SUFFIX.pid

into:

export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid

SeeSack
  • 1
  • 1