- Plesk for Linux
When nginx support is enabled and there are a lot of domains (more than 256), nginx will fail with the following error:
CONFIG_TEXT: Apache config (13523804010.47553900) generation failed: nginx: [emerg] open() "/var/www/vhosts/system/example.com/logs/proxy_access_ssl_log" failed (24: Too many open files)
nginx: configuration file /etc/nginx/nginx.conf test failed
Incorrect SSL certificate is assigned to the domain.
- SSL certificate is not updated: after SSL certificate is changed in Plesk old certificate is shown in a web-browser.
- Domain shows only text without CSS.
Nginx's virtual host opens 4 log files for each virtual host with physical hosting:
As a result of this fact, the maximum number of open files is exceeded by nginx server.
Since Plesk 12.5, it is not required to tune this limit. It is getting increased automatically. However, if it is required to change it, use the following shell utility:
# /usr/local/psa/admin/sbin/websrv_ulimits --help
Usage: websrv_ulimits [--nginx|--apache] --set ULIMIT [--no-restart]
Increase limit on number of open files for web-servers ("ulimit nofile").
Note that if existing ulimits are greater than new ones then they are left unchanged.
-s, --set ULIMIT set number of open file ulimits (ulimit -n)
-n, --nginx manage nginx ulimits
-a, --apache manage apache ulimits
-R, --no-restart do not reconfigure/restart webservers
Example of usage:
# /usr/local/psa/admin/sbin/websrv_ulimits --set 4096
It will set an open files limit to 4096 for both Apache and Nginx (if present).
For Plesk 12.0 and lower:
- Connect to the server using SSH
Set the required
ULIMITvalue in the nginx configuration:
# echo 'NGINX_ULIMIT="-n 4096"' >> /etc/default/nginx
# echo 'NGINX_ULIMIT="-n 4096"' >> /etc/sysconfig/nginx
worker_rlimit_nofilevalue in the nginx configuration to increase the maximum number of opened files allowed by the worker process:
# grep "worker_rlimit_nofile" /etc/nginx/nginx.conf
- This step should be done for systems using systemd only (instead of SysV and LSB):
LimitNOFILEshould be increased in
[Service]section. To do so, modify
systemddaemon should be reloaded after any changes in the unit configuration files:
# systemctl --system daemon-reload
# service nginx restart
Regenerate the web server configuration:
# /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
Note: If execution of
nginx -t command still produces
Too many open files error, check limits for
root user in
/etc/security/limits.conf configuration file and increase them as well.