Author Topic: Nginx does not start  (Read 6303 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Nginx does not start
« on: April 30, 2020, 01:26:47 PM »
Hi guys,

I'm having a problem putting Apache + nginx + varnish to work, nginx does not start showing the following error:

emerg] 49623 # 49623: open () "/usr/local/apache/domlogs/domainserver.error.log" failed (24: Too many open files)

Does anyone have an idea of what it might be? Or have you faced a similar problem?

Offline
*****
Re: Nginx does not start
« Reply #1 on: April 30, 2020, 05:44:23 PM »
increase the open file limit for the service or the server.

Offline
*
Re: Nginx does not start
« Reply #2 on: May 01, 2020, 06:15:44 PM »
increase the open file limit for the service or the server.

thanks Sandeep

and how would it be ?, I've tried to do this following some tips from other forums and sites but still have the same problem.

Offline
*
Re: Nginx does not start
« Reply #3 on: May 02, 2020, 02:52:41 AM »
Hi guys,

I managed to solve.

Just follow these steps:


Create file /etc/systemd/system/nginx.service.d/override.conf with the following contents:
insert
[Service]
LimitNOFILE=65536

Reload systemd daemon with:
systemctl daemon-reload

Add this to Nginx config file:
worker_rlimit_nofile 16384; (has to be smaller or equal to LimitNOFILE set above)

And finally restart Nginx:
systemctl restart nginx