- Log directory
/var/www/vhosts/example.com/logsis empty after domain creation, but
/var/www/vhosts/system/example.com/logscontain all log files
- There are a lot of domains on the server (more than 500)
- Apache restart interval is 0 or less than 60 seconds
Due to a large number of domains on a server, Apache configuration files for logs get created faster than the directory for logs, thus, apache gets restarted prior to
/var/www/vhosts/domain/logs being created. As domain's webspace is not fully generated yet, logs do not get relinked after statistics recalculation too.
1. Increase apache restart interval to at least 90 seconds in Plesk > Tools & Settings > Apache Web Server Settings > Apache restart interval
2. Run the following command to relink logs from /var/www/vhosts/system/example.com/logs directory:
# /usr/local/psa/admin/sbin/relink-vhost-logs --create --domain-name example.com --sys-user-login plesktest --defer 10 --webspace-name example.com
Logs will be relinked asynchronously in the background after 10 seconds.