Cobra Forum

Plesk Panel => Webserver => Topic started by: mahesh on Jan 20, 2025, 04:47 AM

Title: Unable to repair web configuration: mktemp: failed to create file via template
Post by: mahesh on Jan 20, 2025, 04:47 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
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
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