by uxp
It’s been a while since I’ve posted anything. Been a busy year so far. So busy, that I haven’t hacked at my apache configuration in a while, and have been focusing on frontends of applications and stayed away from the backends. Up until today. I ran into an issue that required me to reload my php.ini, by restarting apache. No big deal, except for this little error:
/usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument
What the hell? A little digging around and I see that Mac OS 10.6.5 updated the included Apache package, including some bug fixes. Apparently they left out a change that would have prevented this error. Luckily it is a quick fix, make a backup copy, and then open up /usr/sbin/apachectl in your favorite editor with root permissions and search for “ULIMIT_MAX_FILES”:
sudo cp /usr/sbin/apachectl /usr/sbin/apachectl.BAK
sudo vim /usr/sbin/apachectl
And then remove everything in the quotes, as shown in this diff:
Then you’re good to go. If you are uncomfortable editing system commands in an editor, feel free to save that diff to your home directory as a file called apachectl.patch, or similar and run it with:
patch -p1 < ~/apachectl.patch
That should take care of everything. For more information on diff files and patching, query:
man patch
man diff
or check out this article The Ten Minute Guide to diff and patch which I’ll admit to referring to every once in a while when I need to create a patch by hand.
tags: