Apache stopped unexpectedly, how to find the reason?

Keywords: WordPress - AWS - Technical issue - Services (Apache, MariaDB, MySQL…)

bnsupport ID: ab71608c-3b6d-9c86-5e80-039b891b5f8f

bndiagnostic output:

? Apache: Found possible issues
? Connectivity: Found possible issues
https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-errors-apache/
https://docs.bitnami.com/general/faq/administration/use-firewall/

bndiagnostic failure reason: The suggested guides are not related with my issue

Description:
HTTP request failed, so I restarted Apache by
sudo /opt/bitnami/ctlscript.sh restart apache
and everything works fine.
But the next day HTTP request failed again, this time I run
ps aux | grep httpd
and it seems Apache’s process stopped unexpectedly.

If I restart Apache everything works fine. How do I debug Apache’s periodic failing?

I checked /opt/binamini/apache/logs/access_log and error_log, not helpful (there is error log but it doesn’t seem related).
I also run top command, load average is low, memory is enough.
I run df command, the storage is enough too.

By the way the error_log says

[Wed Oct 13 04:15:53.869929 2021] [proxy_fcgi:error] [pid 19852:tid 140322319349504] [client 70.132.8.138:59942] AH01071: Got error 'PHP message: 
PHP Notice:  Unknown: file created in the system's temporary directory in Unknown on line 0', referer: https://xxxx.com/events/wp-admin/post.php?post=118&action=edit

Hello @shintanoid,

To fix that error try the following command:

$ sudo chmod o+w /opt/bitnami/php/tmp

Could you please take a look at our guides?
https://docs.bitnami.com/aws/faq/troubleshooting/troubleshoot-server-performance/
https://docs.bitnami.com/aws/how-to/troubleshoot-wordpress-issues/
https://docs.bitnami.com/aws/apps/wordpress/troubleshooting/deny-connections-bots-apache/

I hope it helps

Thanks davidg! I believe your command will solve the error.

However, I think the above error is not the reason Apache crashed. Do you have any idea why Apache stop unexpectedly?

(I read the above three guides, cannot find any clue. The only suspicious one is that there are more than 20 php-fpm processes running, not sure if that’s related)

@davidg
By the way, the error_log file is more than 10 megabyte (though I have already solved most of the error), not sure if the file size matters.

Hello @shintanoid,

This is our guide to configure php-fpm:
https://docs.bitnami.com/aws/apps/wordpress-multisite/configuration/configure-phpfpm-options/

This guide may help to set the correct value for php-fpm processes (even though it is focused on nginx):
https://www.kinamo.be/en/support/faq/determining-the-correct-number-of-child-processes-for-php-fpm-on-nginx

However, php/logs/php-fpm.log file is empty, so I don’t think it is the problem.

Let me also share with you this guide to optimize WP:
https://docs.bitnami.com/aws/apps/wordpress/troubleshooting/optimize-bitnami-wordpress/

Regards

Thanks @davidg

We still cannot find the reason, so we implemented a cron job to restart Apache if it failed. It does not resolve the problem, but it does mitigate the impact.