Applicable to:
- Plesk for Linux
Symptoms
-
Websites are showing 502 Bad Gateway
-
Apache is stopped and fails to start with the following message:
# service httpd start
Starting httpd: Syntax error on line 16 of /etc/httpd/conf/plesk.conf.d/server.conf:
DocumentRoot must be a directory
[FAILED]or with the following one:
# service httpd start
Starting httpd: Syntax error on line 16 of /etc/httpd/conf/plesk.conf.d/server.conf:
DocumentRoot '/var/www/vhosts/default/htdocs' is not a directory, or is not readable
[FAILED]
Cause
Default document root is missing or has incorrect ownership.
Resolution
- Connect to the server via SSH.
-
Find the path to the document root in
/etc/httpd/conf/plesk.conf.d/server.conf
file.
By default it is set as/var/www/vhosts/default/htdocs
:# grep 'DocumentRoot' /etc/httpd/conf/plesk.conf.d/server.conf
DocumentRoot "/var/www/vhosts/default/htdocs" -
Check if the directory exists on a server:
# ls -ld /var/www/vhosts/default/htdocs
ls: cannot access /var/www/vhosts/default/htdocs: No such file or directory -
Create directory if it is missing:
# mkdir /var/www/vhosts/default/htdocs
-
Set correct ownership:
# chown root:root /var/www/vhosts/default/htdocs
-
Start Apache:
# service httpd start
Note: if the directory is different in the path, do the same for it.
Comments
0 comments
Please sign in to leave a comment.