Cannot create web server configuration files: mktemp: cannot create temp file

Created:

2016-11-16 13:15:54 UTC

Modified:

2017-08-16 17:33:10 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Cannot create web server configuration files: mktemp: cannot create temp file

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 10.x for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Symptoms

The following error is displayed on the Plesk homepage when trying to rebuild web server configuration files:

New configuration files for the Apache web server were not created due to the errors in configuration templates: mkdir: cannot create directory `/var/www/vhosts/system/example.com/conf': No such file or directory mktemp: cannot create temp file /var/www/vhosts/system/example.com/conf/httpd.conf.XXXXXX: No such file or directory Can not create temporary file. The error message containing the detailed error descriptions was sent to you by e-mail. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files.

When trying to create configuration files from console, the following error will be shown:

# /usr/local/psa/admin/bin/httpdmng --reconfigure-all
mkdir: cannot create directory `/var/www/vhosts/system/example.com/conf': No such file or directory
mktemp: failed to create file via template `/var/www/vhosts/system/example.com/conf/httpd.conf.XXXXXX': No such file or directory
Can not create temporary file

Cause

The virtual host structure is corrupted/not upgraded and some directories are missing.

Resolution

  1. Repair vhosts structure:

    # /usr/local/psa/bin/repair --update-vhosts-structure

    If command doesn't create missing directories from the error automatically, create them manually. For example:

    # mkdir -p /home/vhosts/system/domain.tld/conf
  2. Re-create web server configuration files:

    # /usr/local/psa/admin/bin/httpdmng --reconfigure-all

WARNING The httpdmng utility with --reconfigure-all option can cause a significant downtime during its execution in case of big number of hosted domains, especially if rebuilding is being failed. So, it is recommended to rebuild web server configuration files by bunches:

    # /usr/local/psa/admin/bin/httpdmng --reconfigure-domains <domain_name>[,<domain_name>[,<domain_name>[,...]]]

For more information about usabage of httpdmng check it with --help option

Additional information

For Plesk versions prior to 11.5, the solution is described in the article #115979 .

Have more questions? Submit a request
Please sign in to leave a comment.