Unable to activate nginx server and rebuild nginx configuration: Not starting nginx as it is disabled in config

Created:

2016-11-16 12:56:07 UTC

Modified:

2017-04-24 11:13:53 UTC

2

Was this article helpful?


Have more questions?

Submit a request

Unable to activate nginx server and rebuild nginx configuration: Not starting nginx as it is disabled in config

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 12.0 for Linux

Symptoms

Unable to activate nginx server support, the following error appears:

# /usr/local/psa/admin/bin/nginxmng -e
...
Config (13523804010.47553900) generation failed: nginx: [emerg] open() "/var/www/vhosts/example.com/statistics/logs/proxy_access_ssl_log" failed (24: Too many open files)
nginx: configuration file /etc/nginx/nginx.conf test failed

# /etc/init.d/nginx restart
Not starting nginx as it is disabled in config

Plesk GUI also shows the following error:

New configuration files for the Apache web server were not created due to the errors in configuration templates: Template processing failed: 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.

Cause

  1. Nginx reached limit of files to handle.

  2. Some domains had previously saved links to nginx configuration files, but configuration files are missing on the server.

Resolution

  1. Set 'worker_rlimit_nofile' 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 
    worker_rlimit_nofile 65536;
  2. In case if some configuration is present for domains that are not present in Plesk the select will be not null:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e "select c.id, c.objectId as 'domain_id' from Configurations c left join domains d on c.objectId=d.id where c.objectType in ('domain', 'nginxDomain') and d.id is null"

To remove such extra configuration use Webserver Configuration Troubleshooter extension, filter out all erroneous configurations with the help of the "Show Errors" button and remove them using the "Remove" button. Then click the "Rebuild All" button to rebuild the configurations.

  1. Repair vhost structure:

        # /usr/local/psa/bin/repair --update-vhosts-structure
  2. Enable Nginx support by Plesk:

    # /usr/local/psa/admin/bin/nginxmng -e
Have more questions? Submit a request
Please sign in to leave a comment.