Articles in this section

Warnings on Apache restart in Plesk: DocumentRoot does not exist

Plesk for Linux kb: technical ABT: Group A

Applicable to:

  • Plesk for Linux

Symptoms

  1. Warning appear on Apache restart or configuration syntax checking:

    CONFIG_TEXT: Warning: DocumentRoot [/var/www/vhosts/example.com/httpdocs/test1] does not exist: bad user name.

  2. Website is not accessible:

    CONFIG_TEXT: 502 Bad Gateway

  3. Error in Plesk panel:

    PLESK_ERROR: New configuration files for the Apache web server were not created due to the errors in configuration templates: Warning: DocumentRoot [/var/www/vhosts/example.com/httpdocs/test1] does not exist

Cause

Non-existent directory is specified as Document Root for a domain/subdomain in Plesk.  

When reusing this article, please ask the customers which steps have led to this issue - we need steps to reproduce this on a staging server and create a 3rd-line

Resolution

Note: if you don't have access to the server via SSH, contact your hosting provider regarding the issue.

Apply one of the following solutions:

Solution I

  1. Log in to Plesk
  2. Correct the site location for the mentioned domain at Domains > example.com > Hosting Settings.

 

Solution II

  1. Log in to Plesk server via SSH
  2. Identify the correct directory ownership:

    # ls -ld /var/www/vhosts/example.com

  3. Create the directory mentioned in the warning:

    # mkdir -p /var/www/vhosts/example.com/httpdocs/test1

  4. Assign correct ownership:

    # chown exampleuser:psaserv  /var/www/vhosts/example.com/httpdocs/ && chown exampleuser:psaserv  /var/www/vhosts/example.com/httpdocs/test1

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.