skip to Main Content

So, long story short, the latest version of Apache was causing some errors with my particular setup so I did a quick on-the-fly upgrade to PHP 7.1.6, swapped to mpm-event, and started using PHP-FPM. I guess it probably reinstalled MySQL somewhere in there too.

The front end of my WordPress site seemed relatively fine after the upgrade. The admin dashboard is okay sometimes — but every so often trying to post a new page, or do something similar it will hang indefinitely. If I restart Apache it snaps back to attention, but nothing short of restarting the service seems to do the trick.

During this time, the frontend of my site will also start hanging until I restart Apache.

Obviously, there’s something wrong with my configuration somewhere, but I’m having a really tough time pinpointing what it is. The front-end of my site is super quick until I do something on the back-end that decides to stall it all out.

I’ve been checking every error log I can think of, but I don’t see anything happening in the apache2 error log when this happens. As far as I can tell I enabled PHP-fpm error logging but I don’t see anything showing up there either.

How can I figure out what’s going wrong at this point?

Any help would really be appreciated. I’ve spent at least fifteen hours trying to figure this out already with zero progress.

Thanks, guys.


php -v
PHP 7.1.6-1~ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jun  9 2017 08:26:34) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.1.6-1~ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies

apache2 -v
Server version: Apache/2.4.26 (Ubuntu)
Server built:   2017-06-30T08:42:23

/var/log/apache2/error.log — not reporting any errors.

/var/log/fpm-php.www.log — empty.

/var/log/mysql.err — empty.

/var/log/mysql.log — empty.

/var/log/php7.1-fpm.log

[04-Jul-2017 02:08:40] NOTICE: fpm is running, pid 741
[04-Jul-2017 02:08:40] NOTICE: ready to handle connections
[04-Jul-2017 02:08:40] NOTICE: systemd monitor interval set to 10000ms

PHP modules —

php -m
[PHP Modules]
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
igbinary
json
libxml
mbstring
mcrypt
memcached
msgpack
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
redis
Reflection
session
shmop
SimpleXML
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zlib

[Zend Modules]
Zend OPcache

a2query -m:

a2query -m
dir (enabled by maintainer script)
headers (enabled by site administrator)
env (enabled by maintainer script)
authz_host (enabled by maintainer script)
reqtimeout (enabled by maintainer script)
include (enabled by site administrator)
rewrite (enabled by site administrator)
auth_basic (enabled by maintainer script)
alias (enabled by maintainer script)
authz_core (enabled by maintainer script)
asis (enabled by site administrator)
status (enabled by maintainer script)
cache (enabled by site administrator)
echo (enabled by site administrator)
autoindex (enabled by maintainer script)
authz_user (enabled by maintainer script)
fastcgi (enabled by maintainer script)
actions (enabled by site administrator)
filter (enabled by maintainer script)
mime (enabled by maintainer script)
expires (enabled by site administrator)
setenvif (enabled by maintainer script)
mpm_event (enabled by site administrator)
socache_shmcb (enabled by site administrator)
authn_file (enabled by maintainer script)
proxy (enabled by site administrator)
access_compat (enabled by maintainer script)
ssl (enabled by site administrator)
deflate (enabled by maintainer script)
authn_core (enabled by maintainer script)
suexec (enabled by site administrator)
negotiation (enabled by maintainer script)
proxy_fcgi (enabled by site administrator)
speling (enabled by site administrator)
http2 (enabled by maintainer script)
info (enabled by site administrator)
proxy_http2 (enabled by site administrator)

I’m not sure what it is, but /var/log/apport.log contains a few errors like this:

ERROR: apport (pid 12399) Tue Jul  4 00:26:27 2017: called for pid 12251, signal 11, core limit 0
ERROR: apport (pid 12399) Tue Jul  4 00:26:27 2017: executable: /usr/sbin/apache2 (command line "/usr/sbin/apache2 -k start")
ERROR: apport (pid 12399) Tue Jul  4 00:26:27 2017: is_closing_session(): no DBUS_SESSION_BUS_ADDRESS in environment
ERROR: apport (pid 12399) Tue Jul  4 00:26:27 2017: apport: report /var/crash/_usr_sbin_apache2.0.crash already exists and unseen, doing nothing to avoid disk usage DoS

/var/log/kern.log:

Jul  4 02:08:39 localhost kernel: [    2.667815] ppdev: user-space parallel port driver
Jul  4 02:08:39 localhost kernel: [    2.691111] Request for unknown module key 'Magrathea: Glacier signing key: d120c47c14beb62ead6703d41712cc110575d297' err -11
Jul  4 02:08:39 localhost kernel: [    2.716583] Request for unknown module key 'Magrathea: Glacier signing key: d120c47c14beb62ead6703d41712cc110575d297' err -11
Jul  4 02:08:39 localhost kernel: [    2.717334] Request for unknown module key 'Magrathea: Glacier signing key: d120c47c14beb62ead6703d41712cc110575d297' err -11
Jul  4 02:08:40 localhost kernel: [    5.345061] audit: type=1400 audit(1499148520.484:8): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/874/status" pid=874 comm="mysqld" requeste$
Jul  4 02:08:40 localhost kernel: [    5.345262] audit: type=1400 audit(1499148520.484:9): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=874 comm="mysqld"$
Jul  4 02:08:40 localhost kernel: [    5.345373] audit: type=1400 audit(1499148520.484:10): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/874/status" pid=874 comm="mysqld" request$
Jul  4 02:08:40 localhost kernel: [    5.391287] random: nonblocking pool is initialized
Jul  4 02:08:40 localhost kernel: [    5.577297] Request for unknown module key 'Magrathea: Glacier signing key: d120c47c14beb62ead6703d41712cc110575d297' err -11
Jul  4 02:10:10 localhost kernel: [   95.097387] perf interrupt took too long (2626 > 2500), lowering kernel.perf_event_max_sample_rate to 50000
Jul  4 02:26:07 localhost kernel: [ 1052.647086] audit: type=1400 audit(1499149567.761:11): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/1445/status" pid=1445 comm="mysqld" reque$
Jul  4 02:26:07 localhost kernel: [ 1052.647352] audit: type=1400 audit(1499149567.761:12): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=1445 comm="mysql$
Jul  4 02:26:07 localhost kernel: [ 1052.647513] audit: type=1400 audit(1499149567.761:13): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/1445/status" pid=1445 comm="mysqld" reque$
Jul  4 02:26:23 localhost kernel: [ 1067.895962] audit: type=1400 audit(1499149583.008:14): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/1446/status" pid=1446 comm="mysqld" reque$
Jul  4 02:26:23 localhost kernel: [ 1067.896241] audit: type=1400 audit(1499149583.012:15): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=1446 comm="mysql$
Jul  4 02:26:23 localhost kernel: [ 1067.896340] audit: type=1400 audit(1499149583.012:16): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/1446/status" pid=1446 comm="mysqld" reque$
Jul  4 02:31:19 localhost kernel: [ 1364.640301] perf interrupt took too long (5248 > 5000), lowering kernel.perf_event_max_sample_rate to 25000
Jul  4 02:37:26 localhost kernel: [ 1731.575398] audit: type=1400 audit(1499150246.686:17): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/1540/status" pid=1540 comm="mysqld" reque$
Jul  4 02:37:26 localhost kernel: [ 1731.575508] audit: type=1400 audit(1499150246.686:18): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=1540 comm="mysql$
Jul  4 02:37:26 localhost kernel: [ 1731.575596] audit: type=1400 audit(1499150246.686:19): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/1540/status" pid=1540 comm="mysqld" reque$
Jul  4 02:42:49 localhost kernel: [ 2054.276362] perf interrupt took too long (10122 > 10000), lowering kernel.perf_event_max_sample_rate to 12500
Jul  4 04:00:02 localhost kernel: [ 6687.106794] perf interrupt took too long (20184 > 20000), lowering kernel.perf_event_max_sample_rate to 6250

Will get more information edited in shortly.

2

Answers


  1. Chosen as BEST ANSWER

    I noticed today that my server was reporting an available update for Apache. I am slightly confused because 'apache2 -v' showed 2.4.27 both before and after this update. But whatever it was fixed my problem.

    Related to CVE-2017-9789, perhaps.


  2. Go to “wp-config.php” and set “WP_DEBUG” to true just like in the following example:

    define( 'WP_DEBUG', true );

    Now refresh the frontend and the backend page in order to be able to see the PHP errors.

    You can also go to the admin area, Settings, Permalinks and click once again on the “save” button. This will override the .htaccess file.

    You can install a log service, search on google for logly or sentry. Those might help also.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search