Cobra Forum

Plesk Panel => Webserver => Topic started by: Suhitha on Oct 23, 2025, 05:11 AM

Title: Unable to repair web configuration: mktemp: failed to create file via template '
Post by: Suhitha on Oct 23, 2025, 05:11 AM
Question: Unable to repair web configuration: mktemp: failed to create file via template '/etc/nginx/plesk.conf.d/server.conf.XXXXXX': No such file or directory


Applicable to:



Symptoms


ERR [panel] Apache config
(16100623580.33783700) generation failed: Template_Exception:
mkdir: cannot create directory '/etc/nginx/plesk.conf.d': No
such file or directory
mktemp: failed to create file via template
'/etc/nginx/plesk.conf.d/server.conf.XXXXXX': No such file or
directory
Can not create temporary file

file:
/opt/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
mkdir: cannot create directory '/etc/nginx/plesk.conf.d': No
such file or directory
mktemp: failed to create file via template
'/etc/nginx/plesk.conf.d/server.conf.XXXXXX': No such file or
directory
Can not create temporary file


# nginx -t
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory)
2021/01/08 04:02:22 [emerg] 32934#0: open() "/etc/nginx/nginx.conf" failed (2: No such file or directory)
nginx: configuration file /etc/nginx/nginx.conf test failed


Cause

Plesk ships its own, pre-configured nginx.

The installed nginx package corrupted or replaced with incorrect one.


Resolution

                                                      via Plesk UI

1.Log into Plesk

2.Go to Tools & Settings > Updates > Add/Remove Components

3.Uninstall nginx

4.Install it back in the same way

5.Repair web configuration


                                                      via CLI

1.Connect to the server via SSH

2.Remove nginx

# /usr/local/psa/admin/bin/autoinstaller --select-product-id plesk --select-release-current --remove-component nginx

3.Install nginx

# plesk installer --select-release-current --install-component nginx

4.Repair the configuration:

# plesk repair web -y