Cobra Forum

Plesk Panel => Plesk Service/Interface => Topic started by: mahesh on Nov 06, 2024, 08:01 AM

Title: Error in Plesk: "worker_rlimit_nofile" directive is duplicate
Post by: mahesh on Nov 06, 2024, 08:01 AM
Symptoms
New configuration files for the Apache web server were not created due to the errors in configuration templates: nginx: [emerg] "worker_rlimit_nofile" directive is duplicate in /etc/nginx/ulimit.global_params:1 nginx: configuration file /etc/nginx/nginx.conf test failed

or

New configuration files for the Apache web server were not created due to the errors in configuration templates: nginx: [emerg] "gzip" directive is duplicate in /etc/nginx/conf.d/nginx.conf:2 nginx: configuration file /etc/nginx/nginx.conf test failed

#/usr/local/psa/admin/bin/nginxmng -e
nginx: [emerg] "worker_rlimit_nofile" directive is duplicate in /etc/nginx/ulimit.global_params:1

#nginx -t
nginx: [emerg] "worker_rlimit_nofile" directive is duplicate in /etc/nginx/nginx.conf:45
nginx: configuration file /etc/nginx/nginx.conf test failed

[/list]#grep -r worker_rlimit_nofile /etc/nginx/ | grep -v "#"
/etc/nginx/nginx.conf:worker_rlimit_nofile 20480;
/etc/nginx/ulimit.global_params:worker_rlimit_nofile 65536;

Cause
The Nginx directive returned in the error/s message is defined twice

Resolution
1.Connect to the server using SSH .

2.Open the file from the error message in text editor and comment the duplicated directive with "#":

#cat /etc/nginx/nginx.conf
#worker_rlimit_nofile 20480;

Note: In the example above the directive is worker_rlimit_nofile

3.If Nginx was not working, re-enable it with the commands:
#/usr/local/psa/admin/bin/nginxmng -d
# /usr/local/psa/admin/bin/nginxmng -e

If it was already working, just reload it as follows:

#service nginx reload
[/list]