44

My apache server is running OK without any problems. It also doesn't issue any warning during restart. However, if I examine error.log I can see the following lines repeating from time to time:

[Wed Jun 25 18:15:56.295408 2014] [mpm_prefork:notice] [pid 8817] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4 configured -- resuming normal operations
[Wed Jun 25 18:15:56.295570 2014] [core:notice] [pid 8817] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jun 25 18:26:34.511247 2014] [mpm_prefork:notice] [pid 8817] AH00169: caught SIGTERM, shutting down

What do they say? How can I fix it?

Max Koretskyi
  • 767
  • 1
  • 8
  • 16

1 Answers1

51

The log file just shows some startups/shutdowns of Apache workers. In your Apache configuration, you can set how many workers (aka threads) Apache may use. On a regular setup, Apache can be started several times. Especially when your server is busy (e.g. there are many visitors on one of your vhosts), it's not strange to see 20 (or more) Apache processes running. There is nothing to worry about, they're just informational.

[mpm_prefork:notice] [pid 8817] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4 configured -- resuming normal operations

This means a new thread spawned under process id 8817.

[core:notice] [pid 8817] AH00094: Command line: '/usr/sbin/apache2'

This is just a notice saying that the /usr/sbin/apache2 command was used to start the thread, so no special flags/options were passed to it.

[mpm_prefork:notice] [pid 8817] AH00169: caught SIGTERM, shutting down

This line tells you that the process with process id 8817 has shut down again.

[Updated] This log was invoked by /etc/apache2/apache2.conf which it has the directive pointing to the log file that you are seeing at. To see less of the logging, you can edit this line in apache2.conf LogLevel warn to LogLevel error which will log only if there is error that causing the server to malfunction. Options for that logging are: trace1, debug, info, notice, warn, error, crit, alert, emerg. You can play with all of these options to find which logging level you like the most.

To see the log for your domain, you can find that in your conf file that hold the configurations for the domain host in /etc/apache2/sites-available. I.e. yoursite.conf

Faron
  • 107
  • 6
Oldskool
  • 2,025
  • 1
  • 16
  • 27
  • Thanks, but I'm using prefork MPM, so there are no threads. Do you mean when new child process starts? – Max Koretskyi Jun 25 '14 at 15:43
  • 1
    The prefork module can be configured to start `StartServers` server processes at startup, spawn up to `MaxClients` processes if the server gets busy and maintain `MaxSpareServers` spare processes, so it might be that the log entries you see are a result of additional spawned processes that are killed again if the server gets less busy. – Sven Jun 25 '14 at 16:10
  • Thanks, now I see your point. I'm wondering though why then this is treated as errors since I've found them in `error.log`? By the way, do you know if there is any difference between having two servers with 5 MaxClients and having one with 10 MaxClients? – Max Koretskyi Jun 25 '14 at 19:55
  • Is this a problem for a PHP code or not? Will it affect my web application or code execution? – Neocortex Dec 04 '14 at 04:53
  • 5
    these are not errors, they are just informational notices. error.log is misnamed; much of what goes to it is informational only. – ysth May 21 '15 at 17:25
  • To see less of the logging, you can edit this line in `/etc/apache2/apache2.conf` `LogLevel warn` to `LogLevel error` which will log only if there is error that causing the server to malfunction. Options for that logging are: trace1, debug, info, notice, warn, error, crit, alert, emerg. You can play with all of these options to find which logging level you like the most. – Faron Oct 07 '15 at 23:59
  • Why does Apache consider these items errors? How do we fix the errors? The one that baffles me is ***`AH00094: Command line: '/usr/sbin/apache2'`***. What does Apache consider a non-error'ed way to start it? –  Oct 30 '16 at 00:22
  • @jww They're not errors. Also see http://serverfault.com/questions/607873/apache-is-ok-but-what-is-this-in-error-log-mpm-preforknotice/607880#comment855789_607880 – Oldskool Oct 30 '16 at 18:22