June 9, 2015

Error: No space left on device: mod_rewrite: Parent could not create RewriteLock file

Apache  service on a Server stops while restart it shows following messages in error_logs
[Sun Dec 28 08:20:20 2014] [crit] (28)No space left on device: mod_rewrite: Parent could not create RewriteLock file /usr/local/apache/logs/rewrite_lock
Configuration Failed
Such errors appears when you are running out of Disk Space or Quota which is assigned (which can be increased to fix the issue) OR when semaphores of the server gets full. Semaphores are often used to restrict the number of threads than can access some (physical or logical) resource.
Using the below command you can semaphores list.
root@server04 [~]# ipcs -s | grep nobody
So, In-order to clear the semaphores list. We have execute the following command.
root@server04 [~]# ipcs -s | grep nobody | awk '{print $2}' | xargs -n 1 ipcrm sem
After clearing the semaphores list, restart the apache server. Now, it will starts without any issues.But, it is an temporary solution it will re-occur when Semaphores get full.
Add following lines in “/etc/sysctl.conf” to get this issue fixed permanently. These values will increase the limits of Semaphores on the Server.
# Increases the semaphore limits & extend Apache’s uptime.
kernel.msgmni = 512
kernel.sem = 250 128000 32 512
Then load the new settings into the kernel using the command.
root@server04 [~]# sysctl -p
Now you are in safe zone. :)

Related Posts:

  • cPanel Log file locations All cPanel log file locations and Basic troubleshooting, most activity that happens on a server to log files, so that you can go back and review log entries for problems, instead of having to be on the server at the time of… Read More
  • How to Clean Log Files Before You Enable Log Rotation Checking disk space usage and removing old log files cPanel & WHM create and maintain log files. These log files allow you to examine errors and other occurrences on the system. After an extended period of time, the sy… Read More
  • Disk Space for MySQL Databases in cPanel Show as 0MB When you upgrade from cPanel 11.24 to 11.25, your users may notice that in cPanel, their MySQL databases show 0MB of disk space used, when they know their databases are much larger. This is due to an option in cPanel that yo… Read More
  • 11 Ways to Free Up Disk Space on a cPanel Server I’m sure that most of you have been to the point where one or more of your servers start to fill up as you get more customers. The server’s performing just fine, but there’s one problem…you’re out of disk space! Here are a f… Read More
  • 5 Ways to Get a User’s Disk Usage This may seem pretty simple, but I see a lot of questions about how to get a user’s disk space usage on a cPanel user. I put together a quick list of 5 simple ways for the average admin:  1) Good ole’ cPanel/WHM. You c… Read More

0 comments:

Post a Comment