Could not start RewriteMap program error

Erik1

Member
Dec 13, 2014
24
1
3
cPanel Access Level
Root Administrator
My VPS (CENTOS 6.9) stops working every two or three weeks. If I restart the server everything works again. Below are the last lines of the error log of last two crashes. What could be the cause?

Code:
[Tue Jan 09 02:01:54.848979 2018] [mpm_prefork:error] [pid 9826] (12)Cannot allocate memory: AH00159: fork: Unable to fork new process
[Tue Jan 09 02:01:59.117192 2018] [proxy_fcgi:error] [pid 2101] [client 12.12.12.12:48362] AH01071: Got error 'Primary script unknown\n'
[Tue Jan 09 02:02:02.437228 2018] [proxy_fcgi:error] [pid 2101] [client 12.12.12.12:48362] AH01071: Got error 'Primary script unknown\n'
[Tue Jan 09 02:02:04.849098 2018] [mpm_prefork:notice] [pid 9826] AH00171: Graceful restart requested, doing restart
[Tue Jan 09 02:02:05.199001 2018] [rewrite:error] [pid 9826] (12)Cannot allocate memory: AH00654: mod_rewrite: could not start RewriteMap program /usr/local/cpanel/bin/leechprotect
[Tue Jan 09 02:02:05.199043 2018] [:emerg] [pid 9826] AH00020: Configuration Failed, exiting
[Tue Jan 09 02:02:26.873776 2018] [proxy_fcgi:error] [pid 2049] [client 12.12.12.12:39997] AH01071: Got error 'Primary script unknown\n'
Code:
[Thu Dec 28 23:51:11.912166 2017] [proxy_fcgi:error] [pid 12999] [client 12.12.12.12:50872] AH01071: Got error 'Primary script unknown\n'
[Thu Dec 28 23:57:25.505462 2017] [proxy_fcgi:error] [pid 13068] [client 12.12.12.12:55743] AH01071: Got error 'Primary script unknown\n'
[Thu Dec 28 23:58:15.357033 2017] [proxy_fcgi:error] [pid 13176] [client 12.12.12.12:50489] AH01071: Got error 'Primary script unknown\n'
[Fri Dec 29 00:00:21.539281 2017] [mpm_prefork:notice] [pid 1468] AH00171: Graceful restart requested, doing restart
[Fri Dec 29 00:00:23.577980 2017] [rewrite:error] [pid 1468] (12)Cannot allocate memory: AH00654: mod_rewrite: could not start RewriteMap program /usr/local/cpanel/bin/leechprotect
[Fri Dec 29 00:00:23.578018 2017] [:emerg] [pid 1468] AH00020: Configuration Failed, exiting
 

SysSachin

Well-Known Member
Aug 23, 2015
604
48
28
India
cPanel Access Level
Root Administrator
Twitter
Hello,

[Tue Jan 09 02:01:54.848979 2018] [mpm_prefork:error] [pid 9826] (12)Cannot allocate memory: AH00159: fork: Unable to fork new process

This is due to low memory. Please upgrade your vps memory.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,225
463
Hello,

It looks like your VPS is running out of memory. You can use the following command to get a better idea of how much memory is available:

Code:
free -m
Outside of adding more RAM to the VPS, you may want to consider switching to a different MPM (prefork can sometimes result in higher memory usage):

Multi-Processing Modules - MPMs - EasyApache 4 - cPanel Documentation

Thank you.
 

Erik1

Member
Dec 13, 2014
24
1
3
cPanel Access Level
Root Administrator
Code:
free -m

total used free shared buffers cached
Mem: 1024 432 591 3 0 181
-/+ buffers/cache: 250 773

Isn't 40% used memory enough? It is always around this figure.

When I try to get root access I often get error "cannot set user ID: resources temporarily unavailable". I then restart server to get root access.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,225
463
Hello,

The usage looks okay there, but it's possible that it's increasing with more visitors. The following thread is intended for troubleshooting high load averages, but it also includes some information you can use to help determine the source of the resource usage:

Troubleshooting high server loads on Linux servers

Thank you.
 

Erik1

Member
Dec 13, 2014
24
1
3
cPanel Access Level
Root Administrator
Too early, I got a server crash again.

Code:
[Wed Jan 10 14:06:56.870373 2018] [mpm_worker:notice] [pid 1530:tid 140053110179808] AH00297: SIGUSR1 received.  Doing graceful restart
[Wed Jan 10 14:06:56.988685 2018] [ssl:warn] [pid 1530:tid 140053110179808] AH01909: 123.123.123:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jan 10 14:06:56.989137 2018] [ssl:warn] [pid 1530:tid 140053110179808] AH01909: proxy-subdomains-ssl-default-vhost.localhost:443:0 server certificate does NOT include an ID which matches the server name
[Wed Jan 10 14:06:57.001820 2018] [rewrite:error] [pid 1530:tid 140053110179808] (12)Cannot allocate memory: AH00654: mod_rewrite: could not start RewriteMap program /usr/local/cpanel/bin/leechprotect
[Wed Jan 10 14:06:57.001853 2018] [:emerg] [pid 1530:tid 140053110179808] AH00020: Configuration Failed, exiting
Every crash seems to happen after graceful restart and leechprotect that cannot restart. Any more suggestions?

Are the limits.conf settings ok?
Code:
*               soft    core            0
*               soft    nofile          512
*               hard    nofile          1024
*               soft    nproc           2047
*               hard    nproc           16384
ftp             hard    nproc           0
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,225
463
Hello,

Feel free to open a support ticket using the link in my signature so we can take a closer look at your system.

Thank you.
 

Erik1

Member
Dec 13, 2014
24
1
3
cPanel Access Level
Root Administrator
I ended up with an upgrade, from 1GB to 2GB RAM. No problems so far.
Is it normal that the VPS is running at the same % RAM as before, I would expect a usage drop of 50%.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,225
463