Symptoms
All websites hosted in Plesk are not accessible.
The following error message is shown on the Home page in Plesk:
New configuration files for the Apache web server were not created due to the errors in configuration templates: (2)No such file or directory: AH02291: Cannot access directory '/var/www/vhosts/system/example.com/logs/' for error log of vhost defined at /etc/httpd/conf/plesk.conf.d/vhosts/example.com.conf:104
Apache/nginx web-servers cannot be started. The following error messages appear in the system logfile (
/var/log/messageson CentOS/RHEL,on Debian/Ubuntu):
/var/log/syslogApache
httpd: (2)No such file or directory: AH02291: Cannot access directory '/var/www/vhosts/system/example.com/logs/' for error log of vhost defined at /etc/httpd/conf/plesk.conf.d/vhosts/example.com.conf:10
nginx
nginx: [emerg] open() "/var/www/vhosts/system/example.com/logs/proxy_access_ssl_log" failed (2: No such file or directory
Cause
The domain's logs directory does not exist on the server.
Resolution
Connect to the Plesk server via SSH.
Create the missing directories with the command:
# plesk repair fs example.com -y
Re-link the logfiles:
3.1. Remove the
logsdirectory inside domain's directory:# rm -rf /var/www/vhosts/example.com/logs
3.2. Find the system user of a subscription using the command below:
# plesk db "select name, login from domains join hosting on domains.id=hosting.dom_id join sys_users on hosting.sys_user_id=sys_users.id where name='example.com'";
+-------------+-------+
| name | login |
+-------------+-------+
| example.com | jdoe |
+-------------+-------+3.3. Re-link the logfiles:
# plesk sbin relink-vhost-logs --domain-name example.com --sys-user-login jdoe --create
Start the Apache web-server:
on CentOS/RHEL-based distributions:
# service httpd start
on Debian/Ubuntu-based distributions:
# service apache2 start
Start the nginx web-server:
# service nginx start