Symptoms
Web statistics stopped being calculated on a Plesk sever with Centos 7 after updating the AWStats package awstats-7.8-2.el7
.
Cause
Enabled SELinux prevents access to the awstat.pl
script:
# ausearch -i | grep denied | grep awsta
(...)
type=SYSCALL msg=audit(09/26/2022 03:50:48.944:3590929) : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x7f488442e552 a1=O_RDONLY|O_CLOEXEC a2=0x1b6 a3=0x24 items=0 ppid=23226 pid=23227 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=105240 comm=sh exe=/usr/bin/bash subj=system_u:system_r:awstats_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(09/26/2022 03:50:48.944:3590929) : avc: denied { read } for pid=23227 comm=sh name=passwd dev="sda3" ino=409553 scontext=system_u:system_r:awstats_t:s0-s0:c0.c1023 tcontext=system_u:object_r:passwd_file_t:s0 tclass=file permissive=0
This behavior is considered a bug PPPM-13727.
Resolution
Until the bug is fixed, apply the following workaround:
- Log in to Plesk
- Navigate to Tools & Settings > Scheduled Tasks (Cron jobs)
- Press the Add Task
- Set the task type to Run a command and insert the following:
/usr/local/psa/admin/bin/php '/usr/local/psa/admin/plib/DailyMaintainance/task-script.php' 'ExecuteWebStatistics' '--period=daily'
Alternatively, disable SELinux: How to enable/disable SELinux on a server.