error "Too many open files" after apache update

vapetrov

Member
May 24, 2002
20
1
303
Hello,

I used CPanel/WHM 96.0.9 on CentOS 7.
Today Apache webserver and few other rpm's was updated. From yum.log:
--
Jun 02 20:38:49 Updated: ea-apache24-2.4.48-1.1.1.cpanel.x86_64
--

After update Apache was not started. In the error log I see:
--
[Wed Jun 02 20:46:20.415917 2021] [log_config:error] [pid 27684] (24)Too many open files: AH00649: could not open transfer log file /etc/apache2/logs/domlogs/xxxxxx.com. AH00015: Unable to open logs
--

I was able to run the server when I switched on piped logs for apache. But it is not seems a real fix.

I see number of opened files limited to 4096.
--
# ulimit -n
4096
--

I see files /etc/bashrc and some other chenged today. Some ulimit directives was added.

Can someone please explain how to increase number of open files for apache?
 

vapetrov

Member
May 24, 2002
20
1
303
My another server with 200+ account also failed after update.
I have investigated Cpanel docs and found solution:
--
mkdir /usr/lib/systemd/system/httpd.service.d
echo -e "[Service]\nLimitNOFILE=101000" > /usr/lib/systemd/system/httpd.service.d/limits.conf
systemctl daemon-reload
systemctl stop httpd
systemctl start httpd
--

Without this Apache fails when trying to open 1025 files.

But I would like to hear from CPanel staff why it happened?
 
Last edited:
  • Like
Reactions: chrissiepenguin

vacancy

Well-Known Member
Sep 20, 2012
557
223
93
Turkey
cPanel Access Level
Root Administrator
Please try;

Code:
yum clean all
yum -y upgrade
 
  • Like
Reactions: cPRex

andrew.n

Well-Known Member
Jun 9, 2020
965
358
63
EU
cPanel Access Level
Root Administrator
You can also look into these 2: