• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved Synchronizing access log problem

frame86

New Pleskian
Server operating system version
Ubuntu 18.04.4 LTS
Plesk version and microupdate number
18.0.50
Hello,

which service / job is responsible for synchronizing access logs to user home directories?

The logs in vhosts/system are still written but for some reason stopped to sychronize - all domains are affected.
 
Already did that. Besides that, shouldn't it run as root anyway? Access logs are owned by root.

We just want to know how the synchronization is done.

If it is done by PHP then maybe AppArmor blocks something but does not log it.
if it is done by a job please tell us which one so we can investigate.
 
I don't think there is a standing order on log syncs as this is a onetime hard link setup, but I may be wrong. As the files in the user logs directories are hard linked to the /var/www/vhosts/system/<domain>/logs files, no manual syncing is necessary. For that reason I thought of the "repair fs", it might also be a "repair web <your domain>" that helps.

You can try to relink the logs like
as root plesk sbin relink-vhost-logs --domain-name <domain.tld> --sys-user-login <subscription user name> --create
If you do not know the subscription user of a domain, this db query will get it for you:
plesk db "select d.name,s.login from domains d join hosting h on d.id = h.dom_id join sys_users s on h.sys_user_id=s.id where d.name='<domain>';"

If you want to relink the files for all domains,
Code:
# mkdir /root/temp
# plesk db -Ne 'select name from domains where htype="vrt_hst"' | xargs -I '{}' mkdir -p /root/temp/'{}' 
# for i in `plesk db -Ne 'select name from domains where htype="vrt_hst"'` ; do mv /var/www/vhosts/$i/logs/* /root/temp/$i/; done
and then
Code:
# plesk db -Nse "select name from domains where htype='vrt_hst'" | while read dom; do export sys=/var/www/vhosts/system/$dom/logs/; ls -1 $sys | while read fil; do ln -P $sys/$fil /var/www/vhosts/$dom/logs/; done; done

If you like, you can check whether the nightly maintenance jobs are running.

You can run these tasks separately, too:
But there is no specific tasks to create or update the hard links.
 
Thank you! I guess that explains why the logs are not working :D

Because we recently changed the mount for /var/www/vhosts and copied all data to a new device - and hardlinks were not preserved then.

Indeed repair -fs didn't check that, find /var/www/vhosts/<domain> -samefile /var/www/vhosts/system/<domain>/logs/access_log shows nothing.
 
Back
Top