Symptom
ProcessViewer or top indicates that many instances of httpd process are running when the server is under light load.
Solution
Use
one of the following solutions (A or B).
A. Disable logging
If you do not need a log, you may disable logging by using Server Admin. Follow these steps:
1. Click the Internet tab in Server Admin.
2. Click the Web icon and choose Configure Web Service.
3. Click the Sites tab.
4. Select the site for which logging is to be disabled.
5. Click Edit.
6. Click the checkboxes to deselect both "Enable access log" and "Enable error log."
7. Click Save.
Note: If you are hosting more than one Web site, you should change this setting for each site.
B. Change the logging method
If you need a log, follow these steps to change the method that Mac OS X Server uses to log Web server information. The script presented here logs one week of data and then deletes the oldest log file.
First, disable the logs' Archive feature if it is enabled. Follow these steps:
1. Click the Internet tab in Server Admin.
2. Click the Web icon and choose Configure Web Service.
3. Click the Sites tab.
4. Select the site for which logging is to be modified.
5. Click Edit.
6. Be sure that both checkboxes for Archive are deselected.
7. Click Save if you made a change.
Note: If you are hosting more than one Web site, you should change this setting for each site.
Next, you need to edit the /etc/daily file. Follow these steps:
1. Open Terminal (located at /Applications/Utilities/)
2. Type: pico /etc/daily
3. Press Return
4. At the end of the file, paste in the following segment of script:
Begin copying below this line.
echo ""
echo -n "Rotating Apache log files:"
cd /var/log/httpd
for i in httpd.log; do
if [ -f "${i}" ]; then
echo -n " ${i}"
if [ -x /usr/bin/gzip ]; then gzext=".gz"; else gzext=""; fi
if [ -f "${i}.6${gzext}" ]; then mv -f "${i}.6${gzext}" "${i}.7${gzext}"; fi
if [ -f "${i}.5${gzext}" ]; then mv -f "${i}.5${gzext}" "${i}.6${gzext}"; fi
if [ -f "${i}.4${gzext}" ]; then mv -f "${i}.4${gzext}" "${i}.5${gzext}"; fi
if [ -f "${i}.3${gzext}" ]; then mv -f "${i}.3${gzext}" "${i}.4${gzext}"; fi
if [ -f "${i}.2${gzext}" ]; then mv -f "${i}.2${gzext}" "${i}.3${gzext}"; fi
if [ -f "${i}.1${gzext}" ]; then mv -f "${i}.1${gzext}" "${i}.2${gzext}"; fi
if [ -f "${i}.0${gzext}" ]; then mv -f "${i}.0${gzext}" "${i}.1${gzext}"; fi
if [ -f "${i}" ]; then mv -f "${i}" "${i}.0"; fi
touch "${i}" && chmod 640 "${i}"
/usr/sbin/apachectl restart
if [ -x /usr/bin/gzip ]; then gzip -9 "${i}.0"; fi
fi
done
End copying above this line.
5. Save the file (press Control-O), press Return, and exit pico (press Control-X).
Note: This will stop the Web server momentarily to let it start logging to the new files.