Plesk

Unable to start Apache/nginx on a Plesk server: AH02291: Cannot access directory for error log of vhost

Symptoms

Cause

The domain's logs directory does not exist on the server.

Resolution

  1. Connect to the Plesk server via SSH.

  2. Create the missing directories with the command:

    # plesk repair fs example.com -y

  3. Re-link the logfiles:

    3.1. Remove the logs directory 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

  4. Start the Apache web-server:

    • on CentOS/RHEL-based distributions:

      # service httpd start

    • on Debian/Ubuntu-based distributions:

      # service apache2 start

  5. Start the nginx web-server:

    # service nginx start

Exit mobile version