• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Apache - error

The message came:

Unable to generate the web server configuration file on the host <site-audit.com.ua> because of the following errors:

Template_Exception: AH00526: Syntax error on line 9 of /etc/apache2/plesk.conf.d/server.conf:
DocumentRoot must be a directory

file: /opt/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0

Please resolve the errors in web server configuration templates and generate the file again.
 
Please find path to document root in /etc/apache2/plesk.conf.d/server.conf file:

# grep 'DocumentRoot' /etc/apache2/plesk.conf.d/server.conf

Then check if the directory exists on a server.
 
Sorry, what is output of command

# grep 'DocumentRoot' /etc/apache2/plesk.conf.d/server.conf

?
 
Я вообще не касался сервера. Все произошло ночью - вчера все сайты отлично работали
 
It seems to understand:
If the folder htdocs exists, then any non-existent subdomain returns a code of 200 - and this is not correct
I deleted this folder a few days ago - the server worked correctly until the morning today
 
You have found location of DocumentRoot with the command

# grep 'DocumentRoot' /etc/apache2/plesk.conf.d/server.conf

As I see on your screenshot it is /var/www/vhosts/default/htdocs
Now check that this directory exists on a server with

# ls -ld /var/www/vhosts/default/htdocs

What is the ouptut?

P.S. Please do not use any language except official forum language English. Thanks.
P.P.S. Please post text instead of screenshots. Thanks.
 
I created an empty directory again htdocs,
Apache - start,
site - 502 Bad Gateway

ls -ld /var/www/vhosts/default/htdocs

drwxr-xr-x 2 root root 4096 Jul 19 11:21 /var/www/vhosts/default/htdocs
 
Checking Plesk version .............................................. [OK]

Checking for custom configuration templates

Some custom configuration templates have been found. The custom
templates have higher priority than default templates in case of
configs generation.
Please check documentation for details:
https://docs.plesk.com/current/redirect.html?book=advanced-administration-guid e-linux&page=68693.htm[WARNING]

Checking for the JkWorkersFile directive in the Apache configuration [OK]

Checking associations between domains and IP addresses .............. [OK]

Checking for corrupted reference between IP collections and IP
addresses ........................................................... [OK]

Checking for links between APS applications and subscriptions ....... [OK]

Checking for the Zend extension declaraion in php.ini ............... [OK]

Check symbolic links for latest virtual host config files ........... [OK]

Checking for system users home directories consistency .............. [OK]

Checking for records with empty name field in the Configurations table[OK]

Checking for nginx ULIMIT value ..................................... [OK]

Checking for extra configurations in database not owned by any object [OK]

Repairing web server configuration

Reinstall SSL/TLS certificates and set the default certificate for all IP addr esses? [Y/n]
 
Thank you. It all seems to have worked

Admin Plesk: nginx - Enabled
consol: /usr/local/psa/admin/sbin/nginxmng -s - Disabled

/usr/local/psa/admin/sbin/nginxmng -e - OK
 
404 error is not for "domain not found", but "resource not found" (e.g. a page, a file).

To catch all non-existent subdomains, create a subdomain with the wildard * character, for example *.mydomain.ru. Then place content into its home directory that returns the desired action, e.g. a PHP script that returns a 404 error code. Maybe you can simply choose to redirect the wildcard subdomain to an existing domain.

The question is a different topic. Maybe you can choose to create a separate thread for future add-on questions that have different topics.
 
Back
Top