"New files of configuration for Apache web server were not built due to errors in configuration templates: mkdir: cannot create directory"

Created:

2016-11-16 12:56:56 UTC

Modified:

2017-04-24 11:16:28 UTC

1

Was this article helpful?


Have more questions?

Submit a request

"New files of configuration for Apache web server were not built due to errors in configuration templates: mkdir: cannot create directory"

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 10.4 for Linux
  • Plesk Onyx for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux
  • Plesk 10.3 for Linux
  • Plesk 10.x and below for Linux

The solution for Parallels Plesk 11.5 is described in article #213948625 .

Symptoms

The web server configuration cannot be built. The following error is displayed in the Parallels Plesk interface:

New files of configuration for Apache web server were not built due to errors in configuration templates: mkdir: cannot create directory `/var/www/vhosts/domain1.test/conf': No such file or directory

Cause

This problem occurs when a virtual host directory has been removed, but a domain/subdomain is still set up to have physical hosting in Plesk. As a result, the utility httpdmng fails to create configuration files.

Resolution

Download, unpack, make executable, and run the script attached to this article:

# wget http://kb.plesk.com/Attachments/kcs-5698/fix_vhosts.sh.zip
# unzip fix_vhosts.sh.zip
# chmod +x fix_vhosts.sh
# ./fix_vhosts.sh

The script will find all domains with enabled physical hosting that have missing virtual host directories and recreate the basic virtual host structure for these domains. If the sub-directories "conf" or "statistics/logs" are missing, they will also be recreated with the correct permissions/ownerships.

The web server configuration will then be rebuilt from scratch using the method provided in KB article #213927145 .

Example of script output:

# ./fix_vhosts.sh
sub1.domain.test: no physical hosting definition in database.
customer1.tld: creating basic virtual host structure: ok
customer1.tld: creating 'conf' directory: ok
customer1.tld: creating 'logs' directory: ok

Rebuilding Apache configuration:
ok
Have more questions? Submit a request
Please sign in to leave a comment.