هنگام مشاهده خطای زیر در error_log یا هنگام استارت apache
No space left on device: mod_rewrite: could not create rewrite_log_lock
دستور زیر را تایپ کنید :
#ipcs -s
—— Semaphore Arrays ——–
key semid owner perms nsems
0×00000000 327680 nobody 600 1
0×00000000 1540097 nobody 600 1
0×00000000 6225922 nobody 600 1
0×00000000 9175043 nobody 600 1
0×00000000 9306116 nobody 600 1
0×00000000 10027013 nobody 600 1
در صورتی که بیش از 5 خط خروجی دریافت کردید باید با استفاده از دستور زیر آنها را پاک کنید.
ipcs -s | perl -ane '/^0x00000000/ && `ipcrm -s $F[1]`'
1. Check your disk space
This comes first because it’s the easiest to check, and sometimes the quickest to fix. If you’re out of disk space, then you need to fix that problem. http://rackerhacker.com/wp-includes/images/smilies/icon_smile.gif
2. Review filesystem quotas
If your filesystem uses quotas, you might be reaching a quota limit rather than a disk space limit. Use repquota / to review your quotas on the root partition. If you’re at the limit, raise your quota or clear up some disk space. Apache logs are usually the culprit in these situations.
3. Clear out your active semaphores
Semaphores? What the heck is a semaphore? Well, it’s actually an apparatus for conveying information by means of visual signals (http://en.wikipedia.org/wiki/Semaphore). But, when it comes to programming, semaphores are used for communicating between the active processes of a certain application (http://en.wikipedia.org/wiki/Semaphore_%28programming%29). In the case of Apache, they’re used to communicate between the parent and child processes. If Apache can’t write these things down, then it can’t communicate properly with all of the processes it starts.
I’d assume if you’re reading this article, Apache has stopped running. Run this command as root:
# ipcs -s
If you see a list of semaphores, Apache has not cleaned up after itself, and some semaphores are stuck. Clear them out with this command:
# for i in `ipcs -s | awk '/httpd/ {print $2}'`; do (ipcrm -s $i); done
Now, in almost all cases, Apache should start properly. If it doesn’t, you may just be completely out of available semaphores. You may want to increase your available semaphores, and you’ll need to tickle your kernel to do so. Add this to /etc/sysctl.conf:
kernel.msgmni = 1024
kernel.sem = 250 256000 32 1024
And then run sysctl -p to pick up the new changes.
Further reading:
Wikipedia: Semaphore (Programming) (http://en.wikipedia.org/wiki/Semaphore_%28programming%29)
Apache accept lock fix (http://www.webpipe.net/howto/Apache_accept_lock_fix)
vBulletin® v4.0.7, Copyright ©2000-2008, Jelsoft Enterprises Ltd.