• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue apache2 is crashing frequently

FelixB

Basic Pleskian
hey there.

my apache2 service is crashing frequently, and is not able to start it selfs frequently

when it happens i need to kill pid's which are blocking the socket needed and then start apache2 again.

but why?

any ideas?
 
Hello FelixB,

Will you share your Apache log so that I can better understand the nature of the problem?
 
hi sure... the error.log is:

[ N 2018-04-08 01:56:27.2804 11393/T7 age/Cor/CoreMain.cpp:589 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
[ N 2018-04-08 01:56:27.2805 11393/T1 age/Cor/CoreMain.cpp:1080 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
[ N 2018-04-08 01:56:27.2807 11393/Tn Ser/Server.h:886 ]: [ApiServer] Freed 0 spare client objects
[ N 2018-04-08 01:56:27.2807 11393/Tn Ser/Server.h:531 ]: [ApiServer] Shutdown finished
[ N 2018-04-08 01:56:27.2810 11393/Th Ser/Server.h:886 ]: [ServerThr.6] Freed 128 spare client objects
[ N 2018-04-08 01:56:27.2810 11393/Th Ser/Server.h:531 ]: [ServerThr.6] Shutdown finished
[ N 2018-04-08 01:56:27.2811 11393/T9 Ser/Server.h:886 ]: [ServerThr.2] Freed 128 spare client objects
[ N 2018-04-08 01:56:27.2811 11393/T9 Ser/Server.h:531 ]: [ServerThr.2] Shutdown finished
[ N 2018-04-08 01:56:27.2811 11393/Tj Ser/Server.h:886 ]: [ServerThr.7] Freed 128 spare client objects
[ N 2018-04-08 01:56:27.2811 11393/Tj Ser/Server.h:531 ]: [ServerThr.7] Shutdown finished
[ N 2018-04-08 01:56:27.2811 11393/Td Ser/Server.h:886 ]: [ServerThr.4] Freed 128 spare client objects
[ N 2018-04-08 01:56:27.2812 11393/Tl Ser/Server.h:886 ]: [ServerThr.8] Freed 128 spare client objects
[ N 2018-04-08 01:56:27.2812 11393/Td Ser/Server.h:531 ]: [ServerThr.4] Shutdown finished
[ N 2018-04-08 01:56:27.2812 11393/Tb Ser/Server.h:886 ]: [ServerThr.3] Freed 128 spare client objects
[ N 2018-04-08 01:56:27.2812 11393/Tl Ser/Server.h:531 ]: [ServerThr.8] Shutdown finished
[ N 2018-04-08 01:56:27.2812 11393/Tf Ser/Server.h:886 ]: [ServerThr.5] Freed 128 spare client objects
[ N 2018-04-08 01:56:27.2812 11393/Tb Ser/Server.h:531 ]: [ServerThr.3] Shutdown finished
[ N 2018-04-08 01:56:27.2812 11393/Tf Ser/Server.h:531 ]: [ServerThr.5] Shutdown finished
[ N 2018-04-08 01:56:27.2812 11393/T7 Ser/Server.h:886 ]: [ServerThr.1] Freed 128 spare client objects
[ N 2018-04-08 01:56:27.2812 11393/T7 Ser/Server.h:531 ]: [ServerThr.1] Shutdown finished
[ N 2018-04-08 01:56:27.3835 11393/T1 age/Cor/CoreMain.cpp:1150 ]: Passenger core shutdown finished
[Sun Apr 08 04:35:25.148181 2018] [ssl:warn] [pid 12717] AH01909: lists:443:0 server certificate does NOT include an ID which matches the server name
[Sun Apr 08 04:35:25.148544 2018] [ssl:warn] [pid 12717] AH01909: default-2a01_4f8_161_61af__2:443:0 server certificate does NOT include an ID which matches the server name
[Sun Apr 08 04:35:25.148902 2018] [ssl:warn] [pid 12717] AH01909: default-5_9_60_167:443:0 server certificate does NOT include an ID which matches the server name
[Sun Apr 08 04:35:25.149035 2018] [:notice] [pid 12717] ModSecurity for Apache/2.9.0 (ModSecurity: Open Source Web Application Firewall) configured.
[Sun Apr 08 04:35:25.149042 2018] [:notice] [pid 12717] ModSecurity: APR compiled version="1.5.1"; loaded version="1.5.1"
[Sun Apr 08 04:35:25.149047 2018] [:notice] [pid 12717] ModSecurity: PCRE compiled version="8.35 "; loaded version="8.35 2014-04-04"
[Sun Apr 08 04:35:25.149051 2018] [:notice] [pid 12717] ModSecurity: LUA compiled version="Lua 5.1"
[Sun Apr 08 04:35:25.149053 2018] [:notice] [pid 12717] ModSecurity: LIBXML compiled version="2.9.1"
[Sun Apr 08 04:35:25.149056 2018] [:notice] [pid 12717] ModSecurity: Original server signature: Apache
[Sun Apr 08 04:35:25.149059 2018] [:notice] [pid 12717] ModSecurity: Status engine is currently disabled, enable it by set SecStatusEngine to On.
[ N 2018-04-08 04:35:25.1699 12721/T1 age/Wat/WatchdogMain.cpp:1267 ]: Starting Passenger watchdog...

and journal about apache2

Apr 08 02:15:43 xxxxxxxx systemd[1]: Starting LSB: Apache2 web server...
Apr 08 02:15:43 xxxxxxx apache2[7881]: Starting web server: apache2(98)Address already in use: AH00072: make_sock: could not bind to address [::]:7080
Apr 08 02:15:43xxxxxxx apache2[7881]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:7080
Apr 08 02:15:43xxxxxxx apache2[7881]: no listening sockets available, shutting down
Apr 08 02:15:43xxxxxxx apache2[7881]: AH00015: Unable to open logs
Apr 08 02:15:43xxxxxxx apache2[7881]: Action 'start' failed.
Apr 08 02:15:43 xxxxxxx apache2[7881]: The Apache error log may have more information.
Apr 08 02:15:43 xxxxxxx apache2[7881]: .
Apr 08 02:15:43xxxxxxx systemd[1]: Started LSB: Apache2 web server.
Apr 08 02:20:51 xxxxxxx systemd[1]: Stopping LSB: Apache2 web server...
Apr 08 02:20:51 xxxxxxxxxxxxxxxx apache2[9346]: Stopping web server: apache2 failed!
Apr 08 02:20:51 xxxxxxxxxxxxxxxx apache2[9346]: There are processes named 'apache2' running which do not match your pid file which are left untouched in the name of safety, Please review the situation by hand. ... (warning).
Apr 08 02:20:51 xxxxxxxxxxxxxxxx systemd[1]: apache2.service: control process exited, code=exited status=1
Apr 08 02:20:51 xxxxxxxxxxxxxxxx systemd[1]: Stopped LSB: Apache2 web server.
Apr 08 02:20:51 xxxxxxxxxxxxxxxx systemd[1]: Unit apache2.service entered failed state.
Apr 08 02:20:51 xxxxxxxxxxxxxxxx systemd[1]: Starting LSB: Apache2 web server...
Apr 08 02:20:51 xxxxxxxxxxxxxxxx apache2[9412]: Starting web server: apache2(98)Address already in use: AH00072: make_sock: could not bind to address [::]:7080
Apr 08 02:20:51 xxxxxxxxxxxxxxxx apache2[9412]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:7080
Apr 08 02:20:51 xxxxxxxxxxxxxxxx apache2[9412]: no listening sockets available, shutting down
Apr 08 02:20:51 xxxxxxxxxxxxxxxx apache2[9412]: AH00015: Unable to open logs
Apr 08 02:20:51 xxxxxxxxxxxxxxxx apache2[9412]: Action 'start' failed.
Apr 08 02:20:51 xxxxxxxxxxxxxxxx apache2[9412]: The Apache error log may have more information.
Apr 08 02:20:51 xxxxxxxxxxxxxxxx apache2[9412]: .
Apr 08 02:20:51 xxxxxxxxxxxxxxxx systemd[1]: Started LSB: Apache2 web server.
Apr 08 04:35:10 xxxxxxxxxxxxxxxx apache2[12665]: Stopping web server: apache2.
Apr 08 04:35:24 xxxxxxxxxxxxxxxx systemd[1]: Starting LSB: Apache2 web server...
Apr 08 04:35:26 xxxxxxxxxxxxxxxx apache2[12702]: Starting web server: apache2.
Apr 08 04:35:26 xxxxxxxxxxxxxxxx systemd[1]: Started LSB: Apache2 web server.
Apr 08 07:36:22 xxxxxxxxxxxxxxxx systemd[1]: Reloading LSB: Apache2 web server.
Apr 08 07:36:23 xxxxxxxxxxxxxxxx apache2[22764]: Reloading web server: apache2.
Apr 08 07:36:23 xxxxxxxxxxxxxxxx systemd[1]: Reloaded LSB: Apache2 web server.
Apr 08 07:36:23 xxxxxxxxxxxxxxxx systemd[1]: Reloading LSB: Apache2 web server.
Apr 08 07:36:24 xxxxxxxxxxxxxxxx apache2[22806]: Reloading web server: apache2.
Apr 08 07:36:24 xxxxxxxxxxxxxxxx systemd[1]: Reloaded LSB: Apache2 web server.
Apr 08 08:39:44 xxxxxxxxxxxxxxxx systemd[1]: Stopping LSB: Apache2 web server...
Apr 08 08:39:49 xxxxxxxxxxxxxxxx apache2[25549]: Stopping web server: apache2.
Apr 08 08:39:49 xxxxxxxxxxxxxxxx systemd[1]: Stopped LSB: Apache2 web server.

what do you think?
 
It seems that adres on port 7080 is already in use, causing the problem, you have to check your configuration file.
 
It seems that adres on port 7080 is already in use, causing the problem, you have to check your configuration file.

should I really make changes to a conf file? I ask because apache2 is installed and managed by Plesk.. I think if I change the config file myself it would be a risk for Plesk...

It seems apache was not stopped completely or started to early. which settings do you have in Apache Restart Interval in Tools & Settings > Apache Web Server? and do you have the Watchdog extension installed and enabled?

Well the settings are:

Apache restart interval -> 0
Piped logs -> deactivated
MPM Mode -> Prefork

some modules are enabled... need to list all here?


should I try to enable this?
 
Back
Top